Skip to content

release

release #26

Workflow file for this run

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
- name: npm version
working-directory: src
run: |
git config --global user.name github-actions
git config --global user.email github-actions@github.com
npm version ${{ inputs.version }}
git add package.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
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: git push origin master v${{ inputs.version }}
- uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- name: Publish documentation
working-directory: gh-pages
run: |
rm -rf *
cp -a ../dist/docs/* .
git add .
git commit --allow-empty -a -m "Updating from ${{ github.sha }}"
git push origin gh-pages