Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
name: Release

# Conforms to the umbrella SDK release pipeline contract:
# u5c-factory reference/sdk-pipeline-requirements.md
# u5c-factory reference/sdk-pipeline.md
on:
push:
tags: ['v*']

jobs:
verify:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Verify tag matches crate version
run: |
TAG="${GITHUB_REF_NAME#v}"
MANIFEST=$(sed -nE 's/^version = "(.+)"/\1/p' Cargo.toml | head -1)
if [ "$TAG" != "$MANIFEST" ]; then
echo "::error::tag $GITHUB_REF_NAME does not match Cargo.toml version $MANIFEST"
exit 1
fi

build:
needs: verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -32,12 +46,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2

- name: Set crate version from tag
run: sed -i -E 's/^version = .*/version = "'"${GITHUB_REF_NAME#v}"'"/' Cargo.toml

- name: Publish to crates.io
env:
# --allow-dirty: the version edit above leaves Cargo.toml modified in-tree.
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: cargo publish -p utxorpc --allow-dirty
run: cargo publish -p utxorpc
Loading