-
Notifications
You must be signed in to change notification settings - Fork 252
85 lines (75 loc) · 2.86 KB
/
release-canary.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Canary release
run-name: Canary release from ${{ github.ref_name }}
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
canary-release:
if: ${{ github.repository == 'clerk/javascript' }}
runs-on: ${{ vars.RUNNER_NORMAL || 'ubuntu-latest' }}
timeout-minutes: ${{ vars.TIMEOUT_MINUTES_NORMAL && fromJSON(vars.TIMEOUT_MINUTES_NORMAL) || 10 }}
env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
TURBO_REMOTE_ONLY: true
permissions:
contents: read
id-token: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup
id: config
uses: ./.github/actions/init
with:
turbo-signature: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
turbo-team: ${{ vars.TURBO_TEAM }}
turbo-token: ${{ secrets.TURBO_TOKEN }}
playwright-enabled: true # Must be present to enable caching on branched workflows
registry-url: 'https://registry.npmjs.org'
- name: Version packages for canary
id: version-packages
run: npm run version:canary | tail -1 >> "$GITHUB_OUTPUT"
- name: Build release
if: steps.version-packages.outputs.success == '1'
run: npx turbo build $TURBO_ARGS
- name: Canary release
if: steps.version-packages.outputs.success == '1'
run: npm run release:canary
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
- name: Trigger workflows on related repos
uses: actions/github-script@v7
with:
result-encoding: string
retries: 3
retry-exempt-status-codes: 400,401
github-token: ${{ secrets.CLERK_COOKIE_PAT }}
script: |
const clerkjsVersion = require('./packages/clerk-js/package.json').version;
const nextjsVersion = require('./packages/nextjs/package.json').version;
if (clerkjsVersion.includes('canary')) {
console.log('clerk-js changed, will notify clerk/cloudflare-workers');
github.rest.actions.createWorkflowDispatch({
owner: 'clerk',
repo: 'cloudflare-workers',
workflow_id: 'release-canary-clerkjs-proxy.yml',
ref: 'main',
inputs: { version: clerkjsVersion }
})
}
if (nextjsVersion.includes('canary')) {
console.log('clerk/nextjs changed, will notify clerk/accounts');
github.rest.actions.createWorkflowDispatch({
owner: 'clerk',
repo: 'accounts',
workflow_id: 'release-staging.yml',
ref: 'main',
inputs: { version: nextjsVersion }
})
}