Skip to content

ci: publish npm releases directly instead of via Speakeasy - #1248

Draft
LukasParke wants to merge 2 commits into
mainfrom
chore/first-party-publish
Draft

LukasParke wants to merge 2 commits into
mainfrom
chore/first-party-publish

Conversation

@LukasParke

Copy link
Copy Markdown
Contributor

Summary

Replaces speakeasy-api/sdk-generation-action/.github/workflows/sdk-publish.yaml@v15 with a workflow in this repo that publishes @openrouter/sdk to npm and creates the GitHub release itself.

When .speakeasy/gen.lock changes on main, the job:

  1. Reads releaseVersion from gen.lock and checks it matches package.json.
  2. Skips publishing if that version is already on npm. Otherwise it runs pnpm install --frozen-lockfile --ignore-scripts, then npm publish on Node 24. prepublishOnly runs the build, and provenance comes from publishConfig. Prerelease versions are published under the prerelease dist-tag, as before.
  3. Creates the v<version> GitHub release, unless it already exists.

The workflow keeps name: Publish, so dispatch-agent-bump.yaml and dispatch-monorepo-sdk-bump.yaml still fire when it succeeds.

Side fix

Speakeasy's job checks out its own repo into _speakeasy/, inside this package directory. As a result, the published @openrouter/sdk@1.5.2 contains _speakeasy/.github/action-inputs-config.json and _speakeasy/.github/action-security-config.json. Those files are no longer published.

What changes compared with Speakeasy's publish workflow

  • Same as before: file name and workflow name: (openrouter-web's sdk-publish-health.yaml looks this file up by name), triggers, the v<version> tag on the merge commit, the <lang> - v<version> - <UTC timestamp> release title, and release notes built from gen.lock's releaseNotes.
  • Better: publishing is now safe to re-run. It checks the registry and skips a version that is already published, and the release step skips a release that already exists. It also fails early if gen.lock's releaseVersion doesn't match the package manifest. It no longer runs Speakeasy's Docker action, and the publish job doesn't need SPEAKEASY_API_KEY.
  • Dropped: the publish events Speakeasy's dashboard received, the Publishing Completed marker Speakeasy appended to release notes, and the published tag Speakeasy added in its registry for the source and code samples. The main registry tag is still applied by tagging.yaml. If any Speakeasy docs or code-sample setup depends on published, that needs a separate speakeasy tag step.

Generation (sdk_generation*.yaml) and registry tagging (tagging.yaml) still use speakeasy-api/sdk-generation-action. This PR only changes publishing.

Testing

  • actionlint passes.
  • Ran the version and release-notes steps locally against the current gen.lock (1.5.2), and checked that npm view detects an existing version.
  • pnpm install --frozen-lockfile --ignore-scripts && npm publish --dry-run builds 2,623 files, 5.8 MB unpacked. That equals the published 1.5.2 tarball minus the two _speakeasy/ files.
  • Not run in CI yet. The first real run will be the next regen merge, or a manual workflow_dispatch, which should skip both steps because 1.5.2 is already published.

Follow-up (optional)

id-token: write is granted, so npm trusted publishing can be turned on by configuring this repo and workflow as a trusted publisher on npmjs.com. After that, NPM_TOKEN can be removed.

🤖 Generated with Claude Code

LukasParke and others added 2 commits October 22, 2026 23:07
Replace speakeasy-api/sdk-generation-action's sdk-publish.yaml reusable
workflow with an in-repo job that reads releaseVersion from gen.lock,
publishes (skipping versions already released), and creates the
v<version> GitHub release. Generation still uses Speakeasy.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@LukasParke
LukasParke force-pushed the chore/first-party-publish branch from 62a9c4f to b9a435d Compare October 22, 2026 23:07

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant