-
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.
chore: change npm publish action to run on releases
- Loading branch information
1 parent
5d4bd5d
commit 8b1c3bc
Showing
2 changed files
with
17 additions
and
25 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 |
---|---|---|
@@ -1,28 +1,19 @@ | ||
name: npm-publish | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- master # Change this to your default branch | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
npm-publish: | ||
name: npm-publish | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@master | ||
- name: Set up Node.js | ||
uses: actions/setup-node@master | ||
- uses: actions/checkout@v1 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 10.0.0 | ||
- name: Build project | ||
run: npm run build | ||
- name: Publish if version has been updated | ||
uses: pascalgn/npm-publish-action@06e0830ea83eea10ed4a62654eeaedafb8bf50fc | ||
with: # All of theses inputs are optional | ||
tag_name: 'v%s' | ||
tag_message: 'v%s' | ||
commit_pattern: "^chore(release): (\\S+)" | ||
workspace: '.' | ||
env: # More info about the environment variables in the README | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Leave this as is, it's automatically generated | ||
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} # You need to set this in your repo settings | ||
node-version: 12 | ||
registry-url: https://registry.npmjs.org/ | ||
- run: yarn install | ||
- run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_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