-
Notifications
You must be signed in to change notification settings - Fork 564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Create Release Job #374
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: Denis <[email protected]>
Co-authored-by: Denis <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of notes:
- I think we can put all the work in a single job (under
publish
) - Getting the version of the package should be possible locally, using
npm pkg get version | xargs
orcat package.json | jq -r '.version'
. This also prevents issues when we're releasing patches for older versions, rather than just thelatest
tag.
I've made some improvements but could not quite test it well. I will double check on this tomorow or this weekend if changes are needed. |
- name: Publish to NPM | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NPM_CONFIG_PROVENANCE: true | ||
|
||
- name: Create GitHub Release | ||
run: gh release create ${{ steps.get_version.outputs.version }} --title ${{ steps.get_version.outputs.version }} --notes "Full changelog at https://github.com/JedWatson/classnames/blob/main/CHANGELOG.md" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here there is a reference to a step with the id get_version
, but looks like the package version step is missing that id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh you're right I'll fix it
- name: Publish to NPM | ||
run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
NPM_CONFIG_PROVENANCE: true | ||
|
||
- name: Create GitHub Release | ||
run: gh release create ${{ steps.get_version.outputs.version }} --title ${{ steps.get_version.outputs.version }} --notes "Full changelog at https://github.com/JedWatson/classnames/blob/main/CHANGELOG.md" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking that we might want to use the current commit rather than main
, so that the relevant notes for that release are always on top. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good I'll try to add this feature. By the way sorry for the late responses the work has been pretty heavy these few weeks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, I also maintain this stuff in my spare time, so I know the pain 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is a good idea to use the current commit as if the CHANGELOG did not get updated with that commit it would be empty so I thought linking the main branches CHANGELOG would be a better idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it is a good idea to use the current commit as if the CHANGELOG did not get updated with that commit
That's ok. I always update the changelog before release. In the future I'd like to automate this proccess also.
run: | | ||
VERSION=$(npm pkg get version | xargs) | ||
echo "Package version is $VERSION" | ||
echo "::set-output name=version::$VERSION" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
echo "::set-output name=version::$VERSION" | |
echo "name=$VERSION" >> $GITHUB_OUTPUT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch.
Related to #372
Me and @0xD3n worked on creating this pipeline.