-
Notifications
You must be signed in to change notification settings - Fork 14
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
Added action to publish to npm on release #175
Merged
Merged
Changes from 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
5907da9
Added action to publish to npm on release
samhotep 642e5c7
Test publish
samhotep 462b985
Fix build file path
samhotep c0db753
Merge into a single file
samhotep 1715d65
Use node 12 to publish
samhotep ff58800
Use separate node versions for build and publish
samhotep f91179f
Specify npm URL
samhotep 388d833
Update .github/workflows/publish-on-release.yml
samhotep 34ff543
Only publish on event
samhotep ea4ff22
Update .github/workflows/publish-on-release.yml
samhotep 30144ca
Bump version to 3.6.3
samhotep File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Publish Cookie Policy release | ||
|
||
# Only for testing. Should be on: release: types: [published] | ||
on: | ||
- push | ||
|
||
jobs: | ||
build-and-publish: | ||
name: Publish Cookie Policy to NPM | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Build Cookie Policy | ||
run: | | ||
yarn install | ||
yarn build | ||
yarn test | ||
- if: ${{ !github.event.release.prerelease }} | ||
run: npm publish | ||
samhotep marked this conversation as resolved.
Show resolved
Hide resolved
|
||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
- if: ${{ github.event.release.prerelease }} | ||
run: npm publish --tag next --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not sure if we want that yet, but could make sense to simply publish on every merge to main branch?
This would not create a release tag on GH (unless we can make it automated as well), but may be a nice next step in automating this, instead of relying on manual release.
This is the way we have it set up for our python packages that publish to pip, and in react components I think.
In Vanilla we want more manual control, so we tie it to GH release functionality. But here it probably will make it easier for everyone if it's fully automatic.
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.
Like here: https://github.com/canonical/canonicalwebteam.flask-base/blob/main/.github/workflows/publish.yaml
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 agree on the automation, and there should a way to create the release tag. In fact, we could
on merge to main.
I think this works for now though, and I can make another PR to set up the merge to main actions.