Skip to content

Release

Release #748

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Release
on:
# release daily at 8am UTC (midnight or 1am pacific)
# https://crontab-generator.org/
schedule:
- cron: '0 8 * * *'
# or manual trigger
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
# This environment contains secrets needed for publishing
environment: release
steps:
- uses: actions/checkout@v4
with:
# Fetch all history (required for publishing which looks at history)
fetch-depth: 0
# 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@v3
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 "kchau@microsoft.com"
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://$REPO_PAT@github.com/$GITHUB_REPOSITORY"
yarn release -y -n "$NPM_AUTHTOKEN"
env:
NPM_AUTHTOKEN: ${{ secrets.NPM_AUTHTOKEN }}
REPO_PAT: ${{ secrets.REPO_PAT }}