chore: trigger GitHub contributors cache update #19
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 Rust Binaries | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| bump_version: | |
| name: Bump Version and Tag | |
| runs-on: ubuntu-latest | |
| outputs: | |
| new_tag: ${{ steps.tag_version.outputs.new_tag }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Bump version and push tag | |
| id: tag_version | |
| uses: mathieudutour/github-tag-action@v6.2 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| default_bump: patch | |
| build: | |
| name: Build on ${{ matrix.os }} | |
| needs: bump_version | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, windows-latest, macos-latest] | |
| include: | |
| - os: ubuntu-latest | |
| artifact_name: codestate | |
| asset_name: codestate-linux-amd64 | |
| - os: windows-latest | |
| artifact_name: codestate.exe | |
| asset_name: codestate-windows-amd64.exe | |
| - os: macos-latest | |
| artifact_name: codestate | |
| asset_name: codestate-darwin-amd64 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Build release binary | |
| run: cargo build --release | |
| - name: Rename and Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.asset_name }} | |
| path: target/release/${{ matrix.artifact_name }} | |
| - name: Prepare Release Asset | |
| shell: bash | |
| run: cp target/release/${{ matrix.artifact_name }} ${{ matrix.asset_name }} | |
| - name: Upload to Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ needs.bump_version.outputs.new_tag }} | |
| files: ${{ matrix.asset_name }} |