Add NPM publishing#2
Conversation
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:
|
| - 'v*' | ||
|
|
||
| permissions: | ||
| id-token: write # Required for OIDC publishing |
There was a problem hiding this comment.
@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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
reverted in the latest force push
| "start": "node dist/index.js", | ||
| "test": "vitest run", | ||
| "test:watch": "vitest", | ||
| "prepublishOnly": "npm run build" |
There was a problem hiding this comment.
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)
9b05f64 to
d2a6b43
Compare
-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)
d2a6b43 to
c30a512
Compare
This PR updates the existing
publishGitHub Action to publish the package to NPM when a version tag is pushed.Closes ENG-9060