Skip to content

Commit d003974

Browse files
beautyfreeclaude
andcommitted
ci: automate releases with release-please + conventional commits
- Add .github/workflows/release-please.yml to open "Release PR"s bumping package.json, updating CHANGELOG.md, and drafting release notes from conventional commit messages. - Simplify release.yml: drop the hand-rolled prepare-release / publish-release jobs (release-please now owns the release body and tag). The build job only attaches installers to the existing release. - Document the conventional-commits flow in CLAUDE.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 22e4d91 commit d003974

5 files changed

Lines changed: 82 additions & 52 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Release Please
2+
3+
# Opens / updates a "Release PR" whenever conventional-commits land on main.
4+
# On merge, release-please bumps `package.json`, updates `CHANGELOG.md`, creates
5+
# a GitHub Release and pushes a matching `v<version>` tag. The tag push then
6+
# triggers `.github/workflows/release.yml` which builds & uploads the desktop
7+
# installers. Release notes come from the conventional commit messages.
8+
9+
on:
10+
push:
11+
branches:
12+
- main
13+
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
concurrency:
19+
group: release-please-${{ github.ref }}
20+
cancel-in-progress: false
21+
22+
jobs:
23+
release-please:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: googleapis/release-please-action@v4
27+
with:
28+
config-file: release-please-config.json
29+
manifest-file: .release-please-manifest.json
30+
# Use the default token — tag push is what re-triggers downstream
31+
# build workflow (release.yml) on the same commit.
32+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yml

Lines changed: 9 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
name: Release
22

3-
# Triggered by pushing a tag like v0.2.0. Builds the Electron app natively on
4-
# each OS (electron-builder + node-gyp native modules don't cross-compile
5-
# cleanly) and uploads every artifact to the GitHub Release directly so the
6-
# workflow keeps working even if the account-wide Actions artifact quota is
7-
# full. electron-updater reads `latest-{mac,linux,win}.yml` from the same
8-
# release to drive auto-updates in production.
3+
# Triggered by pushing a tag like v0.2.0. release-please (see
4+
# .github/workflows/release-please.yml) creates the GitHub Release + tag when
5+
# its "Release PR" is merged; this workflow then builds the Electron app
6+
# natively on each OS (electron-builder + node-gyp native modules don't
7+
# cross-compile cleanly) and uploads every artifact to that same release.
8+
# electron-updater reads `latest-{mac,linux,win}.yml` from the same release
9+
# to drive auto-updates in production.
910

1011
on:
1112
push:
@@ -20,37 +21,8 @@ concurrency:
2021
cancel-in-progress: false
2122

2223
jobs:
23-
prepare-release:
24-
name: Prepare draft release
25-
runs-on: ubuntu-latest
26-
steps:
27-
- uses: actions/checkout@v5
28-
29-
- name: Create or reset draft release
30-
uses: softprops/action-gh-release@v2
31-
with:
32-
tag_name: ${{ github.ref_name }}
33-
name: Skiller ${{ github.ref_name }}
34-
body: |
35-
Desktop installers — download the one that matches your OS:
36-
37-
- **macOS (Apple Silicon):** `Skiller-<version>-macos-arm64.dmg` (signed + notarized — drag to Applications)
38-
- **macOS (Intel):** `Skiller-<version>-macos-x64.dmg` (signed + notarized — drag to Applications)
39-
- **Windows (x64):** `Skiller-<version>-win-x64.exe` (NSIS installer)
40-
- **Linux (x64):** `Skiller-<version>-linux-x86_64.AppImage` or `.deb`
41-
42-
After the first install, Skiller checks this release on launch and
43-
via **Settings → App Updates**. Updates are downloaded on demand
44-
and applied on next restart — powered by `electron-updater`.
45-
draft: true
46-
prerelease: false
47-
generate_release_notes: true
48-
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50-
5124
build-desktop:
5225
name: Build ${{ matrix.label }}
53-
needs: prepare-release
5426
runs-on: ${{ matrix.runner }}
5527
strategy:
5628
fail-fast: false
@@ -153,11 +125,12 @@ jobs:
153125

