-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add workflow for auto-publish (#32)
- Loading branch information
1 parent
b24b73a
commit 73be510
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v[0-9]*.[0-9]*.[0-9]*" | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
release: | ||
name: Publish Release ${{ github.ref_name }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4 | ||
- name: Install Stable Rust Toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
- id: parse-tag | ||
name: Verify tag matches cargo manifest | ||
run: | | ||
VERSION=$(cargo read-manifest --manifest-path aliri_braid/Cargo.toml | jq -r .version) | ||
if [ "${{ github.ref_name }}" != "v${VERSION}" ]; then | ||
echo "::error::Tag name ${{ github.ref_name }} doesn't match the version in Cargo.toml (${VERSION})"; | ||
exit 1; | ||
fi | ||
shell: bash | ||
- name: Publish Rust crate | ||
env: | ||
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | ||
CARGO_PUBLISH_TIMEOUT: '0' | ||
run: | | ||
cargo publish -p aliri_braid_impl | ||
cargo publish -p aliri_braid | ||
cargo publish -p aliri_braid_examples | ||
shell: bash |