-
Notifications
You must be signed in to change notification settings - Fork 0
executable file
·50 lines (43 loc) · 1.3 KB
/
release.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
name: NPM publish
on:
push:
branches:
# Push events on main branch
- master
jobs:
release:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm install
- name: Test
run: npm test
- name: Build
run: npm run build
- name: Publish
id: publish
run: |
cd dist
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
npm publish --access public
echo "::set-output name=version::$(node -p "require('./package.json').version")"
echo "::set-output name=type::$(node -p "require('./package.json').version")"
- if: steps.publish.outputs.type != 'none'
name: Create release
uses: release-drafter/release-drafter@v5.12.1
with:
publish: true
name: v${{ steps.publish.outputs.version }}
version: ${{ steps.publish.outputs.version }}
tag: ${{ steps.publish.outputs.version }}
env:
CI: true
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}