Skip to content

Commit 73929b5

Browse files
authored
Merge pull request #2 from layer5io/leecalcote/ci/publish-npm-package
2 parents 7bb7033 + 2c9c749 commit 73929b5

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

Diff for: .github/workflows/npm-publish.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3+
4+
name: Publish Node.js Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
workflow_dispatch:
10+
inputs:
11+
release-type:
12+
required: true
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: 16
22+
- run: |
23+
npm install
24+
npm run dist
25+
publish-gpr:
26+
needs: build
27+
runs-on: ubuntu-latest
28+
permissions:
29+
contents: read
30+
packages: write
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: actions/setup-node@v3
34+
with:
35+
node-version: 16
36+
registry-url: "https://registry.npmjs.org"
37+
scope: "@layer5"
38+
- run: npm publish --verbose
39+
env:
40+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)