Skip to content

Commit 262671c

Browse files
feat: integrate changesets for version management and releases
1 parent ec2c924 commit 262671c

File tree

8 files changed

+455
-88
lines changed

8 files changed

+455
-88
lines changed

.changeset/CONTRIBUTING.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Using Changesets
2+
3+
This project uses [Changesets](https://github.com/changesets/changesets) to manage versioning and changelogs.
4+
5+
## For Contributors
6+
7+
When you make a change that affects users (bug fix, new feature, breaking change), you need to add a changeset:
8+
9+
```bash
10+
bun changeset
11+
```
12+
13+
This will prompt you to:
14+
15+
1. Select the type of change (major/minor/patch)
16+
2. Write a summary of the change
17+
18+
The changeset will be included in your PR.
19+
20+
## Change Types
21+
22+
- **Major** (1.0.0 → 2.0.0): Breaking changes
23+
- **Minor** (1.0.0 → 1.1.0): New features (backwards compatible)
24+
- **Patch** (1.0.0 → 1.0.1): Bug fixes
25+
26+
## For Maintainers
27+
28+
### Release Process (Manual Trigger)
29+
30+
1. **Accumulate changesets** from merged PRs
31+
32+
2. **Trigger release workflow**:
33+
- Go to GitHub Actions → "Release" workflow
34+
- Click "Run workflow"
35+
- The workflow will:
36+
- Consume all changesets
37+
- Update package.json version
38+
- Update CHANGELOG.md
39+
- Commit changes
40+
- Build Windows binaries
41+
- Create git tag
42+
- Create GitHub release with artifacts
43+
44+
That's it! One click release.
45+
46+
### What happens behind the scenes:
47+
48+
```bash
49+
bun changeset:version # Consumes changesets, updates version
50+
git commit & push # Commits version bump
51+
bun run build:win # Builds binaries
52+
gh release create # Creates GitHub release
53+
```
54+
55+
## Examples
56+
57+
### Adding a Changeset
58+
59+
```bash
60+
$ bun changeset
61+
🦋 Which packages would you like to include? · vlc-rpc
62+
🦋 Which type of change is this for vlc-rpc? · patch
63+
🦋 Please enter a summary for this change (this will be in the changelogs).
64+
🦋 (submit empty line to open external editor)
65+
🦋 Summary · Fixed cover art upload issues
66+
🦋
67+
🦋 === Summary of changesets ===
68+
🦋 patch: vlc-rpc
69+
🦋
70+
🦋 Is this your desired changeset? (Y/n) · true
71+
🦋 Changeset added! - you can now commit it
72+
```
73+
74+
### Viewing Pending Changesets
75+
76+
```bash
77+
bun changeset status
78+
```
79+
80+
## Workflow
81+
82+
```
83+
PR with changeset → Merge → Changesets accumulate → Manual trigger "Release" → Done
84+
```
85+
86+
Simple and controlled!

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "public",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": [],
11+
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
12+
"onlyUpdatePeerDependentsWhenOutOfRange": true
13+
}
14+
}

.github/workflows/release-manual.yml

Lines changed: 0 additions & 79 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Release
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: write
8+
9+
jobs:
10+
release:
11+
name: Build and Release
12+
runs-on: windows-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Setup Bun
20+
uses: oven-sh/setup-bun@v2
21+
22+
- name: Install dependencies
23+
run: bun install
24+
25+
- name: Version packages with Changesets
26+
run: |
27+
bun changeset:version
28+
29+
$packageJson = Get-Content package.json | ConvertFrom-Json
30+
$version = $packageJson.version
31+
$tag = "v$version"
32+
33+
Write-Host "::notice::Version: $version"
34+
Write-Host "::notice::Tag: $tag"
35+
36+
echo "VERSION=$version" >> $env:GITHUB_ENV
37+
echo "TAG=$tag" >> $env:GITHUB_ENV
38+
shell: pwsh
39+
40+
- name: Commit version changes
41+
run: |
42+
git config user.name "github-actions[bot]"
43+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
44+
git add .
45+
try {
46+
git commit -m "chore: release v${{ env.VERSION }}"
47+
git push
48+
} catch {
49+
Write-Host "No changes to commit"
50+
}
51+
shell: pwsh
52+
53+
- name: Build Windows binaries
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
run: bun run build:win
57+
58+
- name: Create git tag and release
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
run: |
62+
git tag "${{ env.TAG }}" -f
63+
git push origin "${{ env.TAG }}" -f
64+
65+
gh release create "${{ env.TAG }}" `
66+
--title "VLC Discord RP ${{ env.TAG }}" `
67+
--notes "See [CHANGELOG.md](https://github.com/valentin-marquez/vlc-rpc/blob/main/CHANGELOG.md) for detailed changes." `
68+
dist/*.exe `
69+
dist/*.zip `
70+
dist/*.yml `
71+
dist/*.blockmap `
72+
--latest
73+
shell: pwsh

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,20 @@ The app runs in your system tray. Right-click the tray icon to:
8989

9090
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
9191

92+
## Contributing
93+
94+
Contributions are welcome! To contribute:
95+
96+
1. Fork the repository
97+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
98+
3. Make your changes
99+
4. Add a changeset: `bun changeset` (see [.changeset/CONTRIBUTING.md](.changeset/CONTRIBUTING.md))
100+
5. Commit your changes (`git commit -m 'Add amazing feature'`)
101+
6. Push to the branch (`git push origin feature/amazing-feature`)
102+
7. Open a Pull Request
103+
104+
Please ensure your PR includes a changeset for any user-facing changes.
105+
92106
## Support
93107

94108
Found a bug or have a feature request? [Open an issue](https://github.com/valentin-marquez/vlc-rpc/issues) on GitHub.

0 commit comments

Comments
 (0)