Skip to content

v3.0.1

v3.0.1 #49

Workflow file for this run

# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
name: Publish NPM package
on:
release:
types: [created]
workflow_dispatch:
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
node:
- 18
- 20
- 22
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm test
publish-npm:
name: Publish to NPM
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
update-docs:
name: Update documentation
needs: publish-npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Get package version
run: echo "VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV
- name: Trigger GitHub Action in doc-detective.github.io
run: |
curl -XPOST -H "Authorization: token ${{ secrets.DOCS_PERSONAL_ACCESS_TOKEN }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
"https://api.github.com/repos/doc-detective/doc-detective.github.io/dispatches" \
-d '{"event_type": "update-common-package-event", "client_payload": {"version": "${{ env.VERSION }}"} }'