Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Release

on:
push:
tags:
- "v*"

permissions:
contents: read
id-token: write

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First publish impossible via OIDC

High Severity

The workflow authenticates only via trusted publishing OIDC and never wires NODE_AUTH_TOKEN / NPM_TOKEN. npm still cannot publish the initial version of a package that does not exist yet over OIDC, and this package is not on npm, so the first release cannot succeed.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0fead09. Configure here.


concurrency:
group: release-${{ github.ref_name }}
cancel-in-progress: false

jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Verify tag is on main
run: |
git fetch origin main:refs/remotes/origin/main
git merge-base --is-ancestor "$GITHUB_SHA" origin/main

- uses: actions/setup-node@v5
with:
node-version: 24
registry-url: https://registry.npmjs.org

- name: Ensure npm supports trusted publishing
run: npm install -g npm@^11.5.1

- run: npm ci

- name: Verify package version matches tag
run: |
node --input-type=module <<'EOF'
import { readFileSync } from "node:fs";

const tag = process.env.GITHUB_REF_NAME;
const prefix = "v";
if (!tag?.startsWith(prefix)) {
throw new Error(`Expected tag to start with ${prefix}, got ${tag}`);
}

const tagVersion = tag.slice(prefix.length);
const pkg = JSON.parse(readFileSync("package.json", "utf8"));
if (pkg.version !== tagVersion) {
throw new Error(`Tag version ${tagVersion} does not match ${pkg.name} package.json version ${pkg.version}`);
}

console.log(`${pkg.name}@${pkg.version}`);
EOF

- run: npm run build
- run: npm run typecheck

- name: Pack tarball
run: npm pack --pack-destination "$RUNNER_TEMP"

- name: ESM import smoke test
run: |
SMOKE_DIR=$(mktemp -d)
cd "$SMOKE_DIR"
npm init -y > /dev/null
npm install "$RUNNER_TEMP"/onkernel-eve-extension-*.tgz eve@^0.25
node --input-type=module -e "import('@onkernel/eve-extension').then((m) => { if (typeof m.default !== 'function') process.exit(1); })"

- name: Publish to npm
run: npm publish --access public

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OIDC publish blocked by registry-url

High Severity

The actions/setup-node step, when configured with registry-url, writes an .npmrc entry for _authToken using an unset NODE_AUTH_TOKEN. This empty token entry then takes precedence, preventing npm's OIDC trusted publishing from engaging, which causes npm publish to fail with ENEEDAUTH.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0fead09. Configure here.

Loading