Skip to content

Commit 0bf242e

Browse files
authored
added github action to publish package to npm (#74)
* added github action to publish package to npm
1 parent b28ed3a commit 0bf242e

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

.github/workflows/npm-publish.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
3+
4+
name: Node.js Package
5+
6+
on:
7+
push:
8+
branches:
9+
- 'releases/**'
10+
release:
11+
types: [created]
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-node@v2
19+
with:
20+
node-version: 12
21+
- run: npm ci
22+
23+
publish-npm:
24+
needs: build
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v2
28+
- uses: actions/setup-node@v2
29+
with:
30+
node-version: 12
31+
registry-url: https://registry.npmjs.org/
32+
scope: '@ngx-builders'
33+
- run: npm ci
34+
- run: npm publish
35+
env:
36+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
37+
38+
publish-gpr:
39+
needs: build
40+
runs-on: ubuntu-latest
41+
permissions:
42+
contents: read
43+
packages: write
44+
steps:
45+
- uses: actions/checkout@v2
46+
- uses: actions/setup-node@v2
47+
with:
48+
node-version: 12
49+
registry-url: https://npm.pkg.github.com/
50+
- run: npm ci
51+
- run: npm publish
52+
env:
53+
NODE_AUTH_TOKEN: ${{secrets.GIT_PKG_TOKEN}}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ngx-builders/analyze",
3-
"version": "2.3.0",
3+
"version": "2.3.1",
44
"description": "",
55
"main": "index.js",
66
"builders": "./builders.json",
@@ -16,6 +16,9 @@
1616
"type": "git",
1717
"url": "git+https://github.com/ngx-builders/source-map-analyzer.git"
1818
},
19+
"publishConfig": {
20+
"access": "public"
21+
},
1922
"keywords": [
2023
"angular",
2124
"schematics",

0 commit comments

Comments
 (0)