Skip to content

Commit

Permalink
build: add workflow for auto-publish (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
neoeinstein authored Apr 12, 2024
1 parent b24b73a commit 73be510
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/release.yml
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

0 comments on commit 73be510

Please sign in to comment.