Skip to content

Commit fb4f844

Browse files
committed
release prep
Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
1 parent 6b5c7b6 commit fb4f844

3 files changed

Lines changed: 107 additions & 0 deletions

File tree

.claude/commands/release-notes.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
Generate release notes for the next release.
2+
3+
Steps:
4+
1. Read the `VERSION` file to get the version number
5+
2. Find the last git tag: `git describe --tags --abbrev=0 2>/dev/null`
6+
3. Get commits since last tag (or all commits if no tags):
7+
- If tag exists: `git log <tag>..HEAD --pretty=format:"%h %s" --no-merges`
8+
- If no tags: `git log --pretty=format:"%h %s" --no-merges`
9+
4. Get a summary of changed files: `git diff --stat <tag>..HEAD` (or `git diff --stat --root HEAD` if no tags)
10+
11+
Then synthesize release notes:
12+
- Write a brief summary of what this release accomplishes (2-3 sentences)
13+
- Group changes into logical sections (Features, Fixes, Documentation, etc.)
14+
- Write human-friendly descriptions, not just commit messages
15+
- Highlight breaking changes or important updates
16+
- Skip trivial changes (typo fixes, minor refactors)
17+
18+
Write the output to `dist/RELEASE_NOTES.md` in this format:
19+
20+
```markdown
21+
# Context CLI v<version>
22+
23+
<Brief summary paragraph>
24+
25+
## Highlights
26+
27+
- Key change 1
28+
- Key change 2
29+
30+
## Features
31+
32+
- Description of feature
33+
34+
## Bug Fixes
35+
36+
- Description of fix
37+
38+
## Documentation
39+
40+
- Description of doc changes
41+
42+
---
43+
44+
Full changelog: https://github.com/ActiveMemory/ctx/compare/<last-tag>...v<version>
45+
```
46+
47+
End by confirming: "Release notes written to dist/RELEASE_NOTES.md"

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.0

hack/tag.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/bin/bash
2+
3+
# / Context: https://ctx.ist
4+
# ,'`./ do you remember?
5+
# `.,'\
6+
# \ Copyright 2026-present Context contributors.
7+
# SPDX-License-Identifier: Apache-2.0
8+
9+
#
10+
# Tag script for Context CLI
11+
#
12+
# Creates a signed git tag and pushes it to origin.
13+
# Reads version from VERSION file.
14+
#
15+
# Usage: ./hack/tag.sh
16+
#
17+
18+
set -e
19+
20+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
21+
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
22+
23+
# Read version from VERSION file
24+
if [ ! -f "$ROOT_DIR/VERSION" ]; then
25+
echo "ERROR: VERSION file not found"
26+
exit 1
27+
fi
28+
29+
VERSION="v$(cat "$ROOT_DIR/VERSION" | tr -d '[:space:]')"
30+
31+
echo "Creating tag: $VERSION"
32+
33+
# Check if tag already exists locally
34+
if git rev-parse "$VERSION" >/dev/null 2>&1; then
35+
echo "ERROR: Tag $VERSION already exists locally."
36+
echo "To recreate it:"
37+
echo " git tag -d $VERSION"
38+
exit 1
39+
fi
40+
41+
# Check if tag exists on remote
42+
if git ls-remote --tags origin | grep -q "refs/tags/$VERSION$"; then
43+
echo "ERROR: Tag $VERSION already exists on origin."
44+
echo "To recreate it:"
45+
echo " git push origin :refs/tags/$VERSION"
46+
exit 1
47+
fi
48+
49+
# Create signed tag
50+
git tag -s "$VERSION" -m "$VERSION"
51+
52+
echo ""
53+
echo "Tag $VERSION created locally."
54+
echo ""
55+
echo "To push:"
56+
echo " git push origin --tags"
57+
echo ""
58+
echo "Or to push just this tag:"
59+
echo " git push origin $VERSION"

0 commit comments

Comments
 (0)