-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (38 loc) · 1.17 KB
/
publish_npm.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
name: Publish to npm
on:
workflow_dispatch:
jobs:
publish-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: master
- name: Merge develop to master
run: |
git fetch --quiet
git reset --hard origin/master
git merge --ff-only --quiet origin/develop
- name: Setup node
id: setup-node
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Use cache for root node_modules
id: cache-root-node_modules
uses: actions/cache@v3
with:
path: node_modules
key: root-node_modules-${{ steps.setup-node.outputs.node-version }}-${{ hashFiles('package-lock.json') }}
- name: Install
if: steps.cache-root-node_modules.outputs.cache-hit != 'true'
run: npm ci --no-audit --no-fund
- name: Publish
run: npx semantic-release
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Update develop
run: |
git push origin master:develop --quiet > /dev/null 2>&1