Shared GitHub Actions and Workflows for Blueshift repositories.
Tag-triggered crate publishing to crates.io using trusted publishing (OIDC). Works with workspace with multiple crates.
- Verifies the given tag matches the version in
Cargo.toml. - Publishes the crate via the
publish-crates. - Creates a draft release with generated notes.
name: Release
run-name: "Release ${{ github.ref_name }}"
on:
push:
tags: ["v*"]
jobs:
crates:
uses: blueshift-gg/github-actions/.github/workflows/release-crates.yml@master
permissions:
contents: write
id-token: write
with:
tag: ${{ github.ref_name }} # required
environment: release # optional; recommended to have an additional approval step
timeout-minutes: 15 # optional; default 15
secrets: inheritWarning
The workflow publishes every workspace member by default. Any crate not meant to be published should disable publishing.
[package]
name = "xtask"
# ...
publish = false| input | required | default | description |
|---|---|---|---|
tag |
yes | Tag or version to release (e.g. v0.4.2 or 0.4.2). |
|
environment |
no | Environment for the workflow. | |
timeout-minutes |
no | 15 |
Run time limit for the workflow. |
- Workflow fails if the provided tag and the version in Cargo.toml mismatch.
- Disrupted release (e.g. network issues). Rerun the workflow to continue publishing the unpublished crates.
Publishes a Rust crate to crates.io using trusted publishing (OIDC).
- Installs Rust toolchain and
cargo-release - Authenticates with crates.io via trusted publishing
- Publishes unpublished workspace crates
jobs:
crates:
runs-on: ubuntu-latest
permissions:
id-token: write # required: crates.io trusted publishing
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Publish crates
uses: blueshift-gg/github-actions/publish-crates@master