Skip to content

Commit a5f136e

Browse files
committed
ci: add trusted npm publish workflow
1 parent 4b788b3 commit a5f136e

3 files changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: read
10+
id-token: write
11+
12+
jobs:
13+
npm:
14+
runs-on: ubuntu-latest
15+
if: github.repository == 'Dmatut7/codex-flow'
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- name: Setup Node
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 22
24+
cache: npm
25+
registry-url: https://registry.npmjs.org
26+
27+
- name: Install
28+
run: npm ci
29+
30+
- name: Verify tag matches package version
31+
run: |
32+
TAG_VERSION="${GITHUB_REF_NAME#v}"
33+
PKG_VERSION="$(node -p "require('./package.json').version")"
34+
test "$TAG_VERSION" = "$PKG_VERSION"
35+
36+
- name: Typecheck
37+
run: npm run typecheck
38+
39+
- name: Test
40+
run: npm test
41+
42+
- name: Publish to npm
43+
run: npm publish --access public

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
- Added GitHub Actions npm Trusted Publishing workflow so tagged releases can publish without local npm tokens or OTP.
6+
37
## 0.2.4 — 2026-06-05
48

59
- Added the `parallel-fix` Codex skill and example workflow for proposing independent fixes concurrently, then integrating and verifying serially.

tests/cli.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,15 @@ describe("codex-flow cli", () => {
7171
assert.ok(tsconfig.include?.includes("cli/**/*.ts"), "tsconfig include should cover cli/**/*.ts");
7272
});
7373

74+
it("release workflow is configured for npm trusted publishing", async () => {
75+
const workflow = await readFile(path.join(repoRoot, ".github", "workflows", "publish.yml"), "utf8");
76+
77+
assert.match(workflow, /on:\s*\n\s+push:\s*\n\s+tags:\s*\n\s+- ['"]v\*['"]/);
78+
assert.match(workflow, /id-token:\s*write/);
79+
assert.match(workflow, /npm publish --access public/);
80+
assert.doesNotMatch(workflow, /NODE_AUTH_TOKEN|NPM_TOKEN|_authToken/);
81+
});
82+
7483
it("smoke tells codex-sdk users to use membership login instead of an API key", () => {
7584
const hint = unavailableHint("codex-sdk");
7685
assert.match(hint, /Codex membership/i);

0 commit comments

Comments
 (0)