-
Notifications
You must be signed in to change notification settings - Fork 113
53 lines (44 loc) · 1.48 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
name: npm-publish
on:
push:
branches:
- master
jobs:
npm-publish:
name: npm-publish
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@master
- name: Check if version has been updated
id: check
uses: EndBug/version-check@v1
with:
file-url: https://unpkg.com/react-router-cache-route/package.json
static-checking: localIsNew
- name: Output version check result
run: 'echo "changed: ${{ steps.check.outputs.changed }}, version: ${{ steps.check.outputs.version }}"'
- name: Log if version has been updated
if: steps.check.outputs.changed == 'true'
run: 'echo "Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'
- name: Set up Node.js
if: steps.check.outputs.changed == 'true'
uses: actions/setup-node@master
with:
node-version: 13.11.0
- name: Install Dependencies
if: steps.check.outputs.changed == 'true'
uses: bahmutov/npm-install@v1
with:
useLockFile: false
args: install
- name: Build
if: steps.check.outputs.changed == 'true'
run: 'sudo npm run build'
- name: Publish
if: steps.check.outputs.changed == 'true'
uses: pascalgn/npm-publish-action@1.3.9
with:
commit_pattern: "^Release (\\S+)"
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}