Release 0.7.2 #15
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 | |
| jobs: | |
| build: | |
| name: Build ${{ matrix.target }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross (Linux cross-compiling) | |
| if: matrix.target == 'aarch64-unknown-linux-gnu' | |
| run: cargo install cross --git https://github.com/cross-rs/cross | |
| - name: Build | |
| run: | | |
| if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then | |
| cross build --release --target ${{ matrix.target }} | |
| else | |
| cargo build --release --target ${{ matrix.target }} | |
| fi | |
| - name: Prepare artifact | |
| run: | | |
| BIN_NAME=hammerload | |
| OUT_DIR=release | |
| mkdir -p $OUT_DIR | |
| if [[ "${{ matrix.target }}" == *"windows"* ]]; then | |
| cp target/${{ matrix.target }}/release/${BIN_NAME}.exe $OUT_DIR/${BIN_NAME}-${{ matrix.target }}.exe | |
| else | |
| cp target/${{ matrix.target }}/release/${BIN_NAME} $OUT_DIR/${BIN_NAME}-${{ matrix.target }} | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binaries-${{ matrix.target }} | |
| path: release/ | |
| release: | |
| name: Create GitHub Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: binaries-* | |
| merge-multiple: true | |
| - name: Generate checksums | |
| run: | | |
| shasum -a 256 * > SHA256SUMS.txt | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| hammerload-* | |
| SHA256SUMS.txt |