feat: simplify Homebrew formula update process with action #11
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 | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-apple-darwin | |
| os: macos-13 | |
| name: tide-x86_64-apple-darwin | |
| - target: aarch64-apple-darwin | |
| os: macos-14 | |
| name: tide-aarch64-apple-darwin | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| profile: minimal | |
| toolchain: stable | |
| target: ${{ matrix.target }} | |
| 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 ${{ matrix.target }} | |
| - name: Create archive | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| tar czf ${{ matrix.name }}.tar.gz tide | |
| shasum -a 256 ${{ matrix.name }}.tar.gz > ${{ matrix.name }}.tar.gz.sha256 | |
| - name: Upload Release Assets | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: | | |
| target/${{ matrix.target }}/release/${{ matrix.name }}.tar.gz | |
| target/${{ matrix.target }}/release/${{ matrix.name }}.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 | |
| - name: Update Homebrew formula | |
| uses: dawidd6/action-homebrew-bump-formula@v4 | |
| with: | |
| # Required, custom personal GitHub access token with only the 'public_repo' scope enabled | |
| token: ${{secrets.GITHUB_TOKEN}} | |
| # Optional, will commit with this user name | |
| user_name: BreathCodeFlow | |
| # Optional, will commit with this user email | |
| user_email: markus.sommer@fullhaus.de | |
| # Bump all outdated formulae in this tap | |
| tap: BreathCodeFlow/homebrew-tap | |
| # Bump only these formulae if outdated | |
| formula: tide | |
| # Optional, if don't want to check for already open PRs | |
| force: true # true | |
| # Need to set this input if want to use `brew livecheck` | |
| livecheck: true |