-
Notifications
You must be signed in to change notification settings - Fork 3
47 lines (40 loc) · 1.24 KB
/
package.yaml
File metadata and controls
47 lines (40 loc) · 1.24 KB
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
45
46
47
name: Node.js Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- name: Get Node.js version
id: node-version
run: |
echo "version=$(node --version)" >> $GITHUB_OUTPUT
- name: Cache node_modules
uses: actions/cache@v4
id: cache-node-modules
with:
path: node_modules
key: v1-node-${{ steps.node-version.outputs.version }}-modules-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
run: npm install
if: steps.cache-node-modules.outputs.cache-hit != 'true'
- run: npm publish --access public
if: ${{ !github.event.release.prerelease }}
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v4
with:
registry-url: 'https://npm.pkg.github.com'
- run: npm publish
if: ${{ !github.event.release.prerelease }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}