Fix: Inline Homebrew update step (#8) #9
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*' | |
| permissions: | |
| contents: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build-release: | |
| name: Build Release | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| artifact_name: codenav | |
| asset_name: codenav-linux-x86_64 | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| artifact_name: codenav | |
| asset_name: codenav-macos-x86_64 | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| artifact_name: codenav | |
| asset_name: codenav-macos-aarch64 | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| artifact_name: codenav.exe | |
| asset_name: codenav-windows-x86_64.exe | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Build release binary | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Strip binary (Linux/macOS) | |
| if: matrix.os != 'windows-latest' | |
| run: strip target/${{ matrix.target }}/release/${{ matrix.artifact_name }} | |
| - name: Create archive (Linux/macOS) | |
| if: matrix.os != 'windows-latest' | |
| run: | | |
| tar czf ${{ matrix.asset_name }}.tar.gz -C target/${{ matrix.target }}/release ${{ matrix.artifact_name }} | |
| - name: Create archive (Windows) | |
| if: matrix.os == 'windows-latest' | |
| run: | | |
| 7z a ${{ matrix.asset_name }}.zip target/${{ matrix.target }}/release/${{ matrix.artifact_name }} | |
| - name: Upload Release Asset (Linux/macOS) | |
| if: matrix.os != 'windows-latest' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: ${{ matrix.asset_name }}.tar.gz | |
| - name: Upload Release Asset (Windows) | |
| if: matrix.os == 'windows-latest' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: ${{ matrix.asset_name }}.zip | |
| update-homebrew: | |
| name: Update Homebrew Formula | |
| needs: build-release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: mislav/bump-homebrew-formula-action@v3 | |
| with: | |
| formula-name: codenav | |
| tag-name: ${{ github.ref_name }} | |
| homebrew-tap: shaharia-lab/homebrew-tap | |
| env: | |
| COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }} |