Skip to content

Release

Release #1303

Workflow file for this run

name: Release
# Release on demand only
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
permissions: {}
jobs:
build:
runs-on: ubuntu-latest
# This environment contains secrets needed for publishing
environment: release
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
# Don't save creds in the git config (so it's easier to override later)
persist-credentials: false
- name: Install Node.js from .nvmrc
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version-file: .nvmrc
- run: yarn --frozen-lockfile
- run: yarn checkchange
- run: yarn lage build test
- name: Set git user
run: |
git config user.email "[email protected]"
git config user.name "Ken Chau"
- name: Release
run: |
# Get the existing remote URL without creds, and use a trap (like try/finally)
# to restore it after this step finishes
trap "git remote set-url origin '$(git remote get-url origin)'" EXIT
# Add a token to the remote URL for auth during release
git remote set-url origin "https://[email protected]/$GITHUB_REPOSITORY"
yarn release -y -n "$NPM_AUTHTOKEN"
env:
NPM_AUTHTOKEN: ${{ secrets.NPM_AUTHTOKEN }}
REPO_PAT: ${{ secrets.REPO_PAT }}
# The docs have a separate installation using Node 22 due to needing newer dependencies
docs:
name: build docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- name: Set up Node.js
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version-file: docs/.nvmrc
- name: Install docs dependencies
working-directory: docs
run: yarn --immutable
- name: Build doc site
working-directory: docs
run: yarn build
- name: Upload site as artifact
id: deployment
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
with:
path: docs/dist
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: docs
permissions:
# to deploy to Pages
pages: write
# to verify the deployment originates from an appropriate source
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4