Skip to content

Commit 1b1fd0a

Browse files
committed
Add Actions publish workflows
1 parent 36549d2 commit 1b1fd0a

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed
Lines changed: 40 additions & 0 deletions
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: GitHub Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
publish-gpr:
12+
needs: build
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v3
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v3
23+
with:
24+
node-version: 18
25+
registry-url: https://npm.pkg.github.com/
26+
27+
- name: Setup pnpm
28+
uses: pnpm/action-setup@v2.2.4
29+
with:
30+
version: 7.30.0
31+
run_install: false
32+
- run: pnpm install
33+
34+
- run: npm config set registry https://npm.pkg.github.com/
35+
36+
- name: Publish package
37+
run: npm publish
38+
working-directory: ./packages/server/
39+
env:
40+
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/npm-publish.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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: NPM Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
jobs:
11+
publish-npm:
12+
needs: build
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v3
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 18
22+
registry-url: https://registry.npmjs.org/
23+
24+
- name: Setup pnpm
25+
uses: pnpm/action-setup@v2.2.4
26+
with:
27+
version: 7.30.0
28+
run_install: false
29+
- run: pnpm install
30+
31+
- name: Publish package
32+
run: npm publish
33+
working-directory: ./packages/server/
34+
env:
35+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}

0 commit comments

Comments
 (0)