fix: Add --tag and --push flags to bump-version.sh
This addresses confusion where version bump doesn't trigger release. The script now supports: - --commit: Create git commit - --tag: Create annotated git tag (requires --commit) - --push: Push commit and tag (requires --tag) Updated RELEASING.md to use: ./scripts/bump-version.sh X.Y.Z --commit --tag --push Fixes the gap between version bump and actual release trigger.
This commit is contained in:
60
RELEASING.md
60
RELEASING.md
@@ -75,31 +75,48 @@ Before starting a release:
|
|||||||
|
|
||||||
## 1. Prepare Release
|
## 1. Prepare Release
|
||||||
|
|
||||||
### Update Version
|
### Update Version and Create Release Tag
|
||||||
|
|
||||||
Use the version bump script to update all version references:
|
Use the version bump script to update all version references and create the release tag:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Dry run - shows what will change
|
# Dry run - shows what will change
|
||||||
./scripts/bump-version.sh 0.22.0
|
./scripts/bump-version.sh 0.22.0
|
||||||
|
|
||||||
# Review the diff
|
# Review the diff, then commit, tag, and push in one command
|
||||||
git diff
|
./scripts/bump-version.sh 0.22.0 --commit --tag --push
|
||||||
|
|
||||||
# Commit if it looks good
|
|
||||||
./scripts/bump-version.sh 0.22.0 --commit
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This updates:
|
This updates:
|
||||||
- `cmd/bd/main.go` - CLI version constant
|
- `cmd/bd/version.go` - CLI version constant
|
||||||
- `integrations/mcp/server/pyproject.toml` - MCP server version
|
- `integrations/beads-mcp/pyproject.toml` - MCP server version
|
||||||
- `npm-package/package.json` - npm package version
|
- `.claude-plugin/plugin.json` - Plugin version
|
||||||
- `Formula/bd.rb` - Homebrew formula version
|
- `.claude-plugin/marketplace.json` - Marketplace version
|
||||||
- `.goreleaser.yml` - Release configuration
|
- `README.md` - Documentation version
|
||||||
|
- `PLUGIN.md` - Version requirements
|
||||||
|
|
||||||
### Update CHANGELOG.md
|
The `--commit --tag --push` flags will:
|
||||||
|
1. Create a git commit with all version changes
|
||||||
|
2. Create an annotated tag `v0.22.0`
|
||||||
|
3. Push both commit and tag to origin
|
||||||
|
|
||||||
Add release notes:
|
This triggers GitHub Actions to build release artifacts automatically.
|
||||||
|
|
||||||
|
**Alternative (step-by-step):**
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Just commit
|
||||||
|
./scripts/bump-version.sh 0.22.0 --commit
|
||||||
|
|
||||||
|
# Then manually tag and push
|
||||||
|
git tag -a v0.22.0 -m "Release v0.22.0"
|
||||||
|
git push origin main
|
||||||
|
git push origin v0.22.0
|
||||||
|
```
|
||||||
|
|
||||||
|
### Update CHANGELOG.md (Optional but Recommended)
|
||||||
|
|
||||||
|
Add release notes before or after running the version bump:
|
||||||
|
|
||||||
```markdown
|
```markdown
|
||||||
## [0.22.0] - 2025-11-04
|
## [0.22.0] - 2025-11-04
|
||||||
@@ -118,21 +135,6 @@ Add release notes:
|
|||||||
- Changed behavior of B (migration guide)
|
- Changed behavior of B (migration guide)
|
||||||
```
|
```
|
||||||
|
|
||||||
### Commit and Tag
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Commit version bump and changelog
|
|
||||||
git add -A
|
|
||||||
git commit -m "chore: Bump version to 0.22.0"
|
|
||||||
|
|
||||||
# Create annotated tag
|
|
||||||
git tag -a v0.22.0 -m "Release v0.22.0"
|
|
||||||
|
|
||||||
# Push to GitHub
|
|
||||||
git push origin main
|
|
||||||
git push origin v0.22.0
|
|
||||||
```
|
|
||||||
|
|
||||||
## 2. GitHub Release
|
## 2. GitHub Release
|
||||||
|
|
||||||
### Using GoReleaser (Recommended)
|
### Using GoReleaser (Recommended)
|
||||||
|
|||||||
@@ -9,17 +9,21 @@ NC='\033[0m' # No Color
|
|||||||
|
|
||||||
# Usage message
|
# Usage message
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: $0 <version> [--commit]"
|
echo "Usage: $0 <version> [--commit] [--tag] [--push]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Bump version across all beads components."
|
echo "Bump version across all beads components."
|
||||||
echo ""
|
echo ""
|
||||||
echo "Arguments:"
|
echo "Arguments:"
|
||||||
echo " <version> Semantic version (e.g., 0.9.3, 1.0.0)"
|
echo " <version> Semantic version (e.g., 0.9.3, 1.0.0)"
|
||||||
echo " --commit Automatically create a git commit (optional)"
|
echo " --commit Automatically create a git commit (optional)"
|
||||||
|
echo " --tag Create annotated git tag after commit (requires --commit)"
|
||||||
|
echo " --push Push commit and tag to origin (requires --commit and --tag)"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Examples:"
|
echo "Examples:"
|
||||||
echo " $0 0.9.3 # Update versions and show diff"
|
echo " $0 0.9.3 # Update versions and show diff"
|
||||||
echo " $0 0.9.3 --commit # Update versions and commit"
|
echo " $0 0.9.3 --commit # Update versions and commit"
|
||||||
|
echo " $0 0.9.3 --commit --tag # Update, commit, and tag"
|
||||||
|
echo " $0 0.9.3 --commit --tag --push # Full release preparation"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,9 +66,38 @@ main() {
|
|||||||
|
|
||||||
NEW_VERSION=$1
|
NEW_VERSION=$1
|
||||||
AUTO_COMMIT=false
|
AUTO_COMMIT=false
|
||||||
|
AUTO_TAG=false
|
||||||
|
AUTO_PUSH=false
|
||||||
|
|
||||||
if [ "$2" == "--commit" ]; then
|
# Parse flags
|
||||||
AUTO_COMMIT=true
|
shift # Remove version argument
|
||||||
|
while [ $# -gt 0 ]; do
|
||||||
|
case "$1" in
|
||||||
|
--commit)
|
||||||
|
AUTO_COMMIT=true
|
||||||
|
;;
|
||||||
|
--tag)
|
||||||
|
AUTO_TAG=true
|
||||||
|
;;
|
||||||
|
--push)
|
||||||
|
AUTO_PUSH=true
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo -e "${RED}Error: Unknown option '$1'${NC}"
|
||||||
|
usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
shift
|
||||||
|
done
|
||||||
|
|
||||||
|
# Validate flag dependencies
|
||||||
|
if [ "$AUTO_TAG" = true ] && [ "$AUTO_COMMIT" = false ]; then
|
||||||
|
echo -e "${RED}Error: --tag requires --commit${NC}"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
if [ "$AUTO_PUSH" = true ] && [ "$AUTO_TAG" = false ]; then
|
||||||
|
echo -e "${RED}Error: --push requires --tag${NC}"
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Validate version format
|
# Validate version format
|
||||||
@@ -200,16 +233,45 @@ Generated by scripts/bump-version.sh"
|
|||||||
|
|
||||||
echo -e "${GREEN}✓ Commit created${NC}"
|
echo -e "${GREEN}✓ Commit created${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Next steps:"
|
|
||||||
echo " git push origin main"
|
# Auto-tag if requested
|
||||||
|
if [ "$AUTO_TAG" = true ]; then
|
||||||
|
echo "Creating git tag v$NEW_VERSION..."
|
||||||
|
git tag -a "v$NEW_VERSION" -m "Release v$NEW_VERSION"
|
||||||
|
echo -e "${GREEN}✓ Tag created${NC}"
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Auto-push if requested
|
||||||
|
if [ "$AUTO_PUSH" = true ]; then
|
||||||
|
echo "Pushing to origin..."
|
||||||
|
git push origin main
|
||||||
|
git push origin "v$NEW_VERSION"
|
||||||
|
echo -e "${GREEN}✓ Pushed to origin${NC}"
|
||||||
|
echo ""
|
||||||
|
echo -e "${GREEN}Release v$NEW_VERSION initiated!${NC}"
|
||||||
|
echo "GitHub Actions will build artifacts in ~5-10 minutes."
|
||||||
|
echo "Monitor: https://github.com/steveyegge/beads/actions"
|
||||||
|
elif [ "$AUTO_TAG" = true ]; then
|
||||||
|
echo "Next steps:"
|
||||||
|
echo " git push origin main"
|
||||||
|
echo " git push origin v$NEW_VERSION"
|
||||||
|
else
|
||||||
|
echo "Next steps:"
|
||||||
|
echo " git push origin main"
|
||||||
|
echo " git tag -a v$NEW_VERSION -m 'Release v$NEW_VERSION'"
|
||||||
|
echo " git push origin v$NEW_VERSION"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo "Review the changes above. To commit:"
|
echo "Review the changes above. To commit:"
|
||||||
echo " git add -A"
|
echo " git add -A"
|
||||||
echo " git commit -m 'chore: Bump version to $NEW_VERSION'"
|
echo " git commit -m 'chore: Bump version to $NEW_VERSION'"
|
||||||
|
echo " git tag -a v$NEW_VERSION -m 'Release v$NEW_VERSION'"
|
||||||
echo " git push origin main"
|
echo " git push origin main"
|
||||||
|
echo " git push origin v$NEW_VERSION"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Or run with --commit to auto-commit:"
|
echo "Or run with flags to automate:"
|
||||||
echo " $0 $NEW_VERSION --commit"
|
echo " $0 $NEW_VERSION --commit --tag --push"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user