Skip to content

Commit e5f1914

Browse files
authored
chore: add release workflows (#45)
* chore: add release workflows * docs: clarify GitHub Releases are not automated
1 parent 0ddf8ad commit e5f1914

4 files changed

Lines changed: 160 additions & 27 deletions

File tree

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Publish Alpha
2+
3+
on:
4+
workflow_dispatch:
5+
6+
concurrency: ${{ github.workflow }}
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
publish-alpha:
13+
name: Publish Alpha
14+
runs-on: ubuntu-latest
15+
environment: npm
16+
steps:
17+
- name: Checkout Repo
18+
uses: actions/checkout@v6
19+
20+
- name: Setup pnpm
21+
uses: pnpm/action-setup@v6
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v6
25+
with:
26+
node-version: 24
27+
cache: pnpm
28+
registry-url: https://registry.npmjs.org
29+
30+
- name: Install Dependencies
31+
run: pnpm install --frozen-lockfile
32+
33+
- name: Validate npm token
34+
run: |
35+
if [ -z "${NPM_TOKEN:-}" ]; then
36+
echo "::error::NPM_TOKEN secret is required for publishing."
37+
exit 1
38+
fi
39+
env:
40+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
41+
42+
- name: Test
43+
run: pnpm test
44+
45+
- name: Typecheck
46+
run: pnpm typecheck
47+
48+
- name: Build
49+
run: pnpm build
50+
51+
- name: Lint
52+
run: pnpm lint
53+
54+
- name: Pack Check
55+
run: pnpm pack:check
56+
57+
- name: Configure npm auth
58+
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > "$HOME/.npmrc"
59+
env:
60+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
61+
62+
- name: Publish Alpha
63+
run: pnpm release:alpha
64+
env:
65+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
66+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Version Packages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
permissions:
11+
contents: write
12+
pull-requests: write
13+
14+
jobs:
15+
version:
16+
name: Version Packages
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout Repo
20+
uses: actions/checkout@v6
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v6
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v6
27+
with:
28+
node-version: 24
29+
cache: pnpm
30+
31+
- name: Install Dependencies
32+
run: pnpm install --frozen-lockfile
33+
34+
- name: Create Version Packages PR
35+
uses: changesets/action@v2
36+
with:
37+
version: pnpm version:packages
38+
title: "chore: version packages"
39+
commit: "chore: version packages"
40+
env:
41+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Current limitations include:
276276
* No backend persistence yet
277277
* No real resource cache policy yet
278278
* No DevTools package yet
279-
* No automated publish workflow yet (Changesets is configured, release workflow pending)
279+
* Automated version PR workflow and manual publish workflow are set up (Changesets configured)
280280
* Demo side panels use manual DOM
281281
* Demo diagnostics panel uses `MutationObserver`
282282
* Demo data is in memory only

docs/Release-Readiness.md

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Intent is in early experimental development. No packages have been published to npm. No GitHub Releases have been created.
66

7-
The repository has five workspace packages under `packages/*`. The four publishable packages are at version `0.1.0-alpha.0`. The private server package remains at `0.1.0`. All use `workspace:*` dependency references. The codebase is functional and validated by CI. Changesets is installed and configured. The remaining blocker before a first alpha release is the release workflow and npm publish automation.
7+
The repository has five workspace packages under `packages/*`. The four publishable packages are at version `0.1.0-alpha.0`. The private server package remains at `0.1.0`. All use `workspace:*` dependency references. The codebase is functional and validated by CI. Changesets is installed and configured. Release workflows exist for automated version PRs and manual alpha publishing.
88

99
Four packages are intended for first-alpha publishing. `packages/server` is a private workspace package for now.
1010

@@ -179,23 +179,28 @@ The `files` field in every package is `["dist"]`. Based on `npm pack --dry-run`
179179

180180
No unnecessary files (source maps, config files, tests, node_modules) leak into the tarball. The `files` policy is correct.
181181

182-
## Release workflow recommendation
182+
## Release workflows
183183

184-
### Use Changesets
184+
### Version Packages PR workflow
185185

186-
[Changesets](https://github.com/changesets/changesets) is recommended for:
186+
A Changesets-based [version-packages.yml](../.github/workflows/version-packages.yml) workflow runs on pushes to `main`:
187187

188-
- Version bumping (independent versioning per package)
189-
- Changelog generation per package
190-
- Coordinated publishing across the workspace
188+
1. Checks out the repository
189+
2. Installs dependencies
190+
3. Runs `pnpm version:packages` via `changesets/action`
191+
4. Opens or updates a "Version Packages" PR when changeset files are present
191192

192-
### Recommended GitHub Action
193+
This workflow does **not** publish to npm. It only manages the version PR.
193194

194-
Add a Changeset-based GitHub Action (e.g., `changesets/action`) that:
195+
### Manual Publish Alpha workflow
195196

196-
1. Runs on pushes to `main`
197-
2. Opens or updates a "Version Packages" PR when changeset files are present
198-
3. Publishes to npm when the version PR is merged
197+
A [publish-alpha.yml](../.github/workflows/publish-alpha.yml) workflow exists for publishing:
198+
199+
- **Trigger**: manual only (`workflow_dispatch`)
200+
- **Environment**: requires the `npm` GitHub environment
201+
- **Pre-publish validation**: test, typecheck, build, lint, pack:check
202+
- **Publish command**: `pnpm release:alpha` (builds, runs pack check, then `changeset publish --tag alpha`)
203+
- **npm auth**: configured at runtime via `NODE_AUTH_TOKEN`; no committed `.npmrc` file
199204

200205
### Publish cadence
201206

@@ -229,22 +234,25 @@ Do not manually create GitHub Releases.
229234
- [x] MIT confirmed as intended public license
230235
- [x] Confirm package metadata (`repository` field in all packages)
231236
- [x] Server is private — not a publishing blocker
232-
- [x] Package exports point to correct `dist/` paths
233-
- [x] Package `files: ["dist"]` is correct
234-
- [x] Declaration files (`dist/index.d.ts`) exist after build
237+
- [x] Confirm package exports (all point to correct `dist/` paths)
238+
- [x] Confirm package files (`files: ["dist"]`)
239+
- [x] Confirm declaration files (`dist/index.d.ts` exists)
235240
- [x] Clean-dist validation passes
236-
- [x] `pnpm pack:check` passes
237241
- [x] Changesets installed and configured
238-
- [x] First alpha package versions set to `0.1.0-alpha.0`
239-
- [ ] Add release workflow (GitHub Action for Changesets)
240-
- [ ] Publish first alpha (`pnpm changeset publish`)
241-
- [ ] Create GitHub Release (automatic via Changesets, or manual)
242+
- [x] Release workflows added:
243+
- Version Packages PR workflow (push-to-main)
244+
- Manual Publish Alpha workflow (manual dispatch only)
245+
- [ ] NPM_TOKEN secret added to GitHub repository secrets
246+
- [ ] Publish first alpha via manual Publish Alpha workflow
247+
- [ ] Optionally create a GitHub Release manually after npm publish
242248

243249
## Current blockers
244250

245-
- repository fields are present
246-
- GitHub repository home is https://github.com/intent-framework/intent
247-
- remaining first-alpha blocker after this PR: Release workflow not yet added, including npm publish automation and required secrets.
251+
- repository fields: present
252+
- GitHub repository home: `intent-framework/intent`
253+
- Changesets: installed and configured
254+
- Release workflows: version-packages.yml (automated version PRs) and publish-alpha.yml (manual publish) are added
255+
- Remaining first-alpha blocker: add `NPM_TOKEN` secret, then manually run Publish Alpha
248256

249257
## Future server-package decisions
250258

@@ -253,12 +261,30 @@ Do not manually create GitHub Releases.
253261

254262
## Do not do yet
255263

256-
- Do not publish any package to npm.
257-
- Do not create a GitHub Release.
258-
- Do not add a release GitHub Action yet.
264+
- Do not publish any package to npm until the manual Publish Alpha workflow is triggered.
265+
- Do not create a GitHub Release yet. The current manual Publish Alpha workflow publishes npm packages only. GitHub Releases are not automated yet.
259266
- Do not change runtime or public APIs.
260267
- Do not add new dependencies unless required for a specific task.
261268

269+
## Required secret: NPM_TOKEN
270+
271+
Before running the Publish Alpha workflow, a GitHub Actions secret must be added:
272+
273+
| Secret | Purpose |
274+
|---|---|
275+
| `NPM_TOKEN` | npm access token with publish permission for `@intent-framework/*` packages |
276+
277+
The token must:
278+
- Have **publish** permission for the `@intent-framework` npm organization
279+
- Be stored as a GitHub Actions secret (not in the repository)
280+
- Be configured in the `npm` GitHub environment used by the Publish Alpha workflow
281+
282+
Do not commit the token value to the repository.
283+
284+
### Future improvement: trusted publishing
285+
286+
Migrate npm publishing to trusted publishing / OIDC once the initial package publishing flow is stable.
287+
262288
## Pack check command
263289

264290
The root `pack:check` command:

0 commit comments

Comments
 (0)