name: release description: Bump version, commit, tag, push, and auto-publish a release with auto-generated changelog notes argument-hint: "[version]"
Bump the app version, trigger a CI release build, and populate the GitHub release body with a changelog generated from git history. The changelog feeds the in-app ChangelogModal after auto-updates, so every release needs real notes — never leave the default "See the assets below" placeholder.
- Determine target version:
- If
$ARGUMENTSis a valid semver (e.g.0.2.0): use it. - If
$ARGUMENTSis empty or missing: rungh release list --limit 1to get the latest published release tag, then auto-increment the patch version (e.g.0.1.2→0.1.3). If no releases exist, fall back to readingpackage.jsonand incrementing that. - If
$ARGUMENTSis invalid: STOP and ask.
- If
- Capture the previous tag for changelog generation:
previous_tag=$(gh release list --limit 1 --json tagName --jq '.[0].tagName').- If empty, fall back to
git describe --tags --abbrev=0 2>/dev/null. If still empty (first-ever release), skip the changelog step and use a one-liner body like "Initial release."
- Bump version in ALL THREE files (all must match):
package.json→"version": "<version>"src-tauri/Cargo.toml→version = "<version>"src-tauri/tauri.conf.json→"version": "<version>"
- Run
npm run typecheck— if it fails, STOP and report errors. git add -A && git commit -m "chore: bump version to <version>"git push- Build the release notes body from git log since the previous tag:
commits=$(git log ${previous_tag}..HEAD --no-merges --pretty=format:"- %s")- Skip commits whose subject starts with
chore: bump version(they are pure version bumps and add noise). - Prepend
## What's changed\n\nand append\n\n**Full changelog**: https://github.com/OhAhNicko/SleekCode/compare/${previous_tag}...v<version>. - If the commit list is empty after filtering, fall back to
- Maintenance release.so the body is never empty.
git tag v<version> && git push --tags— this triggers CI (.github/workflows/release.yml), which builds/signs viatauri-apps/tauri-action@v0.6and then auto-publishes the release (thepublishjob runsgh release edit --draft=falseafter the build matrix, even if a platform build fails). No manual publish step is needed.- Populate the draft release with the generated notes:
- First attempt:
gh release create v<version> --title "MADE v<version>" --notes "$body" --draft. - If that fails because CI already created the release, fall back to:
gh release edit v<version> --title "MADE v<version>" --notes "$body". - Pass
--notesvia a HEREDOC file (--notes-file) if the body contains special shell characters.
- First attempt:
- Report: "Release v
triggered. Monitor CI: https://github.com/OhAhNicko/SleekCode/actions" - No manual publish needed — CI auto-publishes the release once the build matrix finishes uploading artifacts (the
publishjob in.github/workflows/release.yml). Note for the operator:gh run watchcan report success on a failed run — verify the real outcome withgh run view <id> --json conclusion,jobs, and confirm the release went live by curlinghttps://github.com/OhAhNicko/SleekCode/releases/latest/download/latest.json(it should serve v). The notes feed the in-app changelog popup after the next auto-update.