Skip to content

Commit 1a6afb7

Browse files
m_igashim_igashi
authored andcommitted
chore: improve release workflow and documentation
- Reorder README installation section (macOS first) - Add automated package manager updates to release workflow: - Scoop bucket auto-update - Homebrew tap auto-update - crates.io auto-publish - Create draft releases for manual release notes editing - Add .claude/rules.md with release process guidelines
1 parent 9576169 commit 1a6afb7

File tree

3 files changed

+229
-20
lines changed

3 files changed

+229
-20
lines changed

.claude/rules.md

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# mp3rgain Project Rules
2+
3+
## Release Process
4+
5+
When creating a new release for mp3rgain:
6+
7+
### 1. Release Notes
8+
Always write detailed release notes for each version. Include:
9+
- **New Features**: List new functionality with brief descriptions
10+
- **Bug Fixes**: Document any bugs that were fixed
11+
- **Breaking Changes**: Highlight any changes that may affect existing users
12+
- **Dependencies**: Note any dependency updates if relevant
13+
14+
### 2. GitHub Release Editing
15+
After the release workflow creates a draft release:
16+
1. Edit the GitHub release to add proper release notes (do not rely solely on auto-generated notes)
17+
2. Write a human-readable summary at the top
18+
3. Include installation instructions for the new version
19+
4. Mention package manager availability (Homebrew, Scoop, winget, Cargo)
20+
21+
### 3. Release Checklist
22+
Before tagging a release:
23+
- [ ] Update version in `Cargo.toml`
24+
- [ ] Update CHANGELOG if present
25+
- [ ] Ensure all tests pass
26+
- [ ] Verify documentation is up to date
27+
28+
After release workflow completes:
29+
- [ ] Edit GitHub release with detailed notes
30+
- [ ] Verify Scoop bucket was updated
31+
- [ ] Verify Homebrew tap was updated
32+
- [ ] Verify crates.io publish succeeded
33+
- [ ] Announce on relevant channels if applicable
34+
35+
### 4. Release Notes Template
36+
37+
```markdown
38+
## What's New in vX.Y.Z
39+
40+
Brief summary of this release.
41+
42+
### New Features
43+
- Feature 1: Description
44+
- Feature 2: Description
45+
46+
### Bug Fixes
47+
- Fixed issue with X (#issue_number)
48+
49+
### Installation
50+
51+
**macOS (Homebrew):**
52+
\`\`\`bash
53+
brew upgrade mp3rgain
54+
# or
55+
brew install M-Igashi/tap/mp3rgain
56+
\`\`\`
57+
58+
**Windows (Scoop):**
59+
\`\`\`powershell
60+
scoop update mp3rgain
61+
\`\`\`
62+
63+
**Windows (winget):**
64+
\`\`\`powershell
65+
winget upgrade M-Igashi.mp3rgain
66+
\`\`\`
67+
68+
**Cargo:**
69+
\`\`\`bash
70+
cargo install mp3rgain
71+
\`\`\`
72+
73+
### Full Changelog
74+
https://github.com/M-Igashi/mp3rgain/compare/vX.Y.Z-1...vX.Y.Z
75+
```
76+
77+
## Code Style
78+
79+
- Follow Rust idioms and conventions
80+
- Use `rustfmt` for formatting
81+
- Run `cargo clippy` before committing
82+
- Keep functions focused and small
83+
- Write tests for new functionality
84+
85+
## Commit Messages
86+
87+
Use conventional commit format:
88+
- `feat:` for new features
89+
- `fix:` for bug fixes
90+
- `docs:` for documentation changes
91+
- `refactor:` for code refactoring
92+
- `test:` for test additions/changes
93+
- `chore:` for maintenance tasks

.github/workflows/release.yml

Lines changed: 124 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- uses: actions/checkout@v4
3131

3232
- name: Install Rust
33-
uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
33+
uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
3434
with:
3535
targets: ${{ matrix.target }}
3636

@@ -55,9 +55,18 @@ jobs:
5555
name: Create Release
5656
needs: build
5757
runs-on: macos-latest
58+
outputs:
59+
version: ${{ steps.version.outputs.version }}
60+
windows_x64_sha256: ${{ steps.checksums.outputs.windows_x64_sha256 }}
61+
windows_arm64_sha256: ${{ steps.checksums.outputs.windows_arm64_sha256 }}
62+
macos_sha256: ${{ steps.checksums.outputs.macos_sha256 }}
5863
steps:
5964
- uses: actions/checkout@v4
6065

