We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 784fe6b commit 96f2381Copy full SHA for 96f2381
1 file changed
.github/workflows/publish.yml
@@ -0,0 +1,26 @@
1
+name: Publish to crates.io
2
+on:
3
+ push:
4
+ tags: [ 'v*' ]
5
+
6
+jobs:
7
+ publish:
8
+ runs-on: ubuntu-latest
9
+ environment: publish
10
+ permissions:
11
+ id-token: write
12
+ steps:
13
+ - uses: actions/checkout@v6
14
+ - uses: rust-lang/crates-io-auth-action@v1
15
+ id: auth
16
17
+ - name: Check crate version
18
+ run: |
19
+ CRATE_VERSION=v$(grep -m 1 "^version =" Cargo.toml | cut -d'"' -f2)
20
+ echo $CRATE_VERSION ${{ github.ref_name }}
21
+ [[ $CRATE_VERSION == ${{ github.ref_name }} ]]
22
23
+ - name: Publish
24
+ env:
25
+ CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
26
+ run: cargo publish
0 commit comments