Skip to content

Commit

Permalink
Auto publish on release (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
fa93hws committed Nov 24, 2019
1 parent 5516fae commit 507d1d6
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
paths-ignore:
- '**.md'
release:
types: [published, created, edited]

jobs:
build:
Expand All @@ -19,6 +21,8 @@ jobs:
key: yarn-${{ hashFiles('yarn.lock') }}
restore-keys: yarn-
- name: Run yarn
env:
NPM_TOKEN: ''
run: yarn
- name: Find linting & testing Cache
uses: actions/cache@v1
Expand All @@ -28,9 +32,27 @@ jobs:
restore-keys: lintingcache-
- name: Check ESLint
run: yarn lint:cache
env:
NPM_TOKEN: ''
- name: Check code style
run: yarn format:prettier
env:
NPM_TOKEN: ''
- name: Run unit test
run: yarn test
env:
NPM_TOKEN: ''
- name: Check Typescript Types
run: yarn lint:types:cache
env:
NPM_TOKEN: ''
- name: Build Typescript
run: yarn build
if: github.event_name == 'release'
env:
NPM_TOKEN: ''
- name: Publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
if: github.event_name == 'release'
run: npm publish
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-snapshot-test",
"version": "0.9.0",
"version": "1.0.0",
"description": "Provide snapshot test for eslint rule",
"main": "dist/index.js",
"repository": "https://github.com/fa93hws/eslint-snapshot-test.git",
Expand Down Expand Up @@ -41,5 +41,9 @@
},
"dependencies": {
"lodash.merge": "^4.6.2"
}
},
"keywords": [
"eslint",
"snapshot-test"
]
}
4 changes: 3 additions & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"extends": "./tsconfig.json",
"declaration": true,
"exclude": ["**/tests/**"],
"outDir": "dist"
"compilerOptions": {
"outDir": "dist"
}
}
6 changes: 3 additions & 3 deletions tsconfig.check.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"extends": "./tsconfig.json",
"compilerOptions": {
"incremental": true,
"tsBuildInfoFile": "cache/ts-check.json"
},
"outDir": "dist"
"tsBuildInfoFile": "cache/ts-check.json",
"outDir": "dist"
}
}

0 comments on commit 507d1d6

Please sign in to comment.