-
Notifications
You must be signed in to change notification settings - Fork 44
44 lines (41 loc) · 1.03 KB
/
nodejs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Node.js
on:
push:
pull_request:
schedule:
# Check if it works with current dependencies
- cron: '42 2 * * 6' # weekly on Saturday 2:42 UTC
jobs:
test:
name: Node.js
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
- uses: actions/checkout@v4
- run: npm install
- run: npm test
- run: npm pack
publish:
name: Publish on NPM
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: test
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 'lts/*'
registry-url: 'https://registry.npmjs.org'
- run: npm install
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_ACCESS: public
NPM_CONFIG_PROVENANCE: true
- name: Create GitHub release
uses: softprops/action-gh-release@v1