chore: update to OIDC publishing#1709
Conversation
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 18.x | ||
| - name: Publish Caliper |
There was a problem hiding this comment.
I'd add these explicit steps (taken from the official docs at https://docs.npmjs.com/trusted-publishers#github-actions-configuration) before the "Publish Caliper" step, so we're sure that we have the required npm version (I couldn't find what npm version comes with 18.x when using setup-node):
# Ensure npm 11.5.1 or later is installed
- name: Update npm
run: npm install -g npm@latest
- run: npm ci
- run: npm run build --if-present
- run: npm test
- run: npm publish
# rest is unchanged
- name: Publish CaliperThere was a problem hiding this comment.
does this look good now?
There was a problem hiding this comment.
@ryjones I think the new block should go between L27-28 (according to the current commit, L15-16 in the previous version), just after the setup-node step
277380e to
fd8fbed
Compare
aklenik
left a comment
There was a problem hiding this comment.
@ryjones The structure seems okay now, but I also copied some unnecessary steps in the example, when we only need the npm update step.
The whole steps section should look like this (don't want to mess with your commit directly as a reviewer, I don't know how that would affect the PR workflow):
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
# anchor to the smallest npm version supporting trusted publishing
- name: Update npm
run: npm install -g npm@11.5.1
- name: Publish Caliper
run: .build/publish-caliper.shSigned-off-by: Ry Jones <ry@linux.com>
Checklist
This is to update from token publishing to OIDC publishing.
Issue/User story
Steps to Reproduce
Existing issues
Design of the fix
Validation of the fix
Automated Tests
What documentation has been provided for this pull request