@@ -2,11 +2,6 @@ name: Release ClaudeMeter
22
33on :
44 workflow_dispatch :
5- inputs :
6- version :
7- description : ' Version number (e.g., 1.0.0)'
8- required : true
9- type : string
105
116jobs :
127 build-and-release :
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
0 commit comments