feat: streamline macOS build process and update Homebrew formula action #12
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: Build for macOS | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| profile: minimal | |
| toolchain: stable | |
| target: aarch64-apple-darwin | |
| override: true | |
| - name: Cache cargo registry | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cargo/registry | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo index | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Cache cargo build | |
| uses: actions/cache@v3 | |
| with: | |
| path: target | |
| key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} | |
| - name: Build | |
| run: cargo build --release --target aarch64-apple-darwin | |
| - name: Create archive | |
| run: | | |
| cd target/aarch64-apple-darwin/release | |
| tar czf tide.tar.gz tide | |
| shasum -a 256 tide.tar.gz > tide.tar.gz.sha256 | |
| - name: Upload Release Assets | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| target/aarch64-apple-darwin/release/tide.tar.gz | |
| target/aarch64-apple-darwin/release/tide.tar.gz.sha256 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| update-homebrew: | |
| name: Update Homebrew Tap | |
| needs: build | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - uses: mislav/bump-homebrew-formula-action@v3 | |
| with: | |
| formula-name: tide | |
| formula-path: Formula/tide.rb | |
| homebrew-tap: BreathCodeFlow/homebrew-tap | |
| base-branch: main | |
| download-url: https://github.com/BreathCodeFlow/tide/releases/download/${{ github.ref_name }}/tide.tar.gz | |
| commit-message: | | |
| {{formulaName}} {{version}} | |
| Created by https://github.com/mislav/bump-homebrew-formula-action |