66+
- name: Get version
67+
id: version
68+
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
69+
6170
- name: Download all artifacts
6271
uses: actions/download-artifact@v4
6372
with:
@@ -100,8 +109,15 @@ jobs:
100109
cd ../../dist
101110
shasum -a 256 mp3rgain-${{ github.ref_name }}-windows-arm64.zip > mp3rgain-${{ github.ref_name }}-windows-arm64.zip.sha256
102111
112+
- name: Extract checksums
113+
id: checksums
114+
run: |
115+
echo "windows_x64_sha256=$(cat dist/mp3rgain-${{ github.ref_name }}-windows-x86_64.zip.sha256 | awk '{print $1}')" >> $GITHUB_OUTPUT
116+
echo "windows_arm64_sha256=$(cat dist/mp3rgain-${{ github.ref_name }}-windows-arm64.zip.sha256 | awk '{print $1}')" >> $GITHUB_OUTPUT
117+
echo "macos_sha256=$(cat dist/mp3rgain-${{ github.ref_name }}-macos-universal.tar.gz.sha256 | awk '{print $1}')" >> $GITHUB_OUTPUT
118+
103119
- name: Create Release
104-
uses: softprops/action-gh-release@26994186c0ac3ef5cae75ac16aa32e8153525f77 # v1
120+
uses: softprops/action-gh-release@c95fe1489396fe8a9eb87c0abf8aa5b2ef267fda # v2
105121
with:
106122
files: |
107123
dist/mp3rgain-${{ github.ref_name }}-macos-universal.tar.gz
@@ -112,4 +128,109 @@ jobs:
112128
dist/mp3rgain-${{ github.ref_name }}-windows-x86_64.zip.sha256
113129
dist/mp3rgain-${{ github.ref_name }}-windows-arm64.zip
114130
dist/mp3rgain-${{ github.ref_name }}-windows-arm64.zip.sha256
115-
generate_release_notes: true
131+
draft: true
132+
generate_release_notes: false
133+
134+
# Update Scoop bucket
135+
update-scoop:
136+
name: Update Scoop Bucket
137+
needs: release
138+
runs-on: ubuntu-latest
139+
steps:
140+
- name: Checkout scoop-bucket
141+
uses: actions/checkout@v4
142+
with:
143+
repository: M-Igashi/scoop-bucket
144+
token: ${{ secrets.SCOOP_BUCKET_TOKEN }}
145+
path: scoop-bucket
146+
147+
- name: Update manifest
148+
run: |
149+
cd scoop-bucket
150+
cat > mp3rgain.json << 'EOF'
151+
{
152+
"version": "${{ needs.release.outputs.version }}",
153+
"description": "Lossless MP3 volume adjustment - a modern mp3gain replacement written in Rust",
154+
"homepage": "https://github.com/M-Igashi/mp3rgain",
155+
"license": "MIT",
156+
"architecture": {
157+
"64bit": {
158+
"url": "https://github.com/M-Igashi/mp3rgain/releases/download/${{ github.ref_name }}/mp3rgain-${{ github.ref_name }}-windows-x86_64.zip",
159+
"hash": "${{ needs.release.outputs.windows_x64_sha256 }}"
160+
},
161+
"arm64": {
162+
"url": "https://github.com/M-Igashi/mp3rgain/releases/download/${{ github.ref_name }}/mp3rgain-${{ github.ref_name }}-windows-arm64.zip",
163+
"hash": "${{ needs.release.outputs.windows_arm64_sha256 }}"
164+
}
165+
},
166+
"bin": "mp3rgain.exe",
167+
"checkver": "github",
168+
"autoupdate": {
169+
"architecture": {
170+
"64bit": {
171+
"url": "https://github.com/M-Igashi/mp3rgain/releases/download/v$version/mp3rgain-v$version-windows-x86_64.zip"
172+
},
173+
"arm64": {
174+
"url": "https://github.com/M-Igashi/mp3rgain/releases/download/v$version/mp3rgain-v$version-windows-arm64.zip"
175+
}
176+
},
177+
"hash": {
178+
"url": "$url.sha256"
179+
}
180+
}
181+
}
182+
EOF
183+
184+
- name: Commit and push
185+
run: |
186+
cd scoop-bucket
187+
git config user.name "github-actions[bot]"
188+
git config user.email "github-actions[bot]@users.noreply.github.com"
189+
git add mp3rgain.json
190+
git commit -m "Update mp3rgain to ${{ needs.release.outputs.version }}" || exit 0
191+
git push
192+
193+
# Update Homebrew tap
194+
update-homebrew:
195+
name: Update Homebrew Tap
196+
needs: release
197+
runs-on: ubuntu-latest
198+
steps:
199+
- name: Checkout homebrew-tap
200+
uses: actions/checkout@v4
201+
with:
202+
repository: M-Igashi/homebrew-tap
203+
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
204+
path: homebrew-tap
205+
206+
- name: Update formula
207+
run: |
208+
cd homebrew-tap/Formula
209+
sed -i 's|url "https://github.com/M-Igashi/mp3rgain/releases/download/v[^"]*|url "https://github.com/M-Igashi/mp3rgain/releases/download/${{ github.ref_name }}/mp3rgain-${{ github.ref_name }}-macos-universal.tar.gz|' mp3rgain.rb
210+
sed -i 's|sha256 "[^"]*"|sha256 "${{ needs.release.outputs.macos_sha256 }}"|' mp3rgain.rb
211+
sed -i 's|version "[^"]*"|version "${{ needs.release.outputs.version }}"|' mp3rgain.rb
212+
213+
- name: Commit and push
214+
run: |
215+
cd homebrew-tap
216+
git config user.name "github-actions[bot]"
217+
git config user.email "github-actions[bot]@users.noreply.github.com"
218+
git add Formula/mp3rgain.rb
219+
git commit -m "Update mp3rgain to ${{ needs.release.outputs.version }}" || exit 0
220+
git push
221+
222+
# Publish to crates.io
223+
publish-cargo:
224+
name: Publish to crates.io
225+
needs: release
226+
runs-on: ubuntu-latest
227+
steps:
228+
- uses: actions/checkout@v4
229+
230+
- name: Install Rust
231+
uses: dtolnay/rust-toolchain@4be9e76fd7c4901c61fb841f559994984270fce7 # stable
232+
233+
- name: Publish to crates.io
234+
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
235+
env:
236+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

