-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (36 loc) · 1.2 KB
/
npm-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
name: Publish Package to npmjs
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
pkg:
description: 'Project To Publish (esm or node). Ensure version is updated & tagged'
default: 'node'
required: true
tag:
description: 'Branch or tag'
default: 'main'
required: true
jobs:
install_and_publish:
name: Install production dependencies and publish to npm
runs-on: ubuntu-latest
strategy:
matrix:
node: [ '18' ] # lts?
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.tag }}
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
registry-url: 'https://registry.npmjs.org'
# Setup .npmrc file to publish to npm
- run: echo checking out branch/tag ${GITHUB_REF##*/}
# - run: npm install --production --workspace=libs/${{ github.event.inputs.pkg }} # NOT NEEDED CURRENTLY
- run: npm publish --workspace=libs/${{ github.event.inputs.pkg }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}