release #30
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
name: release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: string | |
required: true | |
description: Version number (x.y.z) | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
cache: npm | |
registry-url: 'https://registry.npmjs.org' | |
- run: npm ci | |
- run: | | |
git config --global user.name github-actions | |
git config --global user.email [email protected] | |
- name: npm version | |
if: inputs.version != 'doconly' | |
run: | | |
npm version ${{ inputs.version }} | |
git add package.json package-lock.json | |
git commit -m v${{ inputs.version }} | |
git tag v${{ inputs.version }} | |
- run: git show HEAD | |
- run: npm run build | |
- run: npm run docs | |
- run: | | |
npm whoami | |
npm publish --access=public --provenance | |
working-directory: dist/package | |
if: inputs.version != 'doconly' | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: git push origin master v${{ inputs.version }} | |
if: inputs.version != 'doconly' | |
- uses: actions/checkout@v4 | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Publish documentation | |
working-directory: gh-pages | |
run: | | |
mv dev .. | |
rm -rf * | |
cp -a ../dist/docs/* . | |
mv ../dev . | |
git add . | |
git commit --allow-empty -a -m "Updating from ${{ github.sha }}" | |
git push origin gh-pages |