feat(release): move npm publish to github actions#5464
Conversation
02e3f01 to
de4e600
Compare
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| run: | | ||
| TAG=$([ "$GITHUB_REF_NAME" = "master" ] && echo latest || echo "$GITHUB_REF_NAME") |
There was a problem hiding this comment.
How do we ensure that we only release using winter*/spring*/summer* tags, and we don't accidentally release a tag called rave/github-action-publish?
How do we ensure that only repo maintainers can trigger the workflow?
There was a problem hiding this comment.
Added a conditional for branch validation.
How do we ensure that only repo maintainers can trigger the workflow?
This should help with only lwc-admin members should be able to approve workflow run requests.
.github/workflows/release.yml
Outdated
| node -e " | ||
| const fs=require('fs'); | ||
| const semver=require('semver'); | ||
| const current=JSON.parse(fs.readFileSync('package.json','utf8')).version; | ||
| const next=process.env.INPUT_VERSION; | ||
| if(!semver.valid(next)) { console.error('Invalid semver: '+next); process.exit(1); } | ||
| if(!semver.gt(next,current)) { console.error(`Version ${next} must be greater than current ${current}`); process.exit(1); } | ||
| " |
There was a problem hiding this comment.
Would it be possible to restrict the release to our specific release branches? eg, summer*, winter*, spring*, master?
Is that something we can do in the GHA UI?
There was a problem hiding this comment.
Added a condition to release job to only be able to run from specified branches and non-fork repos.
wjhsf
left a comment
There was a problem hiding this comment.
We can also remove scripts/release/*.sh, because they're no longer necessary.
Co-authored-by: Will Harney <62956339+wjhsf@users.noreply.github.com>
Details
Remove nucleus config and move the npm publish to a manually triggered release action which takes a semantic version as user input.
Does this pull request introduce a breaking change?
Does this pull request introduce an observable change?
GUS work item
W-16628948