154126
# Upload every artifact (including latest-*.yml and .blockmap files —
155127
# electron-updater needs them alongside the binaries).
128+
# The release itself (with CHANGELOG body) was already created by
129+
# release-please when the Release PR merged — we only attach assets.
156130
- name: Upload build outputs to Release
157131
uses: softprops/action-gh-release@v2
158132
with:
159133
tag_name: ${{ github.ref_name }}
160-
draft: true
161134
# GitHub Releases shows assets in reverse upload order (newest on
162135
# top). Upload the auto-updater plumbing (yml, blockmap, zip) FIRST
163136
# and the human-facing installers LAST so the download list leads
@@ -175,19 +148,3 @@ jobs:
175148
fail_on_unmatched_files: false
176149
env:
177150
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
178-
179-
publish-release:
180-
name: Publish release
181-
needs: build-desktop
182-
runs-on: ubuntu-latest
183-
steps:
184-
- uses: actions/checkout@v5
185-
186-
- name: Publish release
187-
uses: softprops/action-gh-release@v2
188-
with:
189-
tag_name: ${{ github.ref_name }}
190-
draft: false
191-
prerelease: false
192-
env:
193-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "0.2.8"
3+
}

CLAUDE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ bun install
5858

5959
See `docs/DEVELOPMENT.md` for signing env vars and artifact locations.
6060

61+
## Releases
62+
63+
Releases are driven by **[release-please](https://github.com/googleapis/release-please)** and **conventional commits**.
64+
65+
- Every commit to `main` should use a conventional prefix: `feat:`, `fix:`, `perf:`, `refactor:`, `docs:`, `chore:`, `ci:`, `build:`, `test:`, `style:`, `revert:`. Breaking changes: add `!` (`feat!:`) or a `BREAKING CHANGE:` footer.
66+
- `.github/workflows/release-please.yml` watches `main` and opens a **Release PR** that bumps `package.json`, updates `CHANGELOG.md`, and drafts the GitHub Release notes from commit messages.
67+
- Merging the Release PR pushes a `vX.Y.Z` tag → `.github/workflows/release.yml` builds the installers (macOS / Windows / Linux) and attaches them to the same release.
68+
- `electron-updater` reads release metadata for auto-updates on launch.
69+
70+
Version source of truth: `package.json` + `.release-please-manifest.json`. Never bump manually — let release-please do it.
71+
6172
## Icons
6273

6374
1. Edit canonical layer: `assets/icons/Skiller.icon/Assets/Image.png` (optionally run `python3 scripts/normalize-skiller-icon-layer.py`).

release-please-config.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"release-type": "node",
4+
"include-component-in-tag": false,
5+
"include-v-in-tag": true,
6+
"bump-minor-pre-major": true,
7+
"bump-patch-for-minor-pre-major": true,
8+
"changelog-sections": [
9+
{ "type": "feat", "section": "Features" },
10+
{ "type": "fix", "section": "Bug Fixes" },
11+
{ "type": "perf", "section": "Performance" },
12+
{ "type": "revert", "section": "Reverts" },
13+
{ "type": "docs", "section": "Documentation", "hidden": false },
14+
{ "type": "refactor", "section": "Refactors", "hidden": false },
15+
{ "type": "build", "section": "Build", "hidden": true },
16+
{ "type": "ci", "section": "CI", "hidden": true },
17+
{ "type": "chore", "section": "Chores", "hidden": true },
18+
{ "type": "style", "section": "Style", "hidden": true },
19+
{ "type": "test", "section": "Tests", "hidden": true }
20+
],
21+
"packages": {
22+
".": {
23+
"package-name": "skiller",
24+
"changelog-path": "CHANGELOG.md"
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)