-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (41 loc) · 1.41 KB
/
publish-package.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
46
47
name: Publish to GitHub Packages
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v2
# Setup .npmrc file to publish to GitHub Packages
# Note that the secrets.GITHUB_TOKEN is a GitHub Personal Access Token and is defined
# in the idsse-muppet's repository's secrets settings
# - name: Create .npmrc file
# run: |
# echo 'registry=https://registry.npmjs.org/' > .npmrc
# echo '@noaa-gsl:registry=https://npm.pkg.github.com/' >> .npmrc
# echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
- name: Install node
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@NOAA-GSL'
# cache: 'npm'
# cache-dependency-path: ./package-lock.json
# - name: Check GitHub login status
# run: npm whoami --registry=https://npm.pkg.github.com
- name: Install npm dependencies
run: npm ci
- name: Publish npm package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}