-
-
Notifications
You must be signed in to change notification settings - Fork 1
57 lines (51 loc) · 1.68 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Publish
on:
push:
branches:
- master
paths-ignore:
- README.md
- .gitignore
- .github/**
jobs:
publish:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [16.x]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- name: npm install, build, and test
run: |
npm install
npm run coverage
- name: Setup GIT
run: |
git reset --hard
git config --local --list
git checkout master
git config user.email "$GH_EMAIL"
git config user.name "NDNCI"
env:
GH_EMAIL: ${{secrets.GH_EMAIL}}
- name: Bump version
run: |
git reset --hard
npm version patch
npm run build
git add . || true
git commit -m "Build update" || true
git push "https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY"
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: npm publish
run: |
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
npm run trypublish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_PUBLISH_TOKEN}}