fix(ci): clippy 1.97 byte_char_slices lint + portable sha256 in release #2
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: | |
| strategy: | |
| matrix: | |
| include: | |
| - target: x86_64-unknown-linux-musl | |
| os: ubuntu-latest | |
| - target: aarch64-apple-darwin | |
| os: macos-14 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install musl tools | |
| if: matrix.target == 'x86_64-unknown-linux-musl' | |
| run: sudo apt-get update && sudo apt-get install -y musl-tools | |
| - name: Verify tag matches package version | |
| shell: bash | |
| run: | | |
| tag="${GITHUB_REF_NAME#v}" | |
| pkg="$(cargo pkgid -p vulngraph-cli | sed 's/.*[@#]//')" | |
| test "$tag" = "$pkg" || { echo "tag $tag != package $pkg"; exit 1; } | |
| - name: Build | |
| run: cargo build --release --locked --target ${{ matrix.target }} -p vulngraph-cli | |
| - name: Package | |
| shell: bash | |
| run: | | |
| name="vulngraph-${GITHUB_REF_NAME}-${{ matrix.target }}" | |
| mkdir "$name" | |
| cp target/${{ matrix.target }}/release/vulngraph "$name/" | |
| cp README.md LICENSE "$name/" | |
| tar -czf "$name.tar.gz" "$name" | |
| if command -v sha256sum >/dev/null 2>&1; then | |
| sha256sum "$name.tar.gz" > "$name.tar.gz.sha256" | |
| else | |
| shasum -a 256 "$name.tar.gz" > "$name.tar.gz.sha256" | |
| fi | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.target }} | |
| path: | | |
| vulngraph-*.tar.gz | |
| vulngraph-*.tar.gz.sha256 | |
| publish: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| merge-multiple: true | |
| path: dist | |
| - name: Publish release | |
| run: gh release create "$GITHUB_REF_NAME" dist/* --repo "$GITHUB_REPOSITORY" --verify-tag --generate-notes | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GITHUB_REF_NAME: ${{ github.ref_name }} |