Skip to content

Commit 9ea925d

Browse files
committed
npm-publish.yml
1 parent d76900c commit 9ea925d

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

.github/workflows/npm-publish.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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: Node.js Package
5+
6+
on:
7+
release:
8+
types: [created]
9+
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
15+
strategy:
16+
matrix:
17+
node-version: [20.x]
18+
19+
steps:
20+
- name: Check out repository
21+
uses: actions/checkout@v3
22+
23+
- name: Set up Node.js
24+
uses: actions/setup-node@v3
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
28+
- name: Install dependencies
29+
run: yarn install
30+
31+
- name: Run tests
32+
env:
33+
TOKEN: ${{ secrets.TOKEN }}
34+
run: yarn test
35+
36+
publish-npm:
37+
needs: build
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: actions/setup-node@v4
42+
with:
43+
node-version: 20
44+
registry-url: https://registry.npmjs.org/
45+
- run: npm ci
46+
- run: npm config set scope scrape-do --global
47+
- run: npm config set access public --global
48+
- run: npm publish
49+
env:
50+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

0 commit comments

Comments
 (0)