chore(rustracer): bump crate from 1.0.2 to 1.0.3 (#314) #20
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: CD | |
"on": | |
push: | |
tags: | |
- "[0-9].[0-9].[0-9]+" | |
jobs: | |
build: | |
name: build | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
outputs: | |
hashes: ${{ steps.hash.outputs.hashes }} | |
steps: | |
- name: checkout project | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- name: check cargo cache | |
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 | |
id: rust-cache | |
with: | |
path: | | |
~/.cargo/ | |
~/.rustup/ | |
target/ | |
key: ${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('Cargo.toml') }}-${{ hashFiles('Cargo.lock') }} | |
- name: add musl target | |
run: | | |
rustup target add x86_64-unknown-linux-musl | |
- name: cargo release | |
run: | | |
cargo build --locked --release --target x86_64-unknown-linux-gnu --target x86_64-unknown-linux-musl | |
- name: assemble artifacts | |
run: .github/workflows/cd.sh assemble | |
- name: generate subject | |
id: hash | |
run: | | |
set -euo pipefail | |
echo "hashes=$(cat rustracer-*.txt | base64 -w0)" >> "$GITHUB_OUTPUT" | |
- name: upload artifacts | |
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 | |
with: | |
name: rustracer-build | |
path: | | |
rustracer-*.tar.gz | |
rustracer-*.txt | |
if-no-files-found: error | |
retention-days: 1 | |
release: | |
name: release | |
runs-on: ubuntu-latest | |
permissions: | |
actions: read | |
id-token: write | |
contents: write | |
needs: build | |
steps: | |
- name: checkout project | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
with: | |
fetch-depth: 0 | |
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a | |
with: | |
name: rustracer-build | |
- name: install cosign | |
uses: sigstore/cosign-installer@9614fae9e5c5eddabb09f90a270fcb487c9f7149 | |
- name: cosign artifacts | |
run: .github/workflows/cd.sh cosign | |
- name: generate changelog latest | |
uses: orhun/git-cliff-action@b7913b664658dd091d9971658cb02a19047baa79 | |
id: cliff | |
with: | |
config: cliff.toml | |
args: -vv --latest --strip header | |
- name: get tag | |
shell: bash | |
run: | | |
echo "TAG=${GITHUB_REF:10}" >> "$GITHUB_ENV" | |
- name: release artifacts | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | |
with: | |
name: rustracer ${{ env.TAG }} | |
body: ${{ steps.cliff.outputs.content }} | |
generate_release_notes: true | |
fail_on_unmatched_files: true | |
files: | | |
rustracer-*.tar.gz | |
rustracer-*.txt | |
rustracer-*.pem | |
rustracer-*.sig | |
provenance: | |
needs: | |
- build | |
- release | |
permissions: | |
actions: read | |
id-token: write | |
contents: write | |
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@07e64b653f10a80b6510f4568f685f8b7b9ea830 | |
with: | |
base64-subjects: "${{ needs.build.outputs.hashes }}" | |
upload-assets: true | |
cratesio: | |
name: cratesio | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
needs: | |
- release | |
environment: | |
name: cratesio | |
url: https://crates.io/crates/rustracer | |
steps: | |
- name: checkout project | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- name: check cache | |
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 | |
id: cache | |
with: | |
path: | | |
~/.cargo/ | |
~/.rustup/ | |
target/ | |
key: ${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('Cargo.toml') }}-${{ hashFiles('Cargo.lock') }} | |
- name: cargo publish | |
run: | | |
cargo publish --locked | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
ghpages: | |
name: ghpages | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
needs: | |
- cratesio | |
steps: | |
- name: checkout project | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- name: check cache | |
uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 | |
id: cache | |
with: | |
path: | | |
~/.cargo/ | |
~/.rustup/ | |
target/ | |
key: ${{ runner.os }}-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('Cargo.toml') }}-${{ hashFiles('Cargo.lock') }} | |
- name: patch and cargo rustdoc | |
run: make rust_docs | |
- name: publish to gh-pages | |
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: target/doc/ | |
changelog: | |
name: changelog | |
needs: | |
- ghpages | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: checkout project | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
with: | |
fetch-depth: 0 | |
- name: get tag | |
shell: bash | |
run: | | |
echo "TAG=${GITHUB_REF:10}" >> "$GITHUB_ENV" | |
- name: Refresh changelog | |
uses: orhun/git-cliff-action@b7913b664658dd091d9971658cb02a19047baa79 | |
with: | |
config: cliff.toml | |
args: --verbose --tag ${{ env.TAG }} | |
env: | |
OUTPUT: CHANGELOG.md | |
- name: commit changelog | |
uses: EndBug/add-and-commit@1bad3abcf0d6ec49a5857d124b0bfb52dc7bb081 | |
with: | |
message: "chore(CHANGELOG): add rustracer ${{ env.TAG }} changes" | |
add: 'CHANGELOG.md' | |
new_branch: master |