-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ccbeead
commit f31365b
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: Build and publish NPM package | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
node_version: | ||
default: '19' | ||
description: 'Node version to use' | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
build-package: | ||
environment: release | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 # npm run prod requires tags, sadly this is the only way to get them. | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ inputs.node_version }} | ||
- name: Install dependencies | ||
run: npm install | ||
- name: Test with npm | ||
run: npm run test | ||
- name: Build with npm | ||
run: npm run prod | ||
- name: Publish with npm | ||
if: startsWith(github.ref, 'refs/tags') | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |