Skip to content

Commit 22aa3e5

Browse files
authored
Add GitHub Actions release workflow (#64)
## Summary - Add a GitHub Actions workflow to automate CLI releases on tag push - Update DEVELOPMENT.md with simplified release instructions - Release process is now: just push a version tag (e.g., `git tag -a v1.2.3 -m "Version 1.2.3" && git push origin v1.2.3`) ## Required Secrets Before using, configure these secrets in the repository settings: | Secret | Description | |--------|-------------| | `GORELEASER_KEY` | GoReleaser Pro license key (in 1pw) | | `NPM_TOKEN` | npm access token for publishing `@onkernel/cli` (in 1pw) | | `HOMEBREW_TAP_TOKEN` | GitHub PAT with write access to `onkernel/homebrew-tap` repo | ## What the workflow does 1. Triggers on push of `v*` tags 2. Checks out code with full history 3. Sets up Go and Node.js 4. Runs `make clean-templates` to remove node_modules/.venv from templates 5. Runs goreleaser-pro to: - Build binaries for darwin/linux/windows × amd64/arm64 - Create GitHub release with changelog - Publish to npm as `@onkernel/cli` - Commit updated Homebrew formula to `onkernel/homebrew-tap` ## Test plan - [ ] Add the required secrets to the repository - [ ] Push a test tag to verify the workflow runs successfully - [ ] Verify GitHub release is created - [ ] Verify npm package is published - [ ] Verify Homebrew formula is updated in the tap repo <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Automates CLI releases via GitHub Actions and updates docs accordingly. > > - Adds `./.github/workflows/release.yaml` to trigger on `v*` tags, set up Go/Node, clean templates, and run `goreleaser-pro` with `GH_PAT`, `GORELEASER_KEY`, and `NPM_TOKEN` > - Rewrites `DEVELOPMENT.md` to document tag-based releases, required secrets, and optional local dry-run > - Removes legacy `scripts/release.sh` manual tagging/release script > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 2164fc0. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 54e5e2a commit 22aa3e5

File tree

3 files changed

+76
-34
lines changed

3 files changed

+76
-34
lines changed

.github/workflows/release.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release CLI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up Go
21+
uses: actions/setup-go@v5
22+
with:
23+
go-version-file: "go.mod"
24+
cache: true
25+
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '20'
30+
registry-url: 'https://registry.npmjs.org'
31+
32+
- name: Clean templates
33+
run: make clean-templates
34+
35+
- name: Run GoReleaser
36+
uses: goreleaser/goreleaser-action@v6
37+
with:
38+
distribution: goreleaser-pro
39+
version: '~> v2'
40+
args: release --clean
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
43+
GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
44+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

DEVELOPMENT.md

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,26 +58,45 @@ A typical workflow we encounter is updating the API and integrating those change
5858

5959
### Releasing a new version
6060

61-
Prerequisites:
61+
Releases are automated via GitHub Actions. Simply push a version tag and the release workflow will handle the rest.
6262

63-
- Make sure you have **goreleaser-pro** installed via `brew install --cask goreleaser/tap/goreleaser-pro`. You will need a license key (in 1pw), and then `export GORELEASER_KEY=<the key>`. **Note: goreleaser-pro is required, not the standard goreleaser version.**
63+
#### To release:
6464

65-
- Grab the NPM token for our org (in 1pw) and run `npm config set '//registry.npmjs.org/:_authToken'=<the token>`
65+
```bash
66+
# Find the latest version
67+
git describe --abbrev=0
6668

67-
- export a `GITHUB_TOKEN` with repo and write:packages permissions: https://github.com/settings/tokens/new?scopes=repo,write:packages.
69+
# Create and push a new tag (bump version following https://semver.org/)
70+
git tag -a v<VERSION> -m "Version <VERSION>"
71+
git push origin v<VERSION>
72+
```
6873

69-
With a clean tree on the branch you want to release (can be main or a pr branch you're about to merge, doesn't matter), run:
74+
The release workflow will automatically:
75+
- Build binaries for darwin, linux, and windows (amd64 and arm64)
76+
- Create a GitHub release with changelog
77+
- Publish to npm as `@onkernel/cli`
78+
- Update the Homebrew formula in `onkernel/homebrew-tap`
7079

71-
```bash
72-
make release-dry-run
73-
```
80+
#### Required GitHub Secrets
7481

75-
This will check that everything is working, but not actually release anything.
76-
You should see one error about there not being a git tag, and that's fine.
82+
The following secrets must be configured in the repository settings:
7783

78-
To actually release, run:
84+
| Secret | Description |
85+
|--------|-------------|
86+
| `GH_PAT` | GitHub Personal Access Token with `repo` scope. Must have write access to both this repository (for creating releases) and `onkernel/homebrew-tap` (for updating the Homebrew formula). Create at https://github.com/settings/tokens/new?scopes=repo |
87+
| `GORELEASER_KEY` | GoReleaser Pro license key (required for npm and homebrew publishing) |
88+
| `NPM_TOKEN` | npm access token for publishing `@onkernel/cli` |
89+
90+
#### Local dry-run (optional)
91+
92+
To test the release process locally before pushing a tag:
93+
94+
Prerequisites:
95+
- Install **goreleaser-pro** via `brew install --cask goreleaser/tap/goreleaser-pro`
96+
- Export `GORELEASER_KEY=<license key from 1pw>`
7997

8098
```bash
81-
# use `git describe --abbrev=0` to find the latest version and then bump it following https://semver.org/
82-
./scripts/release.sh <version> [description]
99+
make release-dry-run
83100
```
101+
102+
This will check that everything is working without actually releasing anything.

scripts/release.sh

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

0 commit comments

Comments
 (0)