Skip to content

Publish

Publish #15

Workflow file for this run

name: Publish
on:
workflow_dispatch:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
registry-url: "https://registry.npmjs.org"
scope: "@svta"
- name: Install
run: npm ci
- name: Test
run: npm test
- name: Publish
run: npm run pub
- name: Get Version
run: echo "version=`node -p "require('./package').version"`" >> $GITHUB_ENV
- name: Create Release Notes
run: npm run notes
- name: Draft Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_ACTIONS }}
with:
tag_name: v${{ env.version }}
release_name: ${{ env.version }}
commitish: main
body_path: ./RELEASE.md
draft: true
prerelease: false
- name: Build Docs
run: npm run build -w docs
- name: Deploy Docs
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./docs/dist/
personal_token: ${{ secrets.GH_ACTIONS }}