Skip to content

Commit 533af2f

Browse files
committed
ci(release): automate versioning from CHANGELOG.md
Replace manual version input with automatic extraction from CHANGELOG.md. Release notes are now pulled directly from the changelog entry for the version being released.
1 parent 468153d commit 533af2f

2 files changed

Lines changed: 160 additions & 41 deletions

File tree

.github/workflows/release.yml

Lines changed: 36 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ name: Release ClaudeMeter
22

33
on:
44
workflow_dispatch:
5-
inputs:
6-
version:
7-
description: 'Version number (e.g., 1.0.0)'
8-
required: true
9-
type: string
105

116
jobs:
127
build-and-release:
@@ -18,6 +13,31 @@ jobs:
1813
- name: Checkout code
1914
uses: actions/checkout@v5
2015

16+
- name: Extract version from changelog
17+
id: version
18+
run: |
19+
VERSION=$(sed -n 's/^## \[\([^]]*\)\].*/\1/p' CHANGELOG.md | head -1)
20+
echo "version=$VERSION" >> $GITHUB_OUTPUT
21+
22+
- name: Extract changelog
23+
id: changelog
24+
run: |
25+
VERSION=$(sed -n 's/^## \[\([^]]*\)\].*/\1/p' CHANGELOG.md | head -1)
26+
echo "version=$VERSION" >> $GITHUB_OUTPUT
27+
28+
CONTENT=$(awk '
29+
/^## \[/ {
30+
if (found) exit
31+
found=1
32+
next
33+
}
34+
found { print }
35+
' CHANGELOG.md)
36+
37+
echo "content<<EOF" >> $GITHUB_OUTPUT
38+
echo "$CONTENT" >> $GITHUB_OUTPUT
39+
echo "EOF" >> $GITHUB_OUTPUT
40+
2141
- name: Set up Xcode
2242
uses: maxim-lobanov/setup-xcode@v1
2343
with:
@@ -26,13 +46,13 @@ jobs:
2646
- name: Update version in project
2747
run: |
2848
# Update MARKETING_VERSION in project.pbxproj
29-
sed -i '' "s/MARKETING_VERSION = [^;]*/MARKETING_VERSION = ${{ inputs.version }}/g" ClaudeMeter.xcodeproj/project.pbxproj
49+
sed -i '' "s/MARKETING_VERSION = [^;]*/MARKETING_VERSION = ${{ steps.version.outputs.version }}/g" ClaudeMeter.xcodeproj/project.pbxproj
3050
3151
# Extract major version number for CURRENT_PROJECT_VERSION (e.g., 1.0.0 -> 1)
32-
BUILD_NUMBER=$(echo "${{ inputs.version }}" | sed 's/[^0-9]*\([0-9]*\).*/\1/')
52+
BUILD_NUMBER=$(echo "${{ steps.version.outputs.version }}" | sed 's/[^0-9]*\([0-9]*\).*/\1/')
3353
sed -i '' "s/CURRENT_PROJECT_VERSION = [^;]*/CURRENT_PROJECT_VERSION = $BUILD_NUMBER/g" ClaudeMeter.xcodeproj/project.pbxproj
3454
35-
echo "Updated version to ${{ inputs.version }} (build $BUILD_NUMBER)"
55+
echo "Updated version to ${{ steps.version.outputs.version }} (build $BUILD_NUMBER)"
3656
3757
- name: Install Apple certificate
3858
env:
@@ -136,40 +156,15 @@ jobs:
136156
cd build/Build/Products/Release
137157
xattr -cr ClaudeMeter.app
138158
find ClaudeMeter.app -name '._*' -delete
139-
zip -r ../../../../ClaudeMeter-${{ inputs.version }}.zip ClaudeMeter.app
159+
zip -r ../../../../ClaudeMeter-${{ steps.version.outputs.version }}.zip ClaudeMeter.app
140160
141161
- name: Create GitHub Release
142162
uses: softprops/action-gh-release@v2
143163
with:
144-
tag_name: v${{ inputs.version }}
145-
name: ClaudeMeter v${{ inputs.version }}
146-
body: |
147-
## ClaudeMeter v${{ inputs.version }}
148-
149-
### Installation
150-
151-
1. Download `ClaudeMeter-${{ inputs.version }}.zip`
152-
2. Unzip and move `ClaudeMeter.app` to Applications
153-
3. Double-click to open
154-
155-
This release is **signed and notarized** by Apple.
156-
157-
### Features
158-
159-
- **Real-time usage monitoring** - Track your 5-hour session, 7-day weekly, and Sonnet-specific usage limits
160-
- **Menu bar integration** - Clean, color-coded usage indicator that lives in your macOS menu bar
161-
- **Smart notifications** - Configurable alerts at warning and critical thresholds (defaults: 75% and 90%)
162-
- **Auto-refresh** - Automatic usage updates every 1-10 minutes (customizable)
163-
164-
### Requirements
165-
166-
- macOS 14.0 (Sonoma) or later
167-
- Active Claude.ai account with session key
168-
169-
### Disclaimer
170-
171-
⚠️ **Unofficial tool** - Not affiliated with Anthropic. Use at your own risk.
172-
files: ClaudeMeter-${{ inputs.version }}.zip
164+
tag_name: v${{ steps.version.outputs.version }}
165+
name: ClaudeMeter v${{ steps.version.outputs.version }}
166+
body: ${{ steps.changelog.outputs.content }}
167+
files: ClaudeMeter-${{ steps.version.outputs.version }}.zip
173168
draft: false
174169
prerelease: false
175170
env:
@@ -179,18 +174,18 @@ jobs:
179174
env:
180175
TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
181176
run: |
182-
SHA=$(shasum -a 256 ClaudeMeter-${{ inputs.version }}.zip | cut -d' ' -f1)
177+
SHA=$(shasum -a 256 ClaudeMeter-${{ steps.version.outputs.version }}.zip | cut -d' ' -f1)
183178
184179
git clone https://x-access-token:${TAP_TOKEN}@github.com/eddmann/homebrew-tap.git
185180
cd homebrew-tap
186181
187-
sed -i '' "s/version \".*\"/version \"${{ inputs.version }}\"/" Casks/claudemeter.rb
182+
sed -i '' "s/version \".*\"/version \"${{ steps.version.outputs.version }}\"/" Casks/claudemeter.rb
188183
sed -i '' "s/sha256 \".*\"/sha256 \"${SHA}\"/" Casks/claudemeter.rb
189184
190185
git config user.name "github-actions[bot]"
191186
git config user.email "github-actions[bot]@users.noreply.github.com"
192187
git add Casks/claudemeter.rb
193-
git commit -m "chore(claudemeter): update to ${{ inputs.version }}"
188+
git commit -m "chore(claudemeter): update to ${{ steps.version.outputs.version }}"
194189
git push
195190
196191
- name: Cleanup keychain

