-
Notifications
You must be signed in to change notification settings - Fork 6
45 lines (38 loc) · 1.13 KB
/
canary-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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 }}