4.2 KiB
Release Process Guide
First time setup: Make sure you have the nbgv tool installed before doing anything else:
dotnet tool install -g nbgv
Quick Reference
Check current version
To see what version you’re currently on, just run:
nbgv get-version
Patch release (1.0.0 → 1.0.1)
Want to create a quick patch release? Simply commit and push to main - the version bumps up automatically!
Minor release (1.0.x → 1.1.0)
If you’re looking to add some new features but don’t want to change the major version, do this:
nbgv prepare-release
git checkout main
git merge release/v1.1
git push
Major release (1.x.x → 2.0.0)
Ready to make some breaking changes? Here’s how to bump up the major version:
- Open up
version.jsonand change"version": "1.0"to"version": "2.0" - Commit and push those changes to main
Manual release (if things break)
In case of emergencies, you can manually run the GitHub Action:
- Head over to the Actions tab
- Hit "Build and Release"
- Click "Run workflow"
- Make sure "Create a GitHub release" is checked
- Click "Run workflow" again
How this works
Version numbers
Here's the lowdown on versioning:
- Patch versions (1.0.0 → 1.0.1): These tick up automatically with each commit to main
- Minor versions (1.0.x → 1.1.0): You’ll use
nbgv prepare-releasefor these - Major versions (1.x.x → 2.0.0): A quick edit in
version.jsonis all you need
When releases happen automatically
The magic happens and releases are created when:
- You push a non-prerelease version to the main branch
- OR you give it a nudge manually with the "create release" option
What gets built
Wondering what gets bundled up in each release? You’ll find executables for:
- Windows x64 (
github-repo-remover-win-x64.exe) - macOS Intel (
github-repo-remover-osx-x64) - macOS Apple Silicon (
github-repo-remover-osx-arm64) - Linux x64 (
github-repo-remover-linux-x64)
Step-by-step workflows
Hotfix/patch (most common)
If you’re making a quick fix, here’s what to do:
- Make your changes
- Commit them:
git commit -m "Fix: whatever you fixed" - Push your changes:
git push - And you’re done! Release is created automatically
Feature release
Got a new feature ready? Follow these steps:
- Make your changes
- Commit them:
git commit -m "Add: new feature" - Prepare the release with:
nbgv prepare-release - Merge the changes back to main:
git checkout main git merge release/v1.1 # (replace with the version it created) - Push it all up:
git push - Done deal! Release gets created automatically
Breaking change
Making a breaking change? Here’s the process:
- Update
version.jsonto bump the major version:{ "version": "2.0", // ... rest stays the same } - Commit your changes:
git commit -m "BREAKING: what changed" - Push it all:
git push - That’s it! Release is created automatically
Manual release script
Need to create a tag manually? Maybe testing or automation hiccuped? Here’s how:
# First, see what would happen without actually doing it
.\scripts\create-release.ps1 -WhatIf
# If all looks good, go ahead and create the tag
.\scripts\create-release.ps1
When things go wrong
"Tag already exists" error
If you hit a "Tag already exists" error, it means the GitHub Action is trying to avoid duplicate releases. To sort this out:
- Delete the problematic tag:
git tag -d v1.0.1 && git push origin :v1.0.1 - Manually delete the GitHub release
- Either push your changes again or rerun the action manually
Version not incrementing
Not seeing the version increment? Check if you have new commits since the last release. Remember, each commit to main should bump up the patch version.
Check what version will be built
Curious about what version is up next? Run:
nbgv get-version --format json