Merge pull request #75 from unsecretised/update-trayicon-title-logic #37
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build macOS Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-macos: | |
| runs-on: macos-14 | |
| env: | |
| APP_VERSION: ${{ github.ref_name }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain (both macOS targets) | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: aarch64-apple-darwin,x86_64-apple-darwin | |
| - name: Install cargo-bundle | |
| run: cargo install cargo-bundle | |
| - name: Cache cargo registry | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/registry | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo index | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo build | |
| uses: actions/cache@v4 | |
| with: | |
| path: target | |
| key: ${{ runner.os }}-universal-cargo-build-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build release bundles (aarch64 + x86_64) | |
| run: | | |
| cargo bundle --release --target aarch64-apple-darwin | |
| cargo bundle --release --target x86_64-apple-darwin | |
| - name: Create artifacts directory | |
| run: mkdir -p artifacts | |
| - name: Package app bundles | |
| run: | | |
| cd target/aarch64-apple-darwin/release/bundle/osx | |
| zip -r ../../../../../artifacts/rustcast-aarch64-apple-darwin.app.zip *.app | |
| cd - >/dev/null | |
| cd target/x86_64-apple-darwin/release/bundle/osx | |
| zip -r ../../../../../artifacts/rustcast-x86_64-apple-darwin.app.zip *.app | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-bundles | |
| path: artifacts/*.zip | |
| retention-days: 7 | |
| create-release: | |
| needs: build-macos | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: artifacts/**/*.zip | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |