-
Notifications
You must be signed in to change notification settings - Fork 2
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 #34 from rwillians/gha-publish
Moving off TravisCI: Add publish workflow
- Loading branch information
Showing
3 changed files
with
35 additions
and
3 deletions.
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,32 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
publish: | ||
name: Publish package | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: 18 | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- name: Tag matches package's and package-lock's version | ||
run: | | ||
node -e "const tag = process.env.GITHUB_REF.replace('refs/tags/v', ''); process.exit(require('./package.json').version === tag && require('./package-lock.json').version === tag ? 0 : 1);" | ||
- name: Prepare package for publishing | ||
run: | | ||
npm install | ||
npm run build | ||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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