From 8c001fa198c61cbe211572d7c49c0069f104613c Mon Sep 17 00:00:00 2001 From: Broken-Deer Date: Wed, 14 Aug 2024 19:33:02 +0800 Subject: [PATCH] ci --- .github/workflows/build.yml | 37 ++++++++++++++----------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f54073a..0018f66 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,13 +11,14 @@ jobs: - uses: actions/checkout@v3 - name: Get app version + id: step run: | - echo "APP_VERSION=$(jq -r .version src-tauri/tauri.conf.json)" >> $GITHUB_ENV - echo $GITHUB_ENV + echo "APP_VERSION=$(jq -r .version src-tauri/tauri.conf.json)" >> "$GITHUB_OUTPUT" && echo "APP_VERSION=$(jq -r .version src-tauri/tauri.conf.json)" outputs: - app_version: ${{ env.APP_VERSION }} + app_version: ${{ steps.step.outputs }} build-arm-linux: + needs: [get-version] runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -80,26 +81,23 @@ jobs: # Build the application yarn tauri build -- --verbose - - name: Get app version - run: echo "APP_VERSION=$(jq -r .version src-tauri/tauri.conf.json)" >> $GITHUB_ENV - - name: Upload deb bundle uses: actions/upload-artifact@v3 with: name: Debian Bundle - path: ${{ github.workspace }}/src-tauri/target/release/bundle/deb/appname_${{ env.APP_VERSION }}_${{ matrix.deb }}.deb + path: ${{ github.workspace }}/src-tauri/target/release/bundle/deb/appname_${{ needs.get-version.outputs.app_version }}_${{ matrix.deb }}.deb - name: Upload rpm bundle uses: actions/upload-artifact@v3 with: name: RPM Bundle - path: ${{ github.workspace }}/src-tauri/target/release/bundle/rpm/appname-${{ env.APP_VERSION }}-1.${{ matrix.rpm }}.rpm + path: ${{ github.workspace }}/src-tauri/target/release/bundle/rpm/appname-${{ needs.get-version.outputs.app_version }}-1.${{ matrix.rpm }}.rpm - name: Upload appimage bundle uses: actions/upload-artifact@v3 with: name: AppImage Bundle - path: ${{ github.workspace }}/src-tauri/target/release/bundle/appimage/appname_${{ env.APP_VERSION }}_${{ matrix.appimage }}.AppImage + path: ${{ github.workspace }}/src-tauri/target/release/bundle/appimage/appname_${{ needs.get-version.outputs.app_version }}_${{ matrix.appimage }}.AppImage build-other: needs: [get-version] permissions: @@ -126,7 +124,7 @@ jobs: - name: install dependencies (ubuntu only) if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above. run: | - echo ${{ env.APP_VERSION }} + echo ${{ needs.get-version.outputs.app_version }} sudo apt-get update sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf tree @@ -172,49 +170,42 @@ jobs: if: matrix.platform == 'ubuntu-22.04' with: name: Debian Bundle - path: ${{ github.workspace }}/src-tauri/target/release/bundle/deb/amethyst-launcher_${{ env.APP_VERSION }}_amd64.deb + path: ${{ github.workspace }}/src-tauri/target/release/bundle/deb/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_amd64.deb - name: Upload rpm bundle uses: actions/upload-artifact@v3 if: matrix.platform == 'ubuntu-22.04' with: name: RPM Bundle - path: ${{ github.workspace }}/src-tauri/target/release/bundle/rpm/amethyst-launcher-${{ env.APP_VERSION }}-1.x86_64.rpm + path: ${{ github.workspace }}/src-tauri/target/release/bundle/rpm/amethyst-launcher-${{ needs.get-version.outputs.app_version }}-1.x86_64.rpm - name: Upload appimage bundle uses: actions/upload-artifact@v3 if: matrix.platform == 'ubuntu-22.04' with: name: AppImage Bundle - path: ${{ github.workspace }}/src-tauri/target/release/bundle/appimage/amethyst-launcher_${{ env.APP_VERSION }}_amd64.AppImage + path: ${{ github.workspace }}/src-tauri/target/release/bundle/appimage/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_amd64.AppImage - name: Upload msi bundle uses: actions/upload-artifact@v3 if: matrix.platform == 'windows-latest' with: name: Windows Bundle(msi) - path: ${{ github.workspace }}/src-tauri/target/release/bundle/msi/amethyst-launcher_${{ env.APP_VERSION }}_x64_en-US.msi + path: ${{ github.workspace }}/src-tauri/target/release/bundle/msi/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_x64_en-US.msi - name: Upload exe bundle uses: actions/upload-artifact@v3 if: matrix.platform == 'windows-latest' with: name: Windows Bundle(exe) - path: ${{ github.workspace }}/src-tauri/target/release/bundle/exe/amethyst-launcher_${{ env.APP_VERSION }}_x64-setup.exe + path: ${{ github.workspace }}/src-tauri/target/release/bundle/exe/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_x64-setup.exe - name: Upload dmg bundle uses: actions/upload-artifact@v3 if: matrix.platform == 'macos-latest' with: name: MacOS ${{ matrix.arch }} bundle(dmg) - path: ${{ github.workspace }}/src-tauri/target/${{matrix.arch}}-apple-darwin/release/bundle/dmg/amethyst-launcher_${{ env.APP_VERSION }}_${{ matrix.arch }}.dmg - - - name: Upload app bundle - uses: actions/upload-artifact@v3 - if: matrix.platform == 'macos-latest' - with: - name: MacOS ${{ matrix.arch }} bundle(app) - path: ${{ github.workspace }}/src-tauri/target/${{matrix.arch}}-apple-darwin/release/bundle/macos/amethyst-launcher.app + path: ${{ github.workspace }}/src-tauri/target/${{matrix.arch}}-apple-darwin/release/bundle/dmg/amethyst-launcher_${{ needs.get-version.outputs.app_version }}_${{ matrix.arch }}.dmg # - uses: tauri-apps/tauri-action@v0 # env: # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}