ci: update Ubuntu version in release workflow to 22.04 #4
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 | |
| BINARY: hum | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-gnu | |
| os: ubuntu-22.04 | |
| archive: tar.gz | |
| - target: aarch64-unknown-linux-gnu | |
| os: ubuntu-22.04 | |
| archive: tar.gz | |
| cross: true | |
| - target: x86_64-apple-darwin | |
| os: macos-latest | |
| archive: tar.gz | |
| - target: aarch64-apple-darwin | |
| os: macos-latest | |
| archive: tar.gz | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross (Linux cross-compilation) | |
| if: matrix.cross | |
| run: cargo install cross --git https://github.com/cross-rs/cross | |
| - name: Build | |
| run: | | |
| if [ "${{ matrix.cross }}" = "true" ]; then | |
| cross build --release --target ${{ matrix.target }} | |
| else | |
| cargo build --release --target ${{ matrix.target }} | |
| fi | |
| shell: bash | |
| - name: Package (unix) | |
| if: matrix.archive == 'tar.gz' | |
| run: | | |
| STAGING="${{ env.BINARY }}-${{ github.ref_name }}-${{ matrix.target }}" | |
| mkdir "$STAGING" | |
| cp "target/${{ matrix.target }}/release/${{ env.BINARY }}" "$STAGING/" | |
| cp README.md LICENSE* "$STAGING/" 2>/dev/null || true | |
| tar -czf "$STAGING.tar.gz" "$STAGING" | |
| echo "ASSET=$STAGING.tar.gz" >> "$GITHUB_ENV" | |
| shell: bash | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.target }} | |
| path: ${{ env.ASSET }} | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Generate checksums | |
| run: | | |
| cd artifacts | |
| find . -type f -name '*.tar.gz' -exec mv {} . \; | |
| sha256sum *.tar.gz > "${{ env.BINARY }}-${{ github.ref_name }}-checksums.txt" | |
| cat "${{ env.BINARY }}-${{ github.ref_name }}-checksums.txt" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| artifacts/*.tar.gz | |
| artifacts/${{ env.BINARY }}-${{ github.ref_name }}-checksums.txt |