chore: add a new workflow for npm publish with trusted publishing#14661
chore: add a new workflow for npm publish with trusted publishing#14661sarayev wants to merge 1 commit intoaws-amplify:mainfrom
Conversation
a70c63c to
f8969fa
Compare
osama-rizk
left a comment
There was a problem hiding this comment.
Can you please add more information about testing/verifying thees changes?
It is close to impossible to test this without merging the changes first, and verifying them as part of the 'normal' release we make to the NPM. As the test will follow in this way: As NPM requires the worklfow to be present, and it will only allow to publish from aws-amplify/amplify-js repo, it is not straight-forward to test it with forks. |
| - name: Setup node and build the repository | ||
| uses: ./amplify-js/.github/actions/node-and-build | ||
|
|
||
| - name: Authenticate with npm (trusted publishers) |
There was a problem hiding this comment.
Maybe I am misunderstanding something. Why are we still manually handling tokens via NPM_TOKEN? I thought that trusted publishers would allow us to register callable-npm-publish-trusted.yml with NPM and GitHub would automatically verify our call via an oidc token. This is done by setting id-token: write permissions.
Also I am not able to tell where the NPM_TOKEN is supposed to be coming from here. I fear that we would always run in the else branch, resulting in an error. If I am understanding this correctly, we would therefore need to remove the npm-auth step and also update ./amplify-js/.github/actions/npm-publish to not require npm_token anymore.
Description of changes
Adding a new workflow to onboard the amplify-js packages to trusted publishing from npm, following the onboarding guide here.
Issue #, if available
Description of how you validated changes
It is close to impossible to test this without merging the changes first, and verifying them as part of the 'normal' release we make to the NPM. As the test will follow in this way:
As NPM requires the worklfow to be present, and it will only allow to publish from aws-amplify/amplify-js repo, it is not straight-forward to test it with forks.
Checklist
yarn testpassesChecklist for repo maintainers
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.