README.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ mp3rgain adjusts MP3 volume without re-encoding by modifying the `global_gain` f
2222

2323
## Installation
2424

25+
### macOS
26+
27+
**Homebrew** (recommended):
28+
```bash
29+
brew install M-Igashi/tap/mp3rgain
30+
```
31+
32+
**Download binary:**
33+
1. Download `mp3rgain-*-macos-universal.tar.gz` from [GitHub Releases](https://github.com/M-Igashi/mp3rgain/releases)
34+
2. Extract: `tar -xzf mp3rgain-*-macos-universal.tar.gz`
35+
3. Move to PATH: `sudo mv mp3rgain /usr/local/bin/`
36+
2537
### Windows
2638

2739
**Scoop** (recommended):
@@ -56,23 +68,6 @@ winget install M-Igashi.mp3rgain
5668

5769
> **Note:** mp3rgain is a command-line tool, not a GUI application. Double-clicking the executable will briefly open and close a terminal window. Always run it from PowerShell or Command Prompt.
5870
59-
**Using Cargo** (for Rust developers):
60-
```powershell
61-
cargo install mp3rgain
62-
```
63-
64-
### macOS
65-
66-
**Homebrew** (recommended):
67-
```bash
68-
brew install M-Igashi/tap/mp3rgain
69-
```
70-
71-
**Download binary:**
72-
1. Download `mp3rgain-*-macos-universal.tar.gz` from [GitHub Releases](https://github.com/M-Igashi/mp3rgain/releases)
73-
2. Extract: `tar -xzf mp3rgain-*-macos-universal.tar.gz`
74-
3. Move to PATH: `sudo mv mp3rgain /usr/local/bin/`
75-
7671
### Linux
7772

7873
**Download binary:**

0 commit comments

Comments
 (0)