Skip to content

Commit fb4c5e0

Browse files
committed
use built-in publishing; update readme
1 parent aaa8fc8 commit fb4c5e0

4 files changed

Lines changed: 43 additions & 41 deletions

File tree

.cargo-release-cheatsheet.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,39 @@ cargo test # Tests pass?
77
cargo fmt # Code formatted?
88
```
99

10-
## Dry Run (Always Do This First!)
10+
## Preview Release
1111
```bash
12-
cargo release --dry-run # Preview what will happen
12+
cargo release patch # Shows what will happen
1313
```
1414

1515
## Execute Release
1616
```bash
1717
# Patch release (0.1.17 → 0.1.18)
18-
cargo release patch
18+
cargo release patch --execute
1919

2020
# Minor release (0.1.17 → 0.2.0)
21-
cargo release minor
21+
cargo release minor --execute
2222

2323
# Major release (0.1.17 → 1.0.0)
24-
cargo release major
25-
26-
# Or just run (auto-detects)
27-
cargo release
24+
cargo release major --execute
2825
```
2926

27+
**Note:** Always specify patch/minor/major.
28+
3029
## What Happens Automatically
3130
1. ✅ Bumps version in `Cargo.toml`
3231
2. ✅ Runs tests: `cargo test`
3332
3. ✅ Checks formatting: `cargo fmt --check`
3433
4. ✅ Updates `CHANGELOG.md`
35-
5.Runs: `cargo publish -p sofos`
34+
5.Publishes to crates.io
3635
6. ✅ Creates commit: `Release vX.Y.Z`
3736
7. ✅ Creates tag: `vX.Y.Z`
3837
8. ✅ Pushes to remote
3938

4039
## Skip Publishing
4140
```bash
42-
cargo release --no-publish # Don't publish to crates.io
43-
cargo release --no-push # Don't push to Git
41+
cargo release patch --execute --no-publish # Don't publish to crates.io
42+
cargo release patch --execute --no-push # Don't push to Git
4443
```
4544

4645
## After Release
@@ -80,4 +79,4 @@ cargo release --sign-tag # GPG sign tags
8079

8180
---
8281

83-
**Quick tip:** Always run `cargo release --dry-run` first to preview!
82+
**Quick tip:** Always run `cargo release patch` first to preview!

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,16 @@ All notable changes to Sofos are documented in this file.
44

55
## [Unreleased]
66

7+
### Changed
8+
- Simplified cargo-release configuration to use built-in publishing
9+
710
## [0.1.18] - 2026-01-08
811

9-
## [0.1.17] - 2026-01-08
12+
### Added
13+
- cargo-release automation for versioning and publishing
14+
- Comprehensive release documentation
15+
16+
## [0.1.17] - 2026-01-05
1017

1118
### Changed
1219
- Renamed `mcpServers` to `mcp-servers` in config

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -341,25 +341,25 @@ This project uses **cargo-release** for automated versioning and publishing.
341341
**Quick commands:**
342342
343343
```bash
344-
# Preview the release (dry run)
345-
cargo release --dry-run
344+
# Preview the release
345+
cargo release patch
346346
347-
# Execute the release (full workflow)
348-
cargo release
347+
# Execute the release
348+
cargo release patch --execute
349349
350350
# Release specific version
351-
cargo release [major|minor|patch]
351+
cargo release [patch|minor|major] --execute
352352
```
353353
354354
The release workflow automatically:
355355
1. Bumps version in `Cargo.toml`
356356
2. Runs tests and formatting checks
357357
3. Updates `CHANGELOG.md`
358-
4. Creates release commit and Git tag (`v0.1.18`)
359-
5. Pushes to remote repository
360-
6. Publishes to crates.io
358+
4. Publishes to crates.io
359+
5. Creates release commit and Git tag
360+
6. Pushes to remote repository
361361
362-
**For detailed instructions** (including setup, troubleshooting, and advanced options), see [RELEASE.md](RELEASE.md).
362+
**For detailed instructions**, see [RELEASE.md](RELEASE.md).
363363
364364
## Troubleshooting
365365

RELEASE.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Cargo-release is already installed. The configuration is in `release.toml`.
1212
Preview what will happen without making changes:
1313

1414
```bash
15-
cargo release --dry-run
15+
cargo release patch
1616
```
1717

1818
This shows:
@@ -25,15 +25,15 @@ This shows:
2525
Execute the full release workflow:
2626

2727
```bash
28-
cargo release
28+
cargo release patch --execute
2929
```
3030

3131
This automatically:
3232
1. ✅ Bumps version in `Cargo.toml`
3333
2. ✅ Runs tests: `cargo test`
3434
3. ✅ Runs formatting check: `cargo fmt --check`
35-
4. ✅ Updates `CHANGELOG.md` (if configured)
36-
5.Runs: `cargo publish -p sofos` (custom publish command)
35+
4. ✅ Updates `CHANGELOG.md`
36+
5.Publishes to crates.io
3737
6. ✅ Creates release commit: `"Release v0.1.18"`
3838
7. ✅ Creates Git tag: `v0.1.18`
3939
8. ✅ Pushes commits and tags to remote
@@ -43,29 +43,29 @@ Bump to a specific version (major, minor, patch):
4343

4444
```bash
4545
# Patch release (0.1.17 → 0.1.18)
46-
cargo release patch
46+
cargo release patch --execute
4747

