2022-10-12 10:21:19 -04:00
|
|
|
name: Publish NPM
|
|
|
|
|
|
|
|
# On a published release, run tests and deploy to NPM
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
# Job Setup
|
|
|
|
jobs:
|
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
2023-10-14 12:30:16 -04:00
|
|
|
- uses: actions/checkout@v4 #Checkout Repo
|
2022-10-12 10:21:19 -04:00
|
|
|
- uses: actions/setup-node@v3 #Setup Node
|
|
|
|
with:
|
|
|
|
node-version: 18
|
|
|
|
- run: npm install
|
|
|
|
- run: npm test
|
2023-04-21 11:22:56 -04:00
|
|
|
- uses: JS-DevTools/npm-publish@v2
|
2022-10-12 10:21:19 -04:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.NPM_TOKEN }}
|
|
|
|
access: public
|
|
|
|
- if: steps.publish.outputs.type != 'none'
|
|
|
|
run: |
|
|
|
|
echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}"
|