File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish to crates.io
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ env :
8+ CARGO_TERM_COLOR : always
9+
10+ jobs :
11+ publish :
12+ name : Publish
13+ runs-on : ubuntu-latest
14+ environment : crates-io
15+ permissions :
16+ id-token : write
17+ contents : read
18+ steps :
19+ - uses : actions/checkout@v4
20+ with :
21+ submodules : recursive
22+
23+ - uses : dtolnay/rust-toolchain@stable
24+
25+ - name : Install protoc
26+ uses : arduino/setup-protoc@v3
27+ with :
28+ version : " 27.x"
29+ repo-token : ${{ secrets.GITHUB_TOKEN }}
30+
31+ - name : Verify version matches tag
32+ run : |
33+ CARGO_VERSION="$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[0].version')"
34+ TAG_VERSION="${GITHUB_REF_NAME#v}"
35+ if [ "$CARGO_VERSION" != "$TAG_VERSION" ]; then
36+ echo "::error::Cargo.toml version ($CARGO_VERSION) does not match release tag ($TAG_VERSION)"
37+ exit 1
38+ fi
39+
40+ - name : Publish to crates.io
41+ run : cargo publish
You can’t perform that action at this time.
0 commit comments