-
Notifications
You must be signed in to change notification settings - Fork 404
feat(repo): Support v6-alpha releases #7130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nikosdouvlis
wants to merge
1
commit into
vincent-and-the-doctor
Choose a base branch
from
nikos/support-alpha-v6-releases
base: vincent-and-the-doctor
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+146
−4
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Alpha v6 Development Branch | ||
| # This file marks this branch as an alpha-v6 development branch. | ||
| # Production releases (latest tag) are disabled on this branch. | ||
| # Only alpha-v6 releases are allowed. | ||
|
|
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| name: Alpha-v6 release | ||
| run-name: Alpha-v6 release from ${{ github.ref_name }} | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| alpha-v6-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_CACHE: remote:rw | ||
| 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 alpha-v6 | ||
| id: version-packages | ||
| run: pnpm version-packages:alpha-v6 | tail -1 >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Build release | ||
| if: steps.version-packages.outputs.success == '1' | ||
| run: pnpm turbo build $TURBO_ARGS | ||
|
|
||
| - name: Alpha-v6 release | ||
| if: steps.version-packages.outputs.success == '1' | ||
| run: pnpm release:alpha-v6 | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| NPM_CONFIG_PROVENANCE: true | ||
|
|
||
| - name: Trigger workflows on related repos | ||
| if: steps.version-packages.outputs.success == '1' | ||
| 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; | ||
|
|
||
| github.rest.actions.createWorkflowDispatch({ | ||
| owner: 'clerk', | ||
| repo: 'sdk-infra-workers', | ||
| workflow_id: 'update-clerkjs.yml', | ||
| ref: 'main', | ||
| inputs: { version: clerkjsVersion } | ||
| }) | ||
|
|
||
| # if (nextjsVersion.includes('alpha-v6')) { | ||
| # console.log('clerk/nextjs changed with alpha-v6, will notify clerk/accounts'); | ||
| # github.rest.actions.createWorkflowDispatch({ | ||
| # owner: 'clerk', | ||
| # repo: 'accounts', | ||
| # workflow_id: 'release-staging.yml', | ||
| # ref: 'main', | ||
| # inputs: { version: nextjsVersion } | ||
| # }) | ||
| # } | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,43 @@ | ||||||||
| #!/usr/bin/env zx | ||||||||
|
|
||||||||
| import { $, echo } from 'zx'; | ||||||||
|
|
||||||||
| import { constants } from './common.mjs'; | ||||||||
|
|
||||||||
| const snapshot = `--- | ||||||||
| '@clerk/backend': patch | ||||||||
| '@clerk/shared': patch | ||||||||
| '@clerk/react': patch | ||||||||
| '@clerk/clerk-js': patch | ||||||||
| '@clerk/nextjs': patch | ||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| --- | ||||||||
|
|
||||||||
| Alpha-v6 release | ||||||||
| `; | ||||||||
|
|
||||||||
| await $`pnpm dlx json -I -f ${constants.ChangesetConfigFile} -e "this.changelog = false"`; | ||||||||
|
|
||||||||
| try { | ||||||||
| // exit pre-release mode if we're in it | ||||||||
| await $`pnpm changeset pre exit`; | ||||||||
| // bump the version of all affected packages | ||||||||
| // this will remove the prerelease versions | ||||||||
| // but will also clear the changeset .md files | ||||||||
| await $`pnpm changeset version`; | ||||||||
| // generate a temp .md file that indicates that all packages have changes | ||||||||
| // in order to force a snapshot release | ||||||||
| await $`touch .changeset/snap.md && echo ${snapshot} > .changeset/snap.md`; | ||||||||
| } catch { | ||||||||
| // otherwise, do nothing | ||||||||
| } | ||||||||
|
|
||||||||
| const res = await $`pnpm changeset version --snapshot alpha-v6`; | ||||||||
| const success = !res.stderr.includes('No unreleased changesets found'); | ||||||||
|
|
||||||||
| await $`git checkout HEAD -- ${constants.ChangesetConfigFile}`; | ||||||||
|
|
||||||||
| if (success) { | ||||||||
| echo('success=1'); | ||||||||
| } else { | ||||||||
| echo('success=0'); | ||||||||
| } | ||||||||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.