Skip to content
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

Chore(repo): Enable clerk@v5 release process #1837

Merged
merged 3 commits into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": ["./changelog.js", { "repo": "clerkinc/javascript" }],
"changelog": [
"./changelog.js",
{
"repo": "clerkinc/javascript"
}
],
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "origin/main",
"baseBranch": "main-v4",
"updateInternalDependencies": "patch",
"ignore": [],
"snapshot": {
Expand All @@ -16,4 +21,4 @@
"onlyUpdatePeerDependentsWhenOutOfRange": true,
"updateInternalDependents": "always"
}
}
}
5 changes: 5 additions & 0 deletions .changeset/red-monkeys-sing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
---

Introduce `@canary` releases and change current LTS branch to `main-v4` to be used as
base branch for `@staging` and `@latest` releases until next major version is stable.
36 changes: 36 additions & 0 deletions .github/workflows/release-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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 == '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 canary
id: version-packages
run: npm run version:canary | tail -1 >> "$GITHUB_OUTPUT"

- name: Canary release
if: steps.version-packages.outputs.success == '1'
run: npm run release:canary
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ run-name: Production release PR
on:
push:
branches:
- main
- main-v4

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ run-name: Staging release from ${{ github.ref_name }}
on:
push:
branches:
- main
- main-v4

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
25 changes: 13 additions & 12 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
coverage
node_modules
dist
build
coverage
.cache
.changeset
.github
.idea
.vscode
.turbo
.next
.cache
.temp_integration
.turbo
.vscode
.yalc
.changeset
package-lock.json
playground
examples
/**/scripts/info.js
build
coverage
coverage
dist
examples
node_modules
package-lock.json
playground
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"nuke": "./scripts/nuke.sh",
"prepare": "husky install",
"release": "TURBO_FORCE=true FORCE_COLOR=1 npm run build -- --force && changeset publish && git push --follow-tags",
"release:canary": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && changeset publish --tag canary --no-git-tag",
"release:snapshot": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && changeset publish --tag snapshot --no-git-tag",
"release:staging": "TURBO_FORCE=true FORCE_COLOR=1 npm run build && changeset publish --tag staging --no-git-tag",
"release:verdaccio": "if [ \"$(npm config get registry)\" = \"https://registry.npmjs.org/\" ]; then echo 'Error: Using default registry' && exit 1; else TURBO_FORCE=true TURBO_CONCURRENCY=4 npm run build && changeset publish --no-git-tag; fi",
Expand All @@ -39,6 +40,7 @@
"turbo:clean": "turbo daemon clean",
"update:lockfile": "npm run nuke && npm install -D --arch=x64 --platform=linux turbo && npm install -D --arch=arm64 --platform=darwin turbo",
"version": "changeset version && ./scripts/version-info.sh",
"version:canary": "./scripts/canary.mjs",
"version:snapshot": "./scripts/snapshot.mjs",
"version:staging": "./scripts/staging.mjs",
"yalc:all": "for d in packages/*/; do echo $d; cd $d; yalc push --replace --sig; cd '../../'; done"
Expand Down
18 changes: 18 additions & 0 deletions scripts/canary.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env zx

import 'zx/globals';

import { constants } from './common.mjs';

await $`npx json -I -f ${constants.ChangesetConfigFile} -e "this.changelog = false"`;

const res = await $`npx changeset version --snapshot canary`;
const success = !res.stderr.includes('No unreleased changesets found');

await $`git checkout HEAD -- ${constants.ChangesetConfigFile}`;

if (success) {
echo('success=1');
} else {
echo('success=0');
}
Loading