Skip to content

Add NPM publishing#2

Merged
mikesellitto merged 3 commits into
mainfrom
mike/add-npm-publishing
Feb 4, 2026
Merged

Add NPM publishing#2
mikesellitto merged 3 commits into
mainfrom
mike/add-npm-publishing

Conversation

@mikesellitto

Copy link
Copy Markdown
Contributor

This PR updates the existing publish GitHub Action to publish the package to NPM when a version tag is pushed.

Closes ENG-9060

@linear

linear Bot commented Feb 4, 2026

Copy link
Copy Markdown
ENG-9060 Add GH actions workflow to build+publish package

This workflow will be triggered on the "push tags" event similar to the TF provider, which will enable us to cut versions using the "releases" interface within GitHub. This process should:

  • Replace the version in ~~package.json~~ with the version in the tag, and set ~~private: false~~.
  • Fetch the latest OpenAPI spec to include in the published package.
  • Transpile all typescript.
  • Run a minimal test to ensure that the application can actually start up using this OpenAPI spec.
  • Publish the package to NPM.
    • The credential will be stored in GitHub Actions and available to the workflow, the name of that secret is TBD.

- 'v*'

permissions:
id-token: write # Required for OIDC publishing

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@emily-curry The ticket mentions something like "the credential secret will be available to the workflow" so I take we're using an access token as opposed to OIDC. If we are instead using OIDC I'll add this back and remove the NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }} below

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We are using OIDC, npm doesn't allow for long-lived access tokens so we don't want to be generating them all the time. I've already set up the trust relationship between this repo and our account.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

reverted in the latest force push

Comment thread package.json
"start": "node dist/index.js",
"test": "vitest run",
"test:watch": "vitest",
"prepublishOnly": "npm run build"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

note to reviewers: We don't need this prepublish build anymore since the action runs npm run build before the smoke test (node dist/index.js --help)

@mikesellitto
mikesellitto force-pushed the mike/add-npm-publishing branch from 9b05f64 to d2a6b43 Compare February 4, 2026 17:53
-Enables publishing to NPM on version tags (v*)
-Removes `prepublishOnly` script since `build` is handled in the
workflow
This reflects how we currently document this in other packages (i.e.
terraform provider)
@mikesellitto
mikesellitto force-pushed the mike/add-npm-publishing branch from d2a6b43 to c30a512 Compare February 4, 2026 17:54
@mikesellitto
mikesellitto merged commit 17ba18a into main Feb 4, 2026
2 checks passed
@mikesellitto
mikesellitto deleted the mike/add-npm-publishing branch February 4, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants