-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (40 loc) · 1.37 KB
/
publish.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
45
# This is a name of the workflow
name: publish to npm
# Controls when the workflow will run
on:
# Triggers the workflow on published releases
release:
types: [published]
# A workflow run is made up of one or more jobs, which run in parallel by default
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
strategy:
matrix:
node-version: [20]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
uses: actions/checkout@v4
- name: Setup Node ${{ matrix.node-version }}
# Setup node environment and .npmrc file to publish to npm
uses: actions/setup-node@v4
with:
# Node version. Run "node -v" to check the latest version
node-version: ${{ matrix.node-version }}
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Publish
run: npm publish --provenance --access public
env:
# We need this to our NPM account
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}