-
Notifications
You must be signed in to change notification settings - Fork 565
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ permissions: | |
|
||
jobs: | ||
publish: | ||
name: Publish package to NPM | ||
name: Publish package to NPM and Create GitHub Release | ||
runs-on: ubuntu-latest | ||
environment: release | ||
|
||
|
@@ -26,8 +26,19 @@ jobs: | |
cache: npm | ||
registry-url: https://registry.npmjs.org | ||
|
||
- name: Get package version | ||
run: | | ||
VERSION=$(npm pkg get version | xargs) | ||
echo "Package version is $VERSION" | ||
echo "::set-output name=version::$VERSION" | ||
|
||
- 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 commentThe reason will be displayed to describe this comment to others. Learn more. Here there is a reference to a step with the id There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh you're right I'll fix it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thinking that we might want to use the current commit rather than There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more.
That's ok. I always update the changelog before release. In the future I'd like to automate this proccess also. |
||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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.
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
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.