CHANGELOG.md

Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [1.2.1] - 2026-01-20
9+
10+
### Changed
11+
12+
- Release workflow now extracts version and release notes automatically from CHANGELOG.md
13+
14+
## [1.2.0] - 2026-01-16
15+
16+
### Added
17+
18+
- Pacing risk indicator to usage cards
19+
20+
### Changed
21+
22+
- Rename README directory to docs
23+
24+
### Fixed
25+
26+
- Skip snapshot tests due to rendering differences
27+
- Disable code signing for test workflow
28+
29+
### CI
30+
31+
- Add test workflow to run Xcode tests on push
32+
33+
## [1.1.2] - 2026-01-14
34+
35+
### Changed
36+
37+
- Replace MenuBarExtra with NSStatusItem/NSPopover for improved menu bar behavior
38+
- Modernize app lifecycle and testing architecture
39+
40+
### Added
41+
42+
- Notification tap-to-open functionality
43+
44+
## [1.1.1] - 2026-01-04
45+
46+
### Fixed
47+
48+
- Only show loading spinner when no data exists in menu bar
49+
50+
## [1.1.0] - 2026-01-02
51+
52+
### Added
53+
54+
- Configurable menu bar icon styles
55+
- Homebrew tap distribution
56+
- GitHub Pages landing page
57+
58+
## [1.0.7] - 2025-12-24
59+
60+
### Added
61+
62+
- Export usage data to ~/.claudemeter/usage.json for external tools
63+
- os.log logging for API error debugging
64+
65+
### Fixed
66+
67+
- Force refresh usage data on app boot
68+
69+
## [1.0.6] - 2025-11-26
70+
71+
### Added
72+
73+
- Code signing and notarization to release workflow
74+
75+
## [1.0.5] - 2025-11-25
76+
77+
### Changed
78+
79+
- Replace Opus tracking with Sonnet
80+
81+
### Added
82+
83+
- Tooltip showing exact reset time
84+
85+
### Fixed
86+
87+
- NSUserNotificationsUsageDescription configuration
88+
89+
## [1.0.4] - 2025-11-19
90+
91+
### Fixed
92+
93+
- Change NotificationService from actor to @MainActor class for improved reliability
94+
95+
## [1.0.3] - 2025-11-19
96+
97+
### Fixed
98+
99+
- Improve settings persistence
100+
- Improve notification permission handling
101+
102+
## [1.0.2] - 2025-11-19
103+
104+
### Fixed
105+
106+
- Replace ProgressView with static SF Symbol
107+
- Adjust staleness threshold
108+
- Force UserDefaults sync
109+
110+
## [1.0.1] - 2025-11-18
111+
112+
### Changed
113+
114+
- Clarify Claude.ai plan usage vs developer API in documentation
115+
116+
## [1.0.0] - 2025-11-18
117+
118+
### Added
119+
120+
- Initial ClaudeMeter macOS menu bar app
121+
- Real-time usage monitoring for 5-hour session, 7-day weekly, and Sonnet-specific usage limits
122+
- Menu bar integration with clean, color-coded usage indicator
123+
- Smart notifications with configurable alerts at warning and critical thresholds (defaults: 75% and 90%)
124+
- Auto-refresh with automatic usage updates every 1-10 minutes (customizable)

0 commit comments

Comments
 (0)