-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (34 loc) · 986 Bytes
/
Copy pathnode-publish-npm.yml
File metadata and controls
36 lines (34 loc) · 986 Bytes
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
name: Publish Package to NPM
on:
workflow_dispatch:
workflow_call:
secrets:
NPM_ACCESS_TOKEN:
required: true
jobs:
publish-npm:
if: github.event_name == 'release' && github.event.action == 'created'
name: Publish to NPM
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"
registry-url: https://registry.npmjs.org
# Defaults to the user or organization that owns the workflow file
scope: "@codrjs"
- name: Install Dependencies
run: yarn
- name: Download Artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist/
- name: Publish Artifact
run: cd dist && yarn publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}