Skip to content

Commit 208205e

Browse files
committed
feat: consolidate release automation with release-plz
- Add release-plz workflow for automated version management and crates.io publishing - Configure release-plz to create redisctl-v* tags for cargo-dist integration - Remove redundant publish-crates.yml workflow - Disable git release creation in release-plz (cargo-dist handles this) - Add RELEASES.md documenting the consolidated release flow - Libraries (redis-cloud, redis-enterprise) publish without creating tags - Main binary (redisctl) creates tag which triggers binary builds and Docker images
1 parent c4ad7c0 commit 208205e

File tree

4 files changed

+165
-54
lines changed

4 files changed

+165
-54
lines changed

.github/workflows/publish-crates.yml

Lines changed: 0 additions & 54 deletions
This file was deleted.

.github/workflows/release-plz.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release-plz
2+
3+
permissions:
4+
pull-requests: write
5+
contents: write
6+
7+
on:
8+
push:
9+
branches:
10+
- main
11+
12+
jobs:
13+
release-plz:
14+
name: Release-plz
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
token: ${{ secrets.GITHUB_TOKEN }}
22+
23+
- name: Install Rust toolchain
24+
uses: dtolnay/rust-toolchain@stable
25+
26+
- name: Run release-plz
27+
uses: MarcoIeni/release-plz-action@v0.5
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

RELEASES.md

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Release Process
2+
3+
This document describes the automated release process for redisctl.
4+
5+
## Overview
6+
7+
The release process is fully automated using a combination of:
8+
- **release-plz**: Manages versions, changelogs, crates.io publishing, and git tags
9+
- **cargo-dist**: Builds platform binaries and creates GitHub releases
10+
- **Docker workflow**: Publishes Docker images
11+
12+
## Release Flow
13+
14+
```
15+
1. Push commits to main
16+
17+
2. release-plz workflow runs
18+
- Analyzes conventional commits
19+
- Creates PR with version bumps and changelog updates
20+
21+
3. Review and merge PR
22+
23+
4. release-plz publishes
24+
- Publishes redis-cloud to crates.io
25+
- Publishes redis-enterprise to crates.io
26+
- Publishes redisctl to crates.io
27+
- Creates git tag: redisctl-vX.Y.Z
28+
29+
5. Tag triggers parallel workflows
30+
├─ cargo-dist (release.yml)
31+
│ - Builds binaries for all platforms
32+
│ - Creates GitHub release with binaries
33+
│ - Updates Homebrew formula
34+
35+
└─ Docker (docker.yml)
36+
- Builds multi-arch Docker images
37+
- Pushes to Docker Hub and GHCR
38+
```
39+
40+
## Conventional Commits
41+
42+
Use conventional commit format for automatic versioning:
43+
44+
- `feat: description` → Minor version bump (0.X.0)
45+
- `fix: description` → Patch version bump (0.0.X)
46+
- `feat!: description` or `BREAKING CHANGE:` → Major version bump (X.0.0)
47+
- `docs:`, `chore:`, `style:`, `refactor:`, `test:` → No version bump
48+
49+
## Manual Intervention
50+
51+
Normally, no manual intervention is needed. However, you can:
52+
53+
### Skip Publishing for a Commit
54+
Add `[skip ci]` to commit message to skip all CI workflows.
55+
56+
### Manual Tag Creation (Emergency)
57+
If you need to manually trigger a release:
58+
59+
```bash
60+
git tag redisctl-v0.6.3
61+
git push origin redisctl-v0.6.3
62+
```
63+
64+
This will trigger cargo-dist and Docker workflows but NOT crates.io publishing.
65+
66+
## Workspace Version Management
67+
68+
All three crates (redis-cloud, redis-enterprise, redisctl) share the same version number in the workspace. When release-plz creates a version bump:
69+
70+
1. It updates the version in all three crate Cargo.toml files
71+
2. It publishes all three crates to crates.io in dependency order
72+
3. It creates a single tag for the redisctl version
73+
74+
## Troubleshooting
75+
76+
### Release PR not created
77+
- Check that commits follow conventional commit format
78+
- Verify GITHUB_TOKEN has write permissions
79+
- Check release-plz workflow logs
80+
81+
### Crates.io publish failed
82+
- Verify CARGO_REGISTRY_TOKEN is valid
83+
- Check that version doesn't already exist
84+
- Ensure all tests pass
85+
86+
### Binary builds failed
87+
- Check cargo-dist workflow logs
88+
- Verify all platforms build successfully
89+
- Check for platform-specific dependencies
90+
91+
### Docker build failed
92+
- Verify DOCKERHUB_USERNAME and DOCKERHUB_TOKEN secrets
93+
- Check Dockerfile for syntax errors
94+
- Ensure multi-arch build succeeds
95+
96+
## Configuration Files
97+
98+
- `release-plz.toml` - release-plz configuration
99+
- `.github/workflows/release-plz.yml` - Version PR and crates.io publishing
100+
- `.github/workflows/release.yml` - cargo-dist binary builds (autogenerated)
101+
- `.github/workflows/docker.yml` - Docker image publishing

release-plz.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[workspace]
2+
# Enable changelog updates
3+
changelog_update = true
4+
# Create git releases (disable - let cargo-dist handle this)
5+
git_release_enable = false
6+
# Create git tags for releases
7+
git_tag_enable = true
8+
# Use semantic versioning
9+
semver_check = true
10+
# Allow dirty working directory (cargo-dist modifies CI files)
11+
allow_dirty = true
12+
# Conventional commit parsing
13+
pr_labels = ["release"]
14+
15+
# Publish to crates.io in dependency order
16+
[[package]]
17+
name = "redis-cloud"
18+
publish = true
19+
# Don't create tags for libraries
20+
git_tag_enable = false
21+
22+
[[package]]
23+
name = "redis-enterprise"
24+
publish = true
25+
# Don't create tags for libraries
26+
git_tag_enable = false
27+
28+
[[package]]
29+
name = "redisctl"
30+
publish = true
31+
# Tag with redisctl version for cargo-dist integration
32+
git_tag_name = "redisctl-v{{ version }}"
33+
# Let cargo-dist create the GitHub release
34+
git_release_enable = false

0 commit comments

Comments
 (0)