JiRust-CLI - Bumped version to 0.11.2 #22
Workflow file for this run
This file contains 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 and release jirust-cli | |
on: | |
push: | |
tags: | |
- "jirust-cli_*.*.*" | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
environment: build_release | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
attestations: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get -y install gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 | |
rustup target add x86_64-pc-windows-gnu | |
rustup target add x86_64-unknown-linux-gnu | |
mkdir dist | |
mkdir builds | |
- name: Run sccache-cache | |
uses: mozilla-actions/[email protected] | |
- name: Run tests | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
run: cargo test -p jirust-cli | |
- name: Cargo deny check | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
run: | | |
cargo install cargo-deny | |
cargo deny check | |
- name: Build Win64 | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
run: | | |
cargo rustc -p jirust-cli --bin jirust-cli --release --target=x86_64-pc-windows-gnu -- -C linker=x86_64-w64-mingw32-gcc | |
mkdir builds/jirust-cli-win64 | |
cp target/x86_64-pc-windows-gnu/release/jirust-cli.exe builds/jirust-cli-win64 | |
tar -C builds -czvf dist/jirust-cli-win64.tar.gz jirust-cli-win64 | |
- name: Build Linux | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
run: | | |
cargo rustc -p jirust-cli --bin jirust-cli --release --target=x86_64-unknown-linux-gnu | |
mkdir builds/jirust-cli-linux | |
cp target/x86_64-unknown-linux-gnu/release/jirust-cli builds/jirust-cli-linux | |
tar -C builds -czvf dist/jirust-cli-linux.tar.gz jirust-cli-linux | |
- name: Extract release notes | |
id: extract-release-notes | |
uses: ffurrer2/extract-release-notes@v2 | |
- name: Set output | |
id: vars | |
run: | | |
TAG=$(echo ${{ github.ref_name }} | cut -d '_' -f 2) | |
echo "final_tag=$TAG" >> $GITHUB_OUTPUT | |
- name: Upload release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: ${{ steps.vars.outputs.final_tag }} | |
body: "${{ steps.extract-release-notes.outputs.release_notes }}" | |
files: | | |
dist/jirust-cli-win64.tar.gz | |
dist/jirust-cli-linux.tar.gz | |
env: | |
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} | |
- name: Publish cargo package | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
CARGO_ACCESS_TOKEN: ${{ secrets.CARGO_ACCESS_TOKEN }} | |
run: | | |
cargo login "$CARGO_ACCESS_TOKEN" | |
cargo publish -p jirust-cli | |
- name: Generate SBOM | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
run: | | |
cargo install cargo-sbom | |
cargo sbom > builds/sbom.spdx.json | |
- name: Attest provenance | |
uses: actions/attest-build-provenance@v1 | |
with: | |
subject-path: 'builds/jirust-cli-*' | |
- name: Attest SBOM | |
uses: actions/attest-sbom@v1 | |
with: | |
subject-path: 'builds/jirust-cli-*' | |
sbom-path: 'builds/sbom.spdx.json' |