-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.15 KB
/
publish.yaml
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: Publlish NPM packages
on:
push:
branches:
- master
- develop
jobs:
deploy:
name: Publlish NPM packages
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git User
run: |
git config --global user.name 'Elfo404'
git config --global user.email '[email protected]'
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 15
registry-url: 'https://registry.npmjs.org'
scope: '@elfo404'
- name: Prepare
run: npm ci
- name: Test
run: npm run test
- name: Publish pre-releases
if: ${{ github.ref == 'refs/heads/develop' }}
run: npm run publish:pre
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish stable releases
if: ${{ github.ref == 'refs/heads/master' }}
run: |
npm run publish:stable
git checkout develop
git merge master --ff-only
git push origin develop
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}