Staging release from main #481
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Staging release | |
run-name: Staging release from ${{ github.ref_name }} | |
on: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
staging-release: | |
if: ${{ github.repository == 'clerkinc/javascript' }} | |
runs-on: ${{ vars.RUNNER_LARGE }} | |
env: | |
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }} | |
TURBO_TEAM: ${{ vars.TURBO_TEAM }} | |
TURBO_REMOTE_ONLY: true | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Setup | |
uses: ./.github/actions/setup | |
- name: Version packages for staging | |
id: version-packages | |
run: npm run version:staging | tail -1 >> "$GITHUB_OUTPUT" | |
- name: Staging release | |
if: steps.version-packages.outputs.success == '1' | |
run: npm run release:staging | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Trigger workflows on related repos | |
uses: actions/github-script@v6 | |
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('staging')) { | |
console.log('clerk-js changed, will notify clerkinc/cloudflare-workers'); | |
github.rest.actions.createWorkflowDispatch({ | |
owner: 'clerkinc', | |
repo: 'cloudflare-workers', | |
workflow_id: 'release-staging-clerkjs-proxy.yml', | |
ref: 'main', | |
inputs: { version: clerkjsVersion } | |
}) | |
} | |
if (nextjsVersion.includes('staging')) { | |
console.log('clerk/nextjs changed, will notify clerkinc/accounts'); | |
github.rest.actions.createWorkflowDispatch({ | |
owner: 'clerkinc', | |
repo: 'accounts', | |
workflow_id: 'release-staging.yml', | |
ref: 'main', | |
inputs: { version: nextjsVersion } | |
}) | |
} |