Skip to content

Commit 1fcb419

Browse files
doitianclaude
andcommitted
feat(ci): add deploy workflow for crates.io publishing
Add GitHub Actions workflow that triggers on v* tag pushes to automatically publish the crate to crates.io using Trusted Publishers. - Uses OIDC authentication (no API token required) - Runs tests as a safety check before publishing - Requires crates.io environment configuration Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a9f322a commit 1fcb419

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

.github/workflows/deploy.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
7+
jobs:
8+
publish:
9+
name: Publish to crates.io
10+
runs-on: ubuntu-latest
11+
environment: crates.io
12+
13+
permissions:
14+
id-token: write
15+
contents: read
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
- run: rustup update 1.76.0 && rustup default 1.76.0
20+
- name: Run tests
21+
run: cargo test --verbose
22+
env:
23+
RUSTFLAGS: "-Dwarnings"
24+
- name: Publish
25+
run: cargo publish

AGENTS.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ fiber-sphinx/
125125
│ └── CONTRIBUTING.md # Contribution guidelines
126126
└── .github/workflows/
127127
├── ci.yml # CI workflow (build, test, clippy)
128-
└── cov.yml # Coverage workflow
128+
├── cov.yml # Coverage workflow
129+
└── deploy.yml # Deploy to crates.io on tag push
129130
```
130131

131132
## CI Requirements
@@ -135,6 +136,21 @@ The CI runs on Rust 1.76.0, stable, beta, and nightly. All must pass:
135136
- `cargo test` - All tests pass
136137
- `cargo clippy` - No warnings (with `-Dwarnings`)
137138

139+
## Releasing
140+
141+
To publish a new version to crates.io:
142+
143+
1. Update the version in `Cargo.toml`
144+
2. Commit the version bump
145+
3. Create and push a tag: `git tag v<version> && git push origin v<version>`
146+
4. The deploy workflow will automatically publish to crates.io
147+
148+
**Setup:** Uses crates.io Trusted Publishers (no API token required). Configure the trusted
149+
publisher at https://crates.io/crates/fiber-sphinx/settings with:
150+
- Repository: `cryptape/fiber-sphinx`
151+
- Workflow: `deploy.yml`
152+
- Environment: `crates.io`
153+
138154
## Contributing Workflow
139155

140156
1. Create branch from `develop`

0 commit comments

Comments
 (0)