-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (33 loc) · 1.13 KB
/
Copy pathpublish.yml
File metadata and controls
35 lines (33 loc) · 1.13 KB
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
name: publish
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# "ref" specifies the branch to check out.
# "github.event.release.target_commitish" is a global variable and specifies the branch the release targeted
ref: ${{ github.event.release.target_commitish }}
- uses: actions/setup-node@v2
with:
node-version: '12'
registry-url: https://registry.npmjs.org/
scope: "@mx-js"
- run: npm install
- run: git config --global user.name "GitHub CD bot"
- run: git config --global user.email "github-cd-bot@mail.com"
# upgrade npm version in package.json to the tag used in the release.
- run: npm version ${{ github.event.release.tag_name }} --force
- run: npm run build
- run: npm test
- run: npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
# push the version changes to GitHub
- run: git push
env:
# The secret is passed automatically. Nothing to configure.
github-token: ${{ secrets.GITHUB_TOKEN }}