From 80877781495328d5b61fa70d3c7d45757db8c11f Mon Sep 17 00:00:00 2001 From: trobo <57040351+trobonox@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:28:28 +0200 Subject: [PATCH 1/4] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5956bc3d..21ccaa27 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,7 +63,7 @@ jobs: - name: Install Tauri CLI if: matrix.platform.rust_target == 'aarch64-apple-darwin' - run: yarn add -D @tauri-apps/cli-darwin-arm64 + run: yarn add @tauri-apps/cli-darwin-arm64 - uses: JonasKruckenberg/tauri-build@v1.4.0 id: tauri_build From 57290f1ab8f10d0b6e4744b5539c65a358025bdf Mon Sep 17 00:00:00 2001 From: trobo <57040351+trobonox@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:41:11 +0200 Subject: [PATCH 2/4] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 21ccaa27..7544a507 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -65,7 +65,7 @@ jobs: if: matrix.platform.rust_target == 'aarch64-apple-darwin' run: yarn add @tauri-apps/cli-darwin-arm64 - - uses: JonasKruckenberg/tauri-build@v1.4.0 + - uses: JonasKruckenberg/tauri-build@v1.2.2 id: tauri_build with: target: ${{ matrix.platform.rust_target }} From 5329b3c3bbd365d6af135092c7745bff1f508e30 Mon Sep 17 00:00:00 2001 From: trobonox <57040351+trobonox@users.noreply.github.com> Date: Wed, 12 Jun 2024 13:47:11 +0200 Subject: [PATCH 3/4] chore: try to fix release CI with new action --- .github/workflows/release.yml | 107 ++++++++++++---------------------- 1 file changed, 37 insertions(+), 70 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7544a507..3747a7fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,94 +14,61 @@ concurrency: cancel-in-progress: true jobs: - build-binaries: + publish-tauri: + permissions: + contents: write strategy: fail-fast: false matrix: - platform: - - os: ubuntu-22.04 - rust_target: x86_64-unknown-linux-gnu - - os: macos-13 - rust_target: x86_64-apple-darwin - - os: macos-latest - rust_target: aarch64-apple-darwin - - os: windows-latest - rust_target: x86_64-pc-windows-msvc - - - runs-on: ${{ matrix.platform.os }} + include: + - platform: "macos-latest" # for Arm based macs (M1 and above). + args: "--target aarch64-apple-darwin" + - platform: "macos-latest" # for Intel based macs. + args: "--target x86_64-apple-darwin" + - platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04. + args: "" + - platform: "windows-latest" + args: "" + + runs-on: ${{ matrix.platform }} steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 - - - name: Output info - run: echo ${{ matrix.platform.os }} ${{ matrix.platform.rust_target }} + - uses: actions/checkout@v4 - name: setup node uses: actions/setup-node@v4 with: - node-version: 20 + node-version: lts/* - - name: 'Setup Rust' - uses: actions-rs/toolchain@v1 + - name: install Rust stable + uses: dtolnay/rust-toolchain@stable with: - default: true - override: true - profile: minimal - toolchain: stable - target: ${{ matrix.platform.rust_target }} + # Those targets are only used on macos runners so it's in an `if` to slightly speed up windows and linux builds. + targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }} - - uses: Swatinem/rust-cache@v2 - - - name: install dependencies (ubuntu x86_64) - if: matrix.platform.os == 'ubuntu-22.04' + - name: install dependencies (ubuntu only) + if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above. run: | sudo apt-get update - sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf - - - name: Build Frontend - run: yarn && yarn generate + sudo apt-get install -y libwebkit2gtk-4.0-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf + # webkitgtk 4.0 is for Tauri v1 - webkitgtk 4.1 is for Tauri v2. + # You can remove the one that doesn't apply to your app to speed up the workflow a bit. - - name: Install Tauri CLI - if: matrix.platform.rust_target == 'aarch64-apple-darwin' - run: yarn add @tauri-apps/cli-darwin-arm64 + - name: install frontend dependencies + run: yarn install # change this to npm, pnpm or bun depending on which one you use. - - uses: JonasKruckenberg/tauri-build@v1.2.2 - id: tauri_build - with: - target: ${{ matrix.platform.rust_target }} - - # The `artifacts` output can now be used by a different action to upload the artifacts - - uses: actions/upload-artifact@v4 - with: - name: artifacts - path: "${{ join(fromJSON(steps.tauri_build.outputs.artifacts), '\n') }}" - - publish: - needs: build-binaries - runs-on: ubuntu-latest - outputs: - upload_url: ${{ steps.release.outputs.upload_url }} - steps: - - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 - # Download the previously uploaded artifacts - - uses: actions/download-artifact@v4 - id: download - with: - name: artifacts - path: artifacts - # And create a release with the artifacts attached - - name: 'create release' - uses: softprops/action-gh-release@master - id: release + - uses: tauri-apps/tauri-action@v0 env: - GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - name: "Kanri vx.x.x" - draft: true - files: ./artifacts/**/* + tagName: app-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version. + releaseName: "App v__VERSION__" + releaseBody: "See the assets to download this version and install." + releaseDraft: true + prerelease: false + args: ${{ matrix.args }} publish-kanri-arm: - needs: publish + needs: publish-tauri strategy: matrix: arch: [arm64, armv7] @@ -122,5 +89,5 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ needs.publish.outputs.upload_url }} + upload_url: ${{ needs.publish-tauri.outputs.releaseHtmlUrl }} targets: ./src-tauri/target/*/release/bundle/deb/*.deb From a52f22cb810bd3aa3f887735f91d2073f51cf1cf Mon Sep 17 00:00:00 2001 From: trobo <57040351+trobonox@users.noreply.github.com> Date: Wed, 12 Jun 2024 13:52:55 +0200 Subject: [PATCH 4/4] fix: build frontend in release CI --- .github/workflows/release.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3747a7fc..4a318885 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,6 +56,9 @@ jobs: - name: install frontend dependencies run: yarn install # change this to npm, pnpm or bun depending on which one you use. + - name: Build frontend + run: yarn generate # change this to npm, pnpm or bun depending on which one you use. + - uses: tauri-apps/tauri-action@v0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}