-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.71 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
name: Publish Package to NPM
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Check Package Version Change
uses: EndBug/version-check@v1
id: check
with:
file-name: ./projects/ngx-code-snippet/package.json
file-url: https://unpkg.com/ngx-code-snippet@latest/package.json
static-checking: localIsNew
- name: Version Update Detected
if: steps.check.outputs.changed == 'true'
run: 'echo "Version change found! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'
- name: Remove Dependencies
if: steps.check.outputs.changed == 'true'
run: rm yarn.lock
- name: Install Packages
if: steps.check.outputs.changed == 'true'
run: yarn install
- name: Build Project
if: steps.check.outputs.changed == 'true'
run: yarn build:lib
- name: Copy Readme
if: steps.check.outputs.changed == 'true'
run: yarn readme
- name: Copy License
if: steps.check.outputs.changed == 'true'
run: yarn license
- name: Publish to NPM
if: steps.check.outputs.changed == 'true'
run: npm publish ./dist/ngx-code-snippet
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}