Skip to content

Commit

Permalink
chore: change npm publish action to run on releases
Browse files Browse the repository at this point in the history
  • Loading branch information
sfelix-martins committed Oct 12, 2020
1 parent 5d4bd5d commit 8b1c3bc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 25 deletions.
37 changes: 14 additions & 23 deletions .github/workflows/npm-publish.yml
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}}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.4.0",
"version": "0.5.0",
"license": "MIT",
"main": "dist/index.js",
"files": [
Expand All @@ -9,7 +9,8 @@
"node": ">=10"
},
"scripts": {
"build": "tsc"
"build": "tsc",
"prepare": "tsc"
},
"peerDependencies": {},
"prettier": {
Expand Down

0 comments on commit 8b1c3bc

Please sign in to comment.