Skip to content

Commit 5577bfb

Browse files
Setup trusted publishing to crates.io (#62)
Part of #18 Also needs rust-lang/team#2490 to work Sets up a workflow where tagged commits will be automatically `cargo publish`d to crates.io
1 parent 8b19ae1 commit 5577bfb

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Publish to crates.io
2+
on:
3+
push:
4+
tags: ['v*'] # Triggers when pushing tags starting with 'v'
5+
jobs:
6+
publish:
7+
runs-on: ubuntu-latest
8+
environment: release # Optional: for enhanced security
9+
permissions:
10+
id-token: write # Required for OIDC token exchange
11+
steps:
12+
- uses: actions/checkout@v6
13+
- uses: rust-lang/crates-io-auth-action@v1
14+
id: auth
15+
- run: cargo publish
16+
env:
17+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

clgen.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,4 +62,3 @@ echo "git add Cargo.toml CHANGELOG.md COMMIT.txt src/"
6262
echo "git commit -m $new_tag"
6363
echo "git tag $new_tag"
6464
echo "git push && git push --tags"
65-
echo "cargo publish"

0 commit comments

Comments
 (0)