Skip to content

Commit

Permalink
chore(repo): Rename @staging tag to @canary (#2015)
Browse files Browse the repository at this point in the history
* chore(repo): Change "@staging" tag to "@canary"

* fix(repo): Fix linting of root script files

* fix(repo): Fix accounts staging release script name

* Update curvy-mails-rhyme.md

* chore(*): Update package-lock.json
  • Loading branch information
anagstef authored Nov 6, 2023
1 parent 97407d8 commit 791c498
Show file tree
Hide file tree
Showing 12 changed files with 394 additions and 521 deletions.
6 changes: 6 additions & 0 deletions .changeset/curvy-mails-rhyme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@clerk/clerk-js': patch
'@clerk/shared': patch
---

Rename the @staging tag to @canary. Drop support for @next tag.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Staging release
run-name: Staging release from ${{ github.ref_name }}
name: Canary release
run-name: Canary release from ${{ github.ref_name }}

on:
push:
Expand All @@ -11,7 +11,7 @@ concurrency:
cancel-in-progress: true

jobs:
staging-release:
canary-release:
if: ${{ github.repository == 'clerk/javascript' }}
runs-on: ${{ vars.RUNNER_NORMAL }}
timeout-minutes: ${{ fromJSON(vars.TIMEOUT_MINUTES_NORMAL) }}
Expand All @@ -29,13 +29,13 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

- name: Version packages for staging
- name: Version packages for canary
id: version-packages
run: npm run version:staging | tail -1 >> "$GITHUB_OUTPUT"
run: npm run version:canary | tail -1 >> "$GITHUB_OUTPUT"

- name: Staging release
- name: Canary release
if: steps.version-packages.outputs.success == '1'
run: npm run release:staging
run: npm run release:canary
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
Expand All @@ -51,18 +51,18 @@ jobs:
const clerkjsVersion = require('./packages/clerk-js/package.json').version;
const nextjsVersion = require('./packages/nextjs/package.json').version;
if (clerkjsVersion.includes('staging')) {
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-staging-clerkjs-proxy.yml',
workflow_id: 'release-canary-clerkjs-proxy.yml',
ref: 'main',
inputs: { version: clerkjsVersion }
})
}
if (nextjsVersion.includes('staging')) {
if (nextjsVersion.includes('canary')) {
console.log('clerk/nextjs changed, will notify clerk/accounts');
github.rest.actions.createWorkflowDispatch({
owner: 'clerk',
Expand Down
16 changes: 8 additions & 8 deletions docs/CICD.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

## TLDR (day-to-day dev flow)

Every time a PR is merged into `main`, an automated staging release will happen. Once the packages are pushed to `npm`, the following actions will take place:
Every time a PR is merged into `main`, an automated canary release will happen. Once the packages are pushed to `npm`, the following actions will take place:

- The staging `clerkjs-proxy` worker will start serving the most recent `@staging` version of `@clerk/clerk-js`, completely bypassing any Cloudflare and JSDeliver edge caches.
- The staging Accounts project will be deployed using the most recent `@staging` version of `@clerk/nextjs`.
- The canary `clerkjs-proxy` worker will start serving the most recent `@canary` version of `@clerk/clerk-js`, completely bypassing any Cloudflare and JSDeliver edge caches.
- The canary Accounts project will be deployed using the most recent `@canary` version of `@clerk/nextjs`.

## Stable releases

Expand All @@ -17,16 +17,16 @@ Actions that will be triggered:

For more details, refer to [PUBLISH.md](https://github.com/clerk/javascript/blob/main/docs/PUBLISH.md).

## Automated staging releases
## Automated canary releases

A staging release will be triggered every time PR is merged into `main`. Once versioning and publishing is done, the `clerk/javascript` repo will dispatch a workflow event, notifying other related Clerk repos of the new releases.
A canary release will be triggered every time PR is merged into `main`. Once versioning and publishing is done, the `clerk/javascript` repo will dispatch a workflow event, notifying other related Clerk repos of the new releases.

Actions that will be triggered:

- `clerk/cloudflare-workers`: The latest clerk-js versions in `clerkjs-proxy/wrangler.toml` will be updated and directly committed to `main`. A second workflow will perform a staging release of the `clerkjs-proxy` worker.
- `clerk/accounts`: A new Accounts deployment will take place, using the most recent staging `@clerk/nextjs` version. This change will not be committed to `main`.
- `clerk/cloudflare-workers`: The latest clerk-js versions in `clerkjs-proxy/wrangler.toml` will be updated and directly committed to `main`. A second workflow will perform a canary release of the `clerkjs-proxy` worker.
- `clerk/accounts`: A new Accounts deployment will take place, using the most recent canary `@clerk/nextjs` version. This change will not be committed to `main`.

For more details about staging releases, refer to [PUBLISH.md](https://github.com/clerk/javascript/blob/main/docs/PUBLISH.md).
For more details about canary releases, refer to [PUBLISH.md](https://github.com/clerk/javascript/blob/main/docs/PUBLISH.md).

## Quality checks

Expand Down
10 changes: 5 additions & 5 deletions docs/PUBLISH.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ Every time a PR is merged into `main`, the changesets action parses all changese

To release a new stable version of all Clerk packages, find the "Version Packages" PR, verify the changes, and merge it.

## Publishing staging package versions (`@staging`)
## Publishing canary package versions (`@canary`)

An automated staging release will be take place every time a PR gets merged into `main`.
An automated canary release will be take place every time a PR gets merged into `main`.

- Staging versions use the following format: `@clerk/[email protected]staging.commit`, where `package` is the package name, `x`,`y`,`z` are the major, minor and patch versions respectively, `staging` is a stable prerelease mame and `commit` is the id of the last commit in the branch.
- Currently, staging version changes are _not_ committed to the repo and no git tags will be generated. Using this strategy, we avoid merge conflicts, allowing us to constantly deploy staging versions without switching the repo to a "prerelease" mode.
- During a staging release, `@clerk/clerk-js` will also be released. If needed, use the `clerkJSVersion` prop to use a specific version, eg: `<ClerkProvider clerkJSVersion='4.1.1-staging.90012' />`
- Staging versions use the following format: `@clerk/[email protected]canary.commit`, where `package` is the package name, `x`,`y`,`z` are the major, minor and patch versions respectively, `canary` is a stable prerelease mame and `commit` is the id of the last commit in the branch.
- Currently, canary version changes are _not_ committed to the repo and no git tags will be generated. Using this strategy, we avoid merge conflicts, allowing us to constantly deploy canary versions without switching the repo to a "prerelease" mode.
- During a canary release, `@clerk/clerk-js` will also be released. If needed, use the `clerkJSVersion` prop to use a specific version, eg: `<ClerkProvider clerkJSVersion='4.1.1-canary.90012' />`
- A package will not be published if it's not affected by a changeset.

## Publishing snapshot package versions (`@snapshot`)
Expand Down
Loading

0 comments on commit 791c498

Please sign in to comment.