diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..909637159 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..e0cfda84d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,65 @@ +name: CI +on: + push: + branches: + - master + tags: + - 'v*' + pull_request: + branches: + - master +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - name: Determine version + id: determine_version + run: | + if [[ ${GITHUB_REF} == refs/tags/v* ]]; then + echo "version_arg=" >> $GITHUB_OUTPUT + else + commit_hash=$(git rev-parse --short HEAD) + echo "version_arg=-DOVERRULED_WEBODF_VERSION=0.0.0-build${commit_hash}" >> $GITHUB_OUTPUT + fi + + - name: Cache build directory + id: cache-build + uses: actions/cache@v4 + with: + path: build + key: build-v1-${{ runner.os }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ steps.determine_version.outputs.version_arg }} + restore-keys: | + build-v1-${{ runner.os }}-${{ hashFiles('**/CMakeLists.txt') }}- + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake default-jdk libqt5webkit5-dev + + - name: Build webodf.js + run: | + mkdir -p build + cd build + cmake .. ${{ steps.determine_version.outputs.version_arg }} + make webodf.js-target + + - name: Prepare deployment + if: github.event_name == 'push' + run: | + mkdir -p deploy/webodf + cp build/webodf/webodf.js deploy/webodf/ + cp viewer/index.html deploy/ + # Include example ODT files for the demo viewer + cp -r examples deploy/ + + - name: Deploy to gh-pages + if: github.event_name == 'push' + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./deploy diff --git a/CMakeLists.txt b/CMakeLists.txt index 54a56fe5b..4493d357d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -244,8 +244,7 @@ endif() ExternalProject_Add( Dojo DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} - URL "http://download.dojotoolkit.org/release-1.8.1/dojo-release-1.8.1-src.tar.gz" - URL_MD5 9b80b9a736b81c336accd832f3c3aea2 + URL "https://download.dojotoolkit.org/release-1.10.4/dojo-release-1.10.4-src.tar.gz" CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" diff --git a/examples/.keep b/examples/.keep new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/examples/.keep @@ -0,0 +1 @@ + diff --git a/examples/sample1.odt b/examples/sample1.odt new file mode 100644 index 000000000..51a59ff7d Binary files /dev/null and b/examples/sample1.odt differ diff --git a/examples/sample2.odt b/examples/sample2.odt new file mode 100644 index 000000000..6474a307a Binary files /dev/null and b/examples/sample2.odt differ diff --git a/examples/sample3.odt b/examples/sample3.odt new file mode 100644 index 000000000..f867b4098 Binary files /dev/null and b/examples/sample3.odt differ diff --git a/programs/editor/dojo-deps/src/app/package.json b/programs/editor/dojo-deps/src/app/package.json index c090977fb..b4adbf61e 100644 --- a/programs/editor/dojo-deps/src/app/package.json +++ b/programs/editor/dojo-deps/src/app/package.json @@ -3,9 +3,9 @@ "version": "1.0", "main": "main", "dependencies": { - "dojo": "1.8.0", - "dijit": "1.8.0", - "dojox": "1.8.0", + "dojo": "1.16.5", + "dijit": "1.13.8", + "dojox": "1.14.6", "util": "1.8.0" }, "description": "Dojo Boilerplate Example Application. A quick-start application that demonstrates basic usage of the Dojo Toolkit. This package.json file is a CommonJS Packages/1.0 manifest, with a special `dojoBuild` property to point to the build file for this package.", diff --git a/viewer/examples/sample1.odt b/viewer/examples/sample1.odt new file mode 100644 index 000000000..a85497c9c --- /dev/null +++ b/viewer/examples/sample1.odt @@ -0,0 +1 @@ + File Examples | Download redirect...

Downloading...

Please wait a moment

diff --git a/viewer/examples/sample2.odt b/viewer/examples/sample2.odt new file mode 100644 index 000000000..e25f3a500 --- /dev/null +++ b/viewer/examples/sample2.odt @@ -0,0 +1 @@ + File Examples | Download redirect...

Downloading...

Please wait a moment

diff --git a/viewer/examples/sample3.odt b/viewer/examples/sample3.odt new file mode 100644 index 000000000..4c7beed48 --- /dev/null +++ b/viewer/examples/sample3.odt @@ -0,0 +1 @@ + File Examples | Download redirect...

Downloading...

Please wait a moment

diff --git a/viewer/index.html b/viewer/index.html new file mode 100644 index 000000000..f38474e43 --- /dev/null +++ b/viewer/index.html @@ -0,0 +1,94 @@ + + + + + WebODF Viewer Demo + + + + + + + + +
+
+
+ + + + \ No newline at end of file diff --git a/webodf/tools/updateJS.js b/webodf/tools/updateJS.js index 3b4cb27fd..7f938fc64 100644 --- a/webodf/tools/updateJS.js +++ b/webodf/tools/updateJS.js @@ -543,7 +543,12 @@ function Main(cmakeListPath) { // The file has no errors, save it so it will be skipped at the // next run. mkdir(pathModule.dirname(lpath)); - fs.writeFile(lpath, contents); + fs.writeFile(lpath, contents, function (err) { + if (err) { + console.log(err); + exitCode = 1; + } + }); } else { errors = jslint.errors; for (i = 0; i < errors.length && errors[i]; i += 1) {