Skip to content

Commit

Permalink
chore(package.json): add semantic release and npm publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio Tetsuo committed Jun 12, 2020
1 parent a09375a commit ef7987a
Show file tree
Hide file tree
Showing 3 changed files with 2,954 additions and 100 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test and Publish package

on:
push:
branches:
- master

jobs:
build:
name: Testing and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout to git branch
uses: actions/checkout@v1
- name: Setup node environment
uses: actions/setup-node@v1
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- name: Install all dependencies
run: yarn
- name: Run validations
run: yarn validate
- name: Publish package
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
run: npm run semantic-release
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
"files": [
"dist"
],
"publishConfig": {
"access": "public",
"branches": [
"master"
]
},
"scripts": {
"lint": "eslint .",
"prebuild": "rimraf dist",
Expand All @@ -27,7 +33,8 @@
"prettier": "prettier --ignore-path .gitignore \"**/*.+(js|json)\" \"!package.json\"",
"format": "yarn run prettier --write",
"check-format": "yarn run prettier --list-different",
"validate": "npm-run-all --parallel check-format lint build"
"validate": "npm-run-all --parallel check-format test build",
"semantic-release": "semantic-release"
},
"dependencies": {
"jest": "^26.0.1",
Expand All @@ -44,6 +51,7 @@
"npm-run-all": "^4.1.5",
"prettier": "^2.0.5",
"rimraf": "^3.0.2",
"semantic-release": "^17.0.8",
"webpack": "^4.43.0",
"webpack-cli": "^3.3.11"
}
Expand Down

0 comments on commit ef7987a

Please sign in to comment.