Files
mcp-to-cli/.gitea/workflows/release.yml
T
vhaudiquet a7e1de76ac
ci / checks (push) Failing after 14s
Import mcp-to-cli from the rhema workspace
The crate maps MCP tool catalogs to clap commands and back, and has no
rhema dependencies — it was in-tree only because the workspace glob
reached it. Its own repository gives it its own release cadence and
its own crates.io token, scoped to this crate alone.
2026-11-12 12:20:25 +01:00

39 lines
1.2 KiB
YAML

name: release
on:
push:
tags: ["v*"]
jobs:
publish:
# Prerelease tags (v0.1.0-rc1) do not reach crates.io.
if: ${{ !contains(gitea.ref_name, '-') }}
runs-on: ubuntu-latest
steps:
- uses: https://gitea.com/actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
- name: Check the tag matches the crate version
run: |
crate_version="$(awk -F'"' '/^version =/{print $2; exit}' Cargo.toml)"
tag_version="${GITHUB_REF_NAME#v}"
if [ "$crate_version" != "$tag_version" ]; then
echo "tag $GITHUB_REF_NAME does not match crate version $crate_version" >&2
exit 1
fi
- name: Publish
# Idempotent: a re-run for a version that already landed skips
# instead of failing.
run: |
version="${GITHUB_REF_NAME#v}"
if curl -fsSL -A "mcp-to-cli (git.vhaudiquet.fr/vhaudiquet/mcp-to-cli)" \
"https://crates.io/api/v1/crates/mcp-to-cli/$version" >/dev/null 2>&1; then
echo "mcp-to-cli v$version is already on crates.io, skipping"
exit 0
fi
cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}