From e5e9acec313d151f11629722ccf63d1fd1d17a06 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sun, 6 Jun 2021 01:51:52 +0430 Subject: [PATCH 01/10] ci build with Tachidesk --- .github/runner-files/ci-gradle.properties | 7 ++ .github/workflows/publish.yml | 91 +++++++++++++++++++++++ package.json | 2 +- 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 .github/runner-files/ci-gradle.properties create mode 100644 .github/workflows/publish.yml diff --git a/.github/runner-files/ci-gradle.properties b/.github/runner-files/ci-gradle.properties new file mode 100644 index 0000000..753351b --- /dev/null +++ b/.github/runner-files/ci-gradle.properties @@ -0,0 +1,7 @@ +org.gradle.daemon=false +org.gradle.jvmargs=-Xmx5120m +org.gradle.workers.max=5 +org.gradle.parallel=true + +kotlin.incremental=false +kotlin.compiler.execution.strategy=in-process diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..1db5d26 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,91 @@ +name: CI Publish + +on: + push: + tags: + - 'v*' + +jobs: + build: + name: Build artifacts and release + runs-on: ubuntu-latest + + steps: + - name: Cancel previous runs + uses: styfle/cancel-workflow-action@0.9.0 + with: + access_token: ${{ github.token }} + + - name: Checkout Tachidesk + uses: actions/checkout@v2 + with: + repository: 'Suwayomi/Tachidesk' + ref: main + path: tachidesk + fetch-depth: 0 + + - name: Remove Tachidesk's webUI + run: rm -rf tachidesk/webUI/src/* + + - name: Checkout ${{ github.ref }} + uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} + path: tachidesk/webUI/src + +# Build Tachidesk with Equinox together + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + + - name: Copy CI gradle.properties + run: | + cd master + mkdir -p ~/.gradle + cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties + + - name: Download android.jar + run: | + cd master + curl https://raw.githubusercontent.com/Suwayomi/Tachidesk/android-jar/android.jar -o AndroidCompat/lib/android.jar + + - name: Cache node_modules + uses: actions/cache@v2 + with: + path: | + **/react/node_modules + key: ${{ runner.os }}-${{ hashFiles('**/webUI/yarn.lock') }} + + - name: Build and copy webUI, Build Jar + uses: eskatos/gradle-command-action@v1 + env: + TachideskBuildType: "Stable" + with: + build-root-directory: master + wrapper-directory: master + arguments: :webUI:copyBuild :server:shadowJar --stacktrace + wrapper-cache-enabled: true + dependencies-cache-enabled: true + configuration-cache-enabled: true + + - name: make windows packages + run: | + cd master/scripts + ./windows-bundler.sh win32 + ./windows-bundler.sh win64 + + - name: Upload Release + uses: xresloader/upload-to-github-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + file: "master/server/build/*.jar;master/server/build/*.zip" + tags: true + draft: true + verbose: true + + - name: Run Docker build workflow + run: | + curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.DEPLOY_PREVIEW_TOKEN }}" -d '{"ref":"main", "inputs":{"tachidesk_release_type": "stable"}}' https://api.github.com/repos/suwayomi/docker-tachidesk/actions/workflows/build_container_images.yml/dispatches + diff --git a/package.json b/package.json index 52a22ba..d8081f7 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.0.0", "scripts": { "dev": "vite", - "build": "vue-tsc --noEmit && vite build && cp _redirects dist/_redirects", + "build": "vue-tsc --noEmit && vite build && cp _redirects dist/_redirects && mv dist build", "serve": "vite preview", "storybook": "start-storybook -p 6006", "build-storybook": "build-storybook" From 4538bbb84ab5adbc536e304fdb5f389092402e72 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sun, 6 Jun 2021 01:54:12 +0430 Subject: [PATCH 02/10] make some fixes --- .github/workflows/publish.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1db5d26..acf3110 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -78,14 +78,9 @@ jobs: - name: Upload Release uses: xresloader/upload-to-github-release@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ github.token }} with: file: "master/server/build/*.jar;master/server/build/*.zip" tags: true draft: true verbose: true - - - name: Run Docker build workflow - run: | - curl -X POST -H "Accept: application/vnd.github.v3+json" -H "Authorization: token ${{ secrets.DEPLOY_PREVIEW_TOKEN }}" -d '{"ref":"main", "inputs":{"tachidesk_release_type": "stable"}}' https://api.github.com/repos/suwayomi/docker-tachidesk/actions/workflows/build_container_images.yml/dispatches - From bc4f4f9c4bb3d7129fe4c6c787154982d08ac3f6 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sun, 6 Jun 2021 01:56:59 +0430 Subject: [PATCH 03/10] fix branch --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index acf3110..72cd11f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v2 with: repository: 'Suwayomi/Tachidesk' - ref: main + ref: master path: tachidesk fetch-depth: 0 From 6178d966a28509747e7709e2f3e9ed77104b4608 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sun, 6 Jun 2021 01:59:24 +0430 Subject: [PATCH 04/10] fix more typo --- .github/workflows/publish.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 72cd11f..f558cdf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -41,13 +41,13 @@ jobs: - name: Copy CI gradle.properties run: | - cd master + cd tachidesk mkdir -p ~/.gradle cp .github/runner-files/ci-gradle.properties ~/.gradle/gradle.properties - name: Download android.jar run: | - cd master + cd tachidesk curl https://raw.githubusercontent.com/Suwayomi/Tachidesk/android-jar/android.jar -o AndroidCompat/lib/android.jar - name: Cache node_modules @@ -62,8 +62,8 @@ jobs: env: TachideskBuildType: "Stable" with: - build-root-directory: master - wrapper-directory: master + build-root-directory: tachidesk + wrapper-directory: tachidesk arguments: :webUI:copyBuild :server:shadowJar --stacktrace wrapper-cache-enabled: true dependencies-cache-enabled: true @@ -71,7 +71,7 @@ jobs: - name: make windows packages run: | - cd master/scripts + cd tachidesk/scripts ./windows-bundler.sh win32 ./windows-bundler.sh win64 @@ -80,7 +80,7 @@ jobs: env: GITHUB_TOKEN: ${{ github.token }} with: - file: "master/server/build/*.jar;master/server/build/*.zip" + file: "tachidesk/server/build/*.jar;tachidesk/server/build/*.zip" tags: true draft: true verbose: true From 1400f6a26e41d3d7e4b149c39634b9c484b787f7 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sun, 6 Jun 2021 02:03:23 +0430 Subject: [PATCH 05/10] correct some suff --- .github/workflows/publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f558cdf..4e9e659 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -27,7 +27,7 @@ jobs: - name: Remove Tachidesk's webUI run: rm -rf tachidesk/webUI/src/* - - name: Checkout ${{ github.ref }} + - name: Checkout Equinox and put it as webUI uses: actions/checkout@v2 with: ref: ${{ github.ref }} @@ -54,8 +54,8 @@ jobs: uses: actions/cache@v2 with: path: | - **/react/node_modules - key: ${{ runner.os }}-${{ hashFiles('**/webUI/yarn.lock') }} + **/webUI/src/node_modules + key: ${{ runner.os }}-${{ hashFiles('**/webUI/src/node_modules') }} - name: Build and copy webUI, Build Jar uses: eskatos/gradle-command-action@v1 From 885e71d3140370a6456d23aa5c084bfe0fac35aa Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sun, 6 Jun 2021 02:55:57 +0430 Subject: [PATCH 06/10] configs from Tachidesk --- .github/workflows/publish.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4e9e659..37ef52e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -33,6 +33,14 @@ jobs: ref: ${{ github.ref }} path: tachidesk/webUI/src + - name: Calculate revision + id: calcRevision + run: | + cd tachidesk/webUI/src + rev=$(git rev-list HEAD --count) + echo "revision $git rev-list HEAD --count" + echo "::set-output name=value::$rev" + # Build Tachidesk with Equinox together - name: Set up JDK 1.8 uses: actions/setup-java@v1 @@ -60,7 +68,10 @@ jobs: - name: Build and copy webUI, Build Jar uses: eskatos/gradle-command-action@v1 env: - TachideskBuildType: "Stable" + ProductName: "Equinox" + ProductBuildType: "Stable" + ProductVersion: ${{ github.ref }} + ProductRevision: ${{ steps.calcRevision.outputs.value }} with: build-root-directory: tachidesk wrapper-directory: tachidesk From 803c9168c5caa532579b6fccf8007e52edbe443f Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sun, 6 Jun 2021 02:57:39 +0430 Subject: [PATCH 07/10] fix typo --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 37ef52e..0ec1b0a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -38,7 +38,7 @@ jobs: run: | cd tachidesk/webUI/src rev=$(git rev-list HEAD --count) - echo "revision $git rev-list HEAD --count" + echo "revision $rev" echo "::set-output name=value::$rev" # Build Tachidesk with Equinox together From 97c41eae905d5bb1bcc89a2d599fa1f44cc0b769 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sun, 6 Jun 2021 03:18:58 +0430 Subject: [PATCH 08/10] fix cache --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0ec1b0a..62051c1 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -63,7 +63,7 @@ jobs: with: path: | **/webUI/src/node_modules - key: ${{ runner.os }}-${{ hashFiles('**/webUI/src/node_modules') }} + key: ${{ runner.os }}-${{ hashFiles('**/webUI/src/yarn.lock') }} - name: Build and copy webUI, Build Jar uses: eskatos/gradle-command-action@v1 From 1518de09c10150f4e55aab720a0006f9a71655d6 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sun, 6 Jun 2021 03:34:12 +0430 Subject: [PATCH 09/10] calcualte revision correctly --- .github/workflows/publish.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 62051c1..a194117 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,6 +32,7 @@ jobs: with: ref: ${{ github.ref }} path: tachidesk/webUI/src + fetch-depth: 0 - name: Calculate revision id: calcRevision @@ -39,7 +40,7 @@ jobs: cd tachidesk/webUI/src rev=$(git rev-list HEAD --count) echo "revision $rev" - echo "::set-output name=value::$rev" + echo "::set-output name=value::r$rev" # Build Tachidesk with Equinox together - name: Set up JDK 1.8 From 4a946658b45a169670913babd72657b88d588297 Mon Sep 17 00:00:00 2001 From: Aria Moradi Date: Sun, 6 Jun 2021 03:43:00 +0430 Subject: [PATCH 10/10] test --- .github/workflows/publish.yml | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a194117..852e792 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -66,20 +66,26 @@ jobs: **/webUI/src/node_modules key: ${{ runner.os }}-${{ hashFiles('**/webUI/src/yarn.lock') }} - - name: Build and copy webUI, Build Jar - uses: eskatos/gradle-command-action@v1 - env: - ProductName: "Equinox" - ProductBuildType: "Stable" - ProductVersion: ${{ github.ref }} - ProductRevision: ${{ steps.calcRevision.outputs.value }} - with: - build-root-directory: tachidesk - wrapper-directory: tachidesk - arguments: :webUI:copyBuild :server:shadowJar --stacktrace - wrapper-cache-enabled: true - dependencies-cache-enabled: true - configuration-cache-enabled: true + # - name: Build and copy webUI, Build Jar + # uses: eskatos/gradle-command-action@v1 + # env: + # ProductName: "Equinox" + # ProductBuildType: "Stable" + # ProductVersion: ${{ github.ref }} + # ProductRevision: ${{ steps.calcRevision.outputs.value }} + # with: + # build-root-directory: tachidesk + # wrapper-directory: tachidesk + # arguments: :webUI:copyBuild :server:shadowJar --stacktrace + # wrapper-cache-enabled: true + # dependencies-cache-enabled: true + # configuration-cache-enabled: true + + - name: Mock Build and copy webUI, Build Jar + run: | + mkdir -p tachidesk/server/build + cd tachidesk/server/build + echo "test" > Equinox-v0.0.8-r1.jar - name: make windows packages run: |