From 7449a209fb61d6eba6bbe337941fb8c62a907f99 Mon Sep 17 00:00:00 2001 From: didirus4 Date: Mon, 7 Jul 2025 17:57:14 +0300 Subject: [PATCH] update workflow --- ...heseus-build.yml => astralrinth-build.yml} | 75 +++++++------------ 1 file changed, 27 insertions(+), 48 deletions(-) rename .github/workflows/{theseus-build.yml => astralrinth-build.yml} (56%) diff --git a/.github/workflows/theseus-build.yml b/.github/workflows/astralrinth-build.yml similarity index 56% rename from .github/workflows/theseus-build.yml rename to .github/workflows/astralrinth-build.yml index 3196cd36a..a4a419bc7 100644 --- a/.github/workflows/theseus-build.yml +++ b/.github/workflows/astralrinth-build.yml @@ -1,4 +1,5 @@ name: AstralRinth App build + on: push: branches: @@ -7,7 +8,7 @@ on: tags: - 'v*' paths: - - .github/workflows/theseus-build.yml + - .github/workflows/astralrinth-build.yml - 'apps/app/**' - 'apps/app-frontend/**' - 'packages/app-lib/**' @@ -15,30 +16,25 @@ on: - 'packages/assets/**' - 'packages/ui/**' - 'packages/utils/**' - workflow_dispatch: - inputs: - sign-windows-binaries: - description: Sign Windows binaries - type: boolean - default: true - required: false + +env: + SIGN_WINDOWS_BINARIES: true jobs: build: name: Build + runs-on: ${{ matrix.platform }} strategy: fail-fast: false matrix: - platform: [macos-latest, windows-latest, ubuntu-22.04] + platform: [ubuntu, windows, macos] include: - - platform: macos-latest - artifact-target-name: universal-apple-darwin - - platform: windows-latest - artifact-target-name: x86_64-pc-windows-msvc - - platform: ubuntu-22.04 + - platform: ubuntu artifact-target-name: x86_64-unknown-linux-gnu - - runs-on: ${{ matrix.platform }} + - platform: windows + artifact-target-name: x86_64-pc-windows-msvc + - platform: macos + artifact-target-name: universal-apple-darwin steps: - name: 📥 Check out code @@ -49,8 +45,7 @@ jobs: - name: 🧰 Setup Rust toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: - rustflags: '' - target: ${{ startsWith(matrix.platform, 'macos') && 'x86_64-apple-darwin' || '' }} + target: ${{ matrix.artifact-target-name }} - name: 🧰 Install pnpm uses: pnpm/action-setup@v4 @@ -62,28 +57,15 @@ jobs: cache: pnpm - name: 🧰 Install Linux build dependencies - if: startsWith(matrix.platform, 'ubuntu') + if: matrix.platform == 'ubuntu' run: | sudo apt-get update - sudo apt-get install -yq libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev xdg-utils openjdk-11-jdk - - - name: 🧰 Setup Dasel - uses: jaxxstorm/action-install-gh-release@v2.1.0 - with: - repo: TomWright/dasel - tag: v2.8.1 - extension-matching: disable - rename-to: ${{ startsWith(matrix.platform, 'windows') && 'dasel.exe' || 'dasel' }} - chmod: 0755 - - - name: ⚙️ Set application version - shell: bash - env: - APP_VERSION: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || format('v1.0.0-canary+{0}', github.sha) }} - run: | - dasel put -f apps/app/Cargo.toml -t string -v "${APP_VERSION#v}" 'package.version' - dasel put -f packages/app-lib/Cargo.toml -t string -v "${APP_VERSION#v}" 'package.version' - dasel put -f apps/app-frontend/package.json -t string -v "${APP_VERSION#v}" 'version' + sudo apt-get install -yq \ + libwebkit2gtk-4.1-dev \ + libayatana-appindicator3-dev \ + librsvg2-dev \ + xdg-utils \ + openjdk-11-jdk - name: 💨 Setup Turbo cache uses: rharkor/caching-for-turbo@v1.8 @@ -91,15 +73,11 @@ jobs: - name: 🧰 Install dependencies run: pnpm install - - name: ✍️ Set up Windows code signing - if: startsWith(matrix.platform, 'windows') + - name: ✍️ Set up Windows code signing (jsign) + if: matrix.platform == 'windows' && env.SIGN_WINDOWS_BINARIES == 'true' shell: bash run: | - if [ '${{ startsWith(github.ref, 'refs/tags/v') || inputs.sign-windows-binaries }}' = 'true' ]; then - choco install jsign --ignore-dependencies # GitHub runners come with a global Java installation already - else - dasel delete -f apps/app/tauri-release.conf.json 'bundle.windows.signCommand' - fi + choco install jsign --ignore-dependencies - name: 🗑️ Clean up cached bundles shell: bash @@ -108,24 +86,25 @@ jobs: rm -rf target/*/release/bundle || true - name: 🔨 Build macOS app + if: matrix.platform == 'macos' run: pnpm --filter=@modrinth/app run tauri build --target universal-apple-darwin --config tauri-release.conf.json - if: startsWith(matrix.platform, 'macos') env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - name: 🔨 Build Linux app + if: matrix.platform == 'ubuntu' run: pnpm --filter=@modrinth/app run tauri build --config tauri-release.conf.json - if: startsWith(matrix.platform, 'ubuntu') env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - name: 🔨 Build Windows app + if: matrix.platform == 'windows' + shell: pwsh run: | $env:JAVA_HOME = "$env:JAVA_HOME_11_X64" pnpm --filter=@modrinth/app run tauri build --config tauri-release.conf.json --verbose --bundles 'nsis' - if: startsWith(matrix.platform, 'windows') env: TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}