Build release binaries #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: Build release binaries | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| - "*.*.*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag to build' | |
| required: false | |
| default: "9.99.99" | |
| env: | |
| CARGO_TERM_COLOR: always | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| artifact_name: byte-knight-${{ github.ref_name }} | |
| extension: "" | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| artifact_name: byte-knight-${{ github.ref_name }} | |
| extension: "" | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| artifact_name: byte-knight-${{ github.ref_name }} | |
| extension: ".exe" | |
| permissions: | |
| contents: write | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Install rust | |
| uses: actions-rust-lang/setup-rust-toolchain@v1 | |
| with: | |
| toolchain: stable | |
| target: ${{ matrix.target }} | |
| override: true | |
| - name: Build release | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: byte-knight-${{ matrix.target }}${{ matrix.extension }} | |
| path: ./target/release/${{ matrix.artifact_name }}${{ matrix.extension }} | |
| retention-days: 1 | |
| - name: Copy artifact | |
| run: cp ./target/release/${{ matrix.artifact_name }}${{ matrix.extension }} ./target/${{ matrix.artifact_name }}-${{matrix.target}}${{ matrix.extension }} | |
| - name: Upload to release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: ./target/${{ matrix.artifact_name }}-${{ matrix.target }}${{ matrix.extension }} |