4848
# Minor release (0.1.17 → 0.2.0)
49-
cargo release minor
49+
cargo release minor --execute
5050

5151
# Major release (0.1.17 → 1.0.0)
52-
cargo release major
52+
cargo release major --execute
5353
```
5454

55+
**Note:** Always specify a version level (patch/minor/major). Running `cargo release` without a level will try to re-release the current version.
56+
5557
### 4. Release Without Publishing to crates.io
56-
To skip the custom publish command (useful for testing):
58+
If you want to skip publishing:
5759

5860
```bash
59-
cargo release --allow-dirty --no-verify
61+
cargo release patch --execute --no-publish
6062
```
6163

62-
Or if you want to run the release but skip the publish hook entirely, you can temporarily comment out the `pre-release-hook` line in `release.toml`.
63-
6464
### 5. Release Without Pushing to Git
6565
For testing/staging:
6666

6767
```bash
68-
cargo release --no-push
68+
cargo release patch --execute --no-push
6969
```
7070

7171
## What Gets Updated
@@ -95,8 +95,6 @@ Ensure:
9595

9696
## crates.io Publishing Setup
9797

98-
The project uses a custom publish command `cargo publish -p sofos` via a pre-release hook.
99-
10098
If this is your first time publishing to crates.io:
10199

102100
```bash
@@ -106,16 +104,14 @@ cargo login
106104
# This creates/updates ~/.cargo/credentials.toml
107105
```
108106

109-
The custom publish command is configured in `release.toml` as a `pre-release-hook`, which runs before creating the git commit and tag.
110-
111107
## Configuration
112108

113109
The release process is configured in `release.toml`:
114110

115-
- **pre-release-hook**: Runs custom publish command: `cargo publish -p sofos`
116111
- **changelog**: Automatically update CHANGELOG.md
117112
- **git.push**: Push commits and tags to remote
118113
- **git.tag-name**: Tag format (v{{version}})
114+
- **publish**: Publish to crates.io
119115

120116
## Example Release Workflow
121117

@@ -130,12 +126,12 @@ $ cargo release --dry-run
130126
Prepared release of sofos v0.1.18
131127

132128
# Step 3: Execute release
133-
$ cargo release
129+
$ cargo release patch --execute
134130
Releasing sofos v0.1.18
135131
- Bump version in Cargo.toml
136132
- Run pre-release checks
137133
- Update CHANGELOG.md
138-
- Run: cargo publish -p sofos
134+
- Publish to crates.io
139135
- Create release commit
140136
- Create git tag v0.1.18
141137
- Push to remote

0 commit comments

Comments
 (0)