From 550c557809415ffa840bd0a9653bac81cf92dc2c Mon Sep 17 00:00:00 2001 From: Santiago Date: Thu, 21 May 2026 08:40:37 -0300 Subject: [PATCH] ci: add tag-triggered release workflow Adds a release workflow conforming to the umbrella SDK release pipeline contract (u5c-factory reference/sdk-pipeline-requirements.md): a v* version tag triggers build -> test -> publish, the crate version is derived from the tag, and the crate is published to crates.io. Verification: workflow YAML syntactically validated only; not executed and the crate not built this session. Requires the CARGO_REGISTRY_TOKEN repository secret before the first release. --- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..df6b310 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Release + +# Conforms to the umbrella SDK release pipeline contract: +# u5c-factory reference/sdk-pipeline-requirements.md +on: + push: + tags: ['v*'] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + # Build only the SDK crate; utxorpc-tests is excluded (see ci.yml). + - run: cargo build -p utxorpc --all-targets + + test: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable + - uses: Swatinem/rust-cache@v2 + - run: cargo test -p utxorpc + + publish: + needs: test + runs-on: ubuntu-latest + steps: + - 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