-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ci): automate publishing npm package
- Loading branch information
1 parent
096e1fe
commit 8e8675f
Showing
2 changed files
with
32 additions
and
0 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,31 @@ | ||
name: Publish npm package | ||
|
||
on: | ||
push: | ||
tags: [ 'v*' ] | ||
|
||
|
||
jobs: | ||
publish-npm: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '20.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Place tag in environment | ||
run: | | ||
echo "SOURCE_TAG=${GITHUB_REF:10}" >> $GITHUB_ENV | ||
- name: Setting package.json version | ||
run: npm version --no-git-tag-version "${SOURCE_TAG#v}" | ||
|
||
- run: npm install | ||
|
||
- run: npm publish | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
**/test/ | ||
**/.vscode/ | ||
.github/** | ||
.eslintrc.json |