Skip to content

Commit 2abbd3f

Browse files
Merge pull request #365 from joshrotenberg/fix/release-workflows
fix: support both tag formats in release workflows
2 parents 8d4f683 + 99e0034 commit 2abbd3f

File tree

3 files changed

+131
-1
lines changed

3 files changed

+131
-1
lines changed

.github/workflows/docker.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
tags:
66
- "v*"
7+
- "redisctl-v*"
78
workflow_dispatch:
89

910
env:
@@ -32,14 +33,21 @@ jobs:
3233
if [[ "${{ github.ref }}" == refs/tags/v* ]]; then
3334
# Running from a tag
3435
VERSION=${GITHUB_REF#refs/tags/v}
36+
elif [[ "${{ github.ref }}" == refs/tags/redisctl-v* ]]; then
37+
# Running from a redisctl-v tag
38+
VERSION=${GITHUB_REF#refs/tags/redisctl-v}
3539
else
3640
# Running from a branch - extract version from Cargo.toml
3741
VERSION=$(grep '^version = ' crates/redisctl/Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
3842
echo "Extracted version from Cargo.toml: $VERSION"
3943
fi
4044
else
4145
# Tag push event
42-
VERSION=${GITHUB_REF#refs/tags/v}
46+
if [[ "${{ github.ref }}" == refs/tags/redisctl-v* ]]; then
47+
VERSION=${GITHUB_REF#refs/tags/redisctl-v}
48+
else
49+
VERSION=${GITHUB_REF#refs/tags/v}
50+
fi
4351
fi
4452
4553
# Validate version format

.github/workflows/publish-crates.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
tags:
66
- "v*"
7+
- "redisctl-v*"
78
workflow_dispatch:
89

910
env:

RELEASE.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Release Process for redisctl
2+
3+
This document outlines the complete release process to ensure all components are published correctly.
4+
5+
## Overview
6+
7+
A complete release includes:
8+
1. **GitHub Release** with binaries (handled by cargo-dist)
9+
2. **Docker Hub** image publication
10+
3. **crates.io** package publication
11+
12+
## Release Steps
13+
14+
### 1. Prepare the Release
15+
16+
```bash
17+
# Ensure you're on main and up to date
18+
git checkout main
19+
git pull origin main
20+
21+
# Update version in Cargo.toml files
22+
# Edit these files to update version (e.g., 0.6.1 -> 0.6.2):
23+
# - Cargo.toml (workspace.package.version)
24+
# - crates/redis-cloud/Cargo.toml
25+
# - crates/redis-enterprise/Cargo.toml
26+
# - crates/redisctl/Cargo.toml
27+
# Also update the dependency versions in crates/redisctl/Cargo.toml
28+
29+
# Update CHANGELOG.md with release notes
30+
31+
# Commit the changes
32+
git add -A
33+
git commit -m "chore: release vX.Y.Z"
34+
35+
# Create a PR and merge it
36+
```
37+
38+
### 2. Create and Push the Release Tag
39+
40+
**IMPORTANT**: Use the `v` prefix format (not `redisctl-v`) for consistency:
41+
42+
```bash
43+
# After PR is merged, pull latest main
44+
git checkout main
45+
git pull origin main
46+
47+
# Create the release tag
48+
git tag -a vX.Y.Z -m "Release vX.Y.Z"
49+
50+
# Push the tag - this triggers all workflows
51+
git push origin vX.Y.Z
52+
```
53+
54+
### 3. Verify All Workflows Triggered
55+
56+
The tag push should automatically trigger:
57+
58+
1. **Release workflow** (cargo-dist): https://github.com/joshrotenberg/redisctl/actions/workflows/release.yml
59+
- Creates GitHub release with binaries
60+
- Takes ~10-15 minutes
61+
62+
2. **Docker Build**: https://github.com/joshrotenberg/redisctl/actions/workflows/docker.yml
63+
- Publishes to Docker Hub
64+
- Takes ~5-10 minutes
65+
66+
3. **Publish to crates.io**: https://github.com/joshrotenberg/redisctl/actions/workflows/publish-crates.yml
67+
- Publishes all three crates
68+
- Takes ~2-5 minutes
69+
70+
### 4. Verify Release Components
71+
72+
After workflows complete, verify:
73+
74+
- [ ] GitHub Release: https://github.com/joshrotenberg/redisctl/releases
75+
- Should have binaries for all platforms
76+
- [ ] Docker Hub: https://hub.docker.com/r/joshrotenberg/redisctl/tags
77+
- Should have new version tag
78+
- [ ] crates.io: https://crates.io/crates/redisctl
79+
- Should show new version
80+
81+
## Troubleshooting
82+
83+
### If Docker or crates.io workflows don't trigger:
84+
85+
The workflows now support both `v*` and `redisctl-v*` tag formats. If they still don't trigger:
86+
87+
1. **Manual trigger via GitHub UI**:
88+
- Go to Actions tab
89+
- Select the workflow (Docker Build or Publish to crates.io)
90+
- Click "Run workflow"
91+
- Select the tag or branch
92+
93+
2. **Manual trigger via CLI**:
94+
```bash
95+
gh workflow run "Docker Build" --ref vX.Y.Z
96+
gh workflow run "Publish to crates.io" --ref vX.Y.Z
97+
```
98+
99+
### If crates.io publish fails:
100+
101+
Publish manually in order:
102+
```bash
103+
cd crates/redis-cloud && cargo publish
104+
cd ../redis-enterprise && cargo publish
105+
cd ../redisctl && cargo publish
106+
```
107+
108+
## Tag Format Standards
109+
110+
Going forward, use the simpler `v` prefix format:
111+
-`v0.6.2`
112+
-`redisctl-v0.6.2` (avoid this)
113+
114+
The workflows have been updated to support both formats for backward compatibility, but `v*` is preferred.
115+
116+
## Automation Opportunities
117+
118+
Consider adding:
119+
1. **release-plz** for automated version bumping and changelog generation
120+
2. **Unified release workflow** that ensures all three components are published
121+
3. **Release checklist GitHub Action** that validates all components were published

0 commit comments

Comments
 (0)