Skip to content

Commit e5d1ee1

Browse files
committed
Fix NPM auto-publish
1 parent 0c47b33 commit e5d1ee1

3 files changed

Lines changed: 30 additions & 52 deletions

File tree

.github/workflows/node.js.pr.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/node.js.yml

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

4-
name: Build and publish Angular library
4+
name: Angular library
55

66
on:
77
push:
88
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
911

1012
jobs:
1113
build:
14+
1215
runs-on: ubuntu-latest
1316

1417
strategy:
@@ -24,28 +27,3 @@ jobs:
2427
- run: npm ci
2528
- run: npm run lint
2629
- run: npm run build:prod
27-
28-
npm-publish:
29-
needs: build
30-
name: Publish to NPM
31-
runs-on: ubuntu-latest
32-
steps:
33-
- name: Checkout repository
34-
uses: actions/checkout@v2
35-
- name: Set up Node.js
36-
uses: actions/setup-node@v1
37-
with:
38-
node-version: '12'
39-
- run: npm ci
40-
- run: npm run lint
41-
- run: npm run build:prod
42-
- name: Publish if version has been updated
43-
uses: pascalgn/npm-publish-action@1.3.3
44-
with:
45-
tag_name: "v%s"
46-
tag_message: "v%s"
47-
commit_pattern: "^Release (\\S+)" # Only publish when a commit is created that starts with "Release ..."
48-
workspace: "./dist/muuri-angular"
49-
env:
50-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51-
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

.github/workflows/npm-publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: npm-publish
2+
on:
3+
push:
4+
tags:
5+
- v*.*.*
6+
7+
jobs:
8+
npm-publish:
9+
name: npm-publish
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@master
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v1
16+
with:
17+
node-version: '12'
18+
registry-url: 'https://registry.npmjs.org'
19+
- name: Install dependencies
20+
run: npm ci
21+
- name: Build library
22+
run: npm run build:prod
23+
- name: Publish version
24+
run: cd ./dist/muuri-angular && npm publish
25+
env:
26+
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

0 commit comments

Comments
 (0)