-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from testomatio/upd-publish-job
update publishing job to be trigerred by release
- Loading branch information
Showing
5 changed files
with
31 additions
and
46 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,28 @@ | ||
name: Publish to npm | ||
on: | ||
release: | ||
types: [published] | ||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.release.target_commitish }} | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 16 | ||
- run: npm i | ||
- run: git config --global user.name "GitHub CD bot" | ||
- run: git config --global user.email "github-cd-bot@example.com" | ||
- run: npm version ${{ github.event.release.tag_name }} | ||
- uses: JS-DevTools/npm-publish@v1 | ||
with: | ||
token: ${{ secrets.NPM_TOKEN }} | ||
# use "beta" tag if relevant, otherwise use "latest" | ||
tag: ${{ contains(github.event.release.tag_name, 'beta') && 'beta' || 'latest' }} | ||
|
||
# push the version changes to GitHub | ||
- run: git push | ||
env: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} |
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
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