-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.38 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
name: npm-publish
on:
push:
branches:
- main
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/@fexd/tools/package.json
static-checking: localIsNew
- 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: 16.20.2
- name: Install Dependencies
if: steps.check.outputs.changed == 'true'
uses: bahmutov/npm-install@v1
with:
useLockFile: false
- name: Build
if: steps.check.outputs.changed == 'true'
run: 'sudo npm run build'
- name: Publish
if: steps.check.outputs.changed == 'true'
uses: pascalgn/[email protected]
with:
create_tag: 'false'
commit_pattern: "^release: (\\S+)"
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}