Skip to content

Commit 10f20af

Browse files
committed
ci
1 parent e39b1fa commit 10f20af

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

.github/workflows/main.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: CI
4+
5+
# Controls when the action will run.
6+
on:
7+
# Triggers the workflow on push or pull request events but only for the master branch
8+
pull_request:
9+
branches: [master]
10+
push:
11+
branches: [master]
12+
13+
workflow_dispatch:
14+
15+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
16+
jobs:
17+
# This workflow contains a single job called "build"
18+
test:
19+
# The type of runner that the job will run on
20+
runs-on: ubuntu-latest
21+
# Steps represent a sequence of tasks that will be executed as part of the job
22+
steps:
23+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
24+
- uses: actions/checkout@v2
25+
- uses: actions/setup-node@v1
26+
with:
27+
node-version: 14.x
28+
- run: npm ci
29+
- name: lint and test
30+
run: |
31+
npm run lint
32+
npm run test:cov
33+
- name: Coveralls
34+
uses: coverallsapp/[email protected]
35+
with:
36+
github-token: ${{ secrets.GITHUB_TOKEN }}
37+
publish:
38+
if: github.ref == 'refs/heads/master'
39+
needs: test
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v2
43+
- name: setup git
44+
run: |
45+
git config --local user.email "[email protected]"
46+
git config --local user.name "GitHub Action"
47+
- name: version
48+
run: |
49+
git checkout -f -b version-branch
50+
npm version patch --no-commit-hooks -m "$(git log -1 --pretty=%B) .... bump version [skip ci]"
51+
git push origin version-branch:master --follow-tags
52+
- uses: actions/setup-node@v1
53+
with:
54+
node-version: 14
55+
- name: Publish
56+
run: |
57+
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
58+
npm publish --ignore-scripts
59+
env:
60+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
File renamed without changes.

0 commit comments

Comments
 (0)