File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -100,4 +100,30 @@ jobs:
100100 with :
101101 files : artifacts/*.tar.gz, artifacts/*.zip
102102 env :
103- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
103+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
104+
105+ publish-crates :
106+ needs : publish-release
107+ runs-on : ubuntu-latest
108+ # only run publish when triggered by a semantic version tag
109+ if : startsWith(github.ref, 'refs/tags/v')
110+ steps :
111+ - uses : actions/checkout@v4
112+
113+ - name : Install Rust
114+ uses : actions-rs/toolchain@v1
115+ with :
116+ toolchain : stable
117+ override : true
118+
119+ - name : Publish to crates.io
120+ env :
121+ CARGO_REGISTRY_TOKEN : ${{ secrets.CARGO_REGISTRY_TOKEN }}
122+ run : |
123+ set -e
124+ # ensure the token is present
125+ if [ -z "$CARGO_REGISTRY_TOKEN" ]; then
126+ echo "CARGO_REGISTRY_TOKEN is not set. Add it to repository secrets to enable automated publish." >&2
127+ exit 1
128+ fi
129+ cargo publish --token "$CARGO_REGISTRY_TOKEN"
You can’t perform that action at this time.
0 commit comments