Skip to content

Canary Release

Canary Release #21

name: Canary Release
on:
workflow_run:
workflows: ["Test (base)"]
types:
- completed
branches-ignore:
- main
jobs:
release:
name: Canary Release
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
fetch-depth: 0
ref: ${{ github.event.workflow_run.head_branch }}
- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'
- name: Install Dependencies
run: yarn install
- name: Build
run: yarn run build
- name: Set the current commit hash
run: |
echo "GIT_HASH=$(git rev-parse --short $GITHUB_SHA)" >> "$GITHUB_ENV"
- name: Publish Canary Version
run: |
yarn run changeset version --snapshot $GIT_HASH
yarn run changeset publish --no-git-tag --tag canary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}