2022-06-09 16:51:52 +00:00
|
|
|
name: Publish NPM
|
2022-06-09 16:22:58 +00:00
|
|
|
|
2022-06-09 17:03:56 +00:00
|
|
|
# On a published release, run tests and deploy to NPM
|
2022-06-09 16:22:58 +00:00
|
|
|
on:
|
2022-06-09 16:53:52 +00:00
|
|
|
workflow_dispatch:
|
2022-06-09 16:22:58 +00:00
|
|
|
release:
|
2022-06-09 17:03:56 +00:00
|
|
|
types: [published]
|
2022-06-09 16:22:58 +00:00
|
|
|
|
|
|
|
# Job Setup
|
|
|
|
jobs:
|
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
|
2023-09-05 04:40:15 +00:00
|
|
|
- uses: actions/checkout@v4 #Checkout Repo
|
2023-10-24 05:05:26 +00:00
|
|
|
- uses: actions/setup-node@v4 #Setup Node
|
2022-06-09 16:22:58 +00:00
|
|
|
with:
|
|
|
|
node-version: 18
|
|
|
|
- run: npm install
|
|
|
|
- run: npm test
|
2023-10-19 04:11:43 +00:00
|
|
|
- uses: JS-DevTools/npm-publish@v3
|
2022-06-09 16:45:34 +00:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.NPM_TOKEN }}
|
|
|
|
access: public
|
2022-06-09 16:22:58 +00:00
|
|
|
- if: steps.publish.outputs.type != 'none'
|
|
|
|
run: |
|
|
|
|
echo "Version changed: ${{ steps.publish.outputs.old-version }} => ${{ steps.publish.outputs.version }}"
|