Skip to content
Merged
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c0da4d4
[poc] multiversion with changeset
art-alexeyenko Dec 23, 2025
8aceded
Add cascade versioning
art-alexeyenko Jan 12, 2026
0a80801
finalize base release flow
art-alexeyenko Jan 13, 2026
c46a675
Merge branch 'dev' of https://github.com/Sitecore/content-sdk into po…
art-alexeyenko Jan 13, 2026
a4f0360
Potential fix for code scanning alert no. 31: Workflow does not conta…
art-alexeyenko Jan 14, 2026
bab51e2
Potential fix for code scanning alert no. 30: Workflow does not conta…
art-alexeyenko Jan 14, 2026
b19119c
Prep-release flow for patch releases
art-alexeyenko Jan 14, 2026
5e36e5d
Merge branch 'dev' of https://github.com/Sitecore/content-sdk into po…
art-alexeyenko Jan 14, 2026
5813d32
custom canary dist tag for patches
art-alexeyenko Jan 14, 2026
d03d107
fix yarn lock
art-alexeyenko Jan 14, 2026
df9c9e3
Simplify both hotfix and latest release flows
art-alexeyenko Jan 15, 2026
dea91c0
Small cleanup across monorepo
art-alexeyenko Jan 15, 2026
0c1b571
Merge branch 'dev' of https://github.com/Sitecore/content-sdk into po…
art-alexeyenko Jan 15, 2026
de2a0ec
Better changelog management & wf fixes
art-alexeyenko Jan 16, 2026
c94396b
Better cascade version
art-alexeyenko Jan 16, 2026
925fe15
Integrate with new packages
art-alexeyenko Jan 19, 2026
1943e1c
better comments, naming and covered packages in actions. yarn lock fix
art-alexeyenko Jan 19, 2026
cf14b2c
Use preminor lerna version update after main publish
art-alexeyenko Jan 20, 2026
474ace2
Only patch cascade bumps for 'create-content-sdk` package
art-alexeyenko Jan 20, 2026
571733b
Split PR and publish actions
art-alexeyenko Jan 21, 2026
996be6e
Revert "Split PR and publish actions"
art-alexeyenko Jan 26, 2026
36a96db
Better hotfix prep "next steps" section
art-alexeyenko Jan 26, 2026
9237252
Fix release PR automerge. Fix release PR having merge conflicts
art-alexeyenko Feb 9, 2026
4d42264
Merge branch 'dev' of https://github.com/Sitecore/content-sdk into po…
art-alexeyenko Mar 15, 2026
0fbb984
fix yarn deps
art-alexeyenko Mar 16, 2026
0c4b614
Merge branch 'dev' of https://github.com/Sitecore/content-sdk into po…
art-alexeyenko Mar 18, 2026
2b96acc
apply caret version on create-content-sdk
art-alexeyenko Mar 18, 2026
75ed95a
yarn sync
art-alexeyenko Mar 18, 2026
eaec730
content-sdk specific changesets readme
art-alexeyenko Mar 19, 2026
32d1d7a
Alternative canary flow
art-alexeyenko Apr 8, 2026
1d9ff8a
Merge branch 'dev' of https://github.com/Sitecore/content-sdk into ch…
art-alexeyenko Apr 8, 2026
69f60c5
fix create* package name in hotfix prep
art-alexeyenko Apr 20, 2026
cf61d91
Unit test cascade versioning
art-alexeyenko May 4, 2026
7d50393
Merge branch 'dev' of https://github.com/Sitecore/content-sdk into ch…
art-alexeyenko May 4, 2026
606faa3
fix yarn
art-alexeyenko May 4, 2026
939df46
force typescript version in analytics-core
art-alexeyenko May 4, 2026
534545a
force typescript version in events, personalize
art-alexeyenko May 4, 2026
86dfe83
minor spelling mistake
art-alexeyenko May 5, 2026
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
10 changes: 10 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Changesets

Changesets allows flexible management of multiple packages in a monorepo

[Changeset docs](https://github.com/changesets/changesets)
[Common questions](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

Quick references:
- `yarn changeset` add a changeset for current changes.
- `yarn changeset:cascade-version` - apply version changes from current changesets onto the monrepo (usually runs via CI)
12 changes: 12 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"changelog": "../scripts/changesets/changelog.ts",
"commit": false,
"access": "public",
"baseBranch": "dev",
"ignore": [],
"snapshot": {
"useCalculatedVersion": true,
"prereleaseTemplate": "{tag}.{datetime}"
}
}
104 changes: 104 additions & 0 deletions .github/workflows/hotfix_release_prep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Prepare Hotfix Release

permissions:
contents: write

on:
workflow_dispatch:
inputs:
package_name:
description: 'Full package name'
required: true
type: choice
options:
- '@sitecore-content-sdk/nextjs'
- '@sitecore-content-sdk/cli'
- '@sitecore-content-sdk/react'
- '@sitecore-content-sdk/search'
- 'create-content-sdk'
Comment thread
art-alexeyenko marked this conversation as resolved.
Outdated
- '@sitecore-content-sdk/core'
- '@sitecore-content-sdk/content'
- '@sitecore-content-sdk/analytics-core'
- '@sitecore-content-sdk/events'
- '@sitecore-content-sdk/personalize'

version:
description: 'Base version to hotfix'
required: true
type: string

jobs:
prep-release:
runs-on: ubuntu-latest
steps:
- name: Generate GitHub App Token
id: generate-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
token: ${{ steps.generate-token.outputs.token }}

- name: Set git configuration
run: |
git config --global user.email builds@sitecore.com
git config --global user.name "content-sdk-bot"
git remote set-url origin https://x-access-token:${{ steps.generate-token.outputs.token }}@github.com/${{ github.repository }}

- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 24

- name: Setup GH action
id: setup-gh-action
run: |
BASE_RELEASE="${{ inputs.package_name }}@${{ inputs.version }}"

if ! git rev-parse "refs/tags/$BASE_RELEASE" >/dev/null 2>&1; then
echo "Release tag $BASE_RELEASE not found. Please validate your inputs."
exit 1
fi

echo "base_release=$BASE_RELEASE" >> $GITHUB_OUTPUT

- name: Create release branch
id: create-branch
run: |
BRANCH_NAME="release/${{ steps.setup-gh-action.outputs.base_release }}-hotfix"

if git ls-remote --heads origin "$BRANCH_NAME" | grep -q .; then
echo "Hotfix branch $BRANCH_NAME already exists"
echo "Please check if this is expected. Delete the branch and run action again if not."
exit 1
else
git checkout -b "$BRANCH_NAME" "${{ steps.setup-gh-action.outputs.base_release }}"
git push -u origin "$BRANCH_NAME"
echo "Branch $BRANCH_NAME created and pushed"
fi

- name: Summary
run: |
BRANCH_NAME="${{ steps.create-branch.outputs.branch_name }}"
BASE_RELEASE="${{ steps.setup-gh-action.outputs.base_release }}"

echo "## Release Branch Prepared" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Property | Value |" >> $GITHUB_STEP_SUMMARY
echo "|----------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| **Target Package** | \`$BASE_RELEASE\` |" >> $GITHUB_STEP_SUMMARY
echo "| **Release Branch** | \`$BRANCH_NAME\` |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Next Steps:" >> $GITHUB_STEP_SUMMARY
echo "1. Checkout the branch: \`git checkout $BRANCH_NAME\`" >> $GITHUB_STEP_SUMMARY
echo "2. Cherrypick or add patch changes" >> $GITHUB_STEP_SUMMARY
echo "3. Add changesets (\`yarn changeset\`)" >> $GITHUB_STEP_SUMMARY
echo "4. Prepare PR(s) with hotfix changes" >> $GITHUB_STEP_SUMMARY
echo "5. Push changes. This will update pre-patch canaries and automatically create the hotfix release PR" >> $GITHUB_STEP_SUMMARY
echo "6. Merge hotfix release PR to trigger the release" >> $GITHUB_STEP_SUMMARY
252 changes: 182 additions & 70 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,182 @@
name: Publish

on:
push:
branches:
- dev
- 'release/**'
paths:
- '**'

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
- name: Generate GitHub App Token
id: generate-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
persist-credentials: false
token: ${{ steps.generate-token.outputs.token }}

- name: Set git configuration
run: |
git config --global user.email builds@sitecore.com
git config --global user.name "content-sdk-bot"
git remote set-url origin https://x-access-token:${{ steps.generate-token.outputs.token }}@github.com/${{ github.repository }}

- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 24

- name: Install dependencies
run: |
yarn cache clean --all
yarn install --immutable

- name: Build packages
run: npm run build

- name: Generate API docs
run: |
yarn generate-docs
git add ./ref-docs/**/*
git commit -m "Update API docs"

- name: Pre-release version update
run: |
npx lerna version prerelease --exact --preid canary --force-publish --message "%s [skip ci]" --yes
env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }}

- name: Pre-release canary publish
run: |
echo //registry.npmjs.org/:_authToken=${NPM_TOKEN} > .npmrc
npx lerna publish from-git --exact --canary --pre-dist-tag canary --preid canary --no-verify-access --yes
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
name: Publish

permissions:
contents: read
pull-requests: write

on:
# Trigger for canary and stable releases:
# - Stable prod release: When PR from changeset-release/* branch is merged with [release] prefix
# - Canary release: Push to dev or release/* branches (not from changeset-release merge)
push:
branches:
- dev
- 'release/**'
paths:
- '**'

# changesets/action runs csdk:prep-release which consumes .changeset/*.md in that runner.
# Canary snapshot must run in a separate job with its own checkout so changesets still exist.
jobs:
stable-release-pre:
runs-on: ubuntu-latest
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
- name: Generate GitHub App Token
id: generate-token
uses: actions/create-github-app-token@v2
with:
app-id: ${{ secrets.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0
persist-credentials: false
token: ${{ steps.generate-token.outputs.token }}

- name: Set git configuration
run: |
git config --global user.email builds@sitecore.com
git config --global user.name "content-sdk-bot"
git remote set-url origin https://x-access-token:${{ steps.generate-token.outputs.token }}@github.com/${{ github.repository }}

- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 24

- name: Install dependencies
run: |
yarn cache clean --all
yarn install --immutable

- name: Build packages
run: npm run build

- name: Generate API docs
run: |
yarn generate-docs
if [ -n "$(git status --porcelain)" ]; then
git add ./ref-docs/**/*
git commit -m "Update API docs [skip ci]" || echo "⚠️ Failed to commit API docs (may already be committed)"
git push origin HEAD:${{ github.ref_name }} || echo "⚠️ Failed to push API docs (may already be pushed or no changes)"
else
echo "No API doc changes to commit"
fi

- name: Creating .npmrc
run: |
NPM_REGISTRY="${NPM_REGISTRY%/}"
NPM_REGISTRY="${NPM_REGISTRY}/"
write_npmrc() {
{
echo "@sitecore-content-sdk:registry=https://$NPM_REGISTRY"
echo "registry=https://$NPM_REGISTRY"
echo "//$NPM_REGISTRY:_authToken=$NPM_TOKEN"
} > "$1"
}
write_npmrc "$GITHUB_WORKSPACE/.npmrc"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_REGISTRY: ${{ secrets.NPM_REGISTRY }}

- name: Prepare and Process Changesets Release
id: changesets
uses: changesets/action@v1
with:
version: yarn csdk:prep-release
publish: yarn changeset:publish --tag latest
commit: '[release][ci] Version bump and changelog'
title: ${{ github.ref_name == 'dev' && '[csdk] latest release' || format('[csdk] patch release - {0}', github.ref_name) }}
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_REGISTRY: ${{ secrets.NPM_REGISTRY }}
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

canary-snapshot:
runs-on: ubuntu-latest
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0

- name: Use Node.js 24
uses: actions/setup-node@v4
with:
node-version: 24

- name: Install dependencies
run: |
yarn cache clean --all
yarn install --immutable

- name: Build packages
run: npm run build

- name: Creating .npmrc
Comment thread
art-alexeyenko marked this conversation as resolved.
run: |
NPM_REGISTRY="${NPM_REGISTRY%/}"
NPM_REGISTRY="${NPM_REGISTRY}/"
write_npmrc() {
{
echo "@sitecore-content-sdk:registry=https://$NPM_REGISTRY"
echo "registry=https://$NPM_REGISTRY"
echo "//$NPM_REGISTRY:_authToken=$NPM_TOKEN"
} > "$1"
}
write_npmrc "$GITHUB_WORKSPACE/.npmrc"
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_REGISTRY: ${{ secrets.NPM_REGISTRY }}

- name: Pre-release canary publish
id: canary_snapshot
run: yarn changeset:cascade-snapshot-version

- name: Compute snapshot npm dist-tag
id: snapshot_tag
if: steps.canary_snapshot.outputs.snapshot_publish == 'true'
uses: actions/github-script@v7
with:
script: |
const sha = context.sha;
const short = sha.slice(0, 7);
const { data } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
owner: context.repo.owner,
repo: context.repo.repo,
commit_sha: sha,
});
const prNums = data.map((p) => p.number).filter((n) => n != null);
const prLabel = prNums.length ? String(Math.max(...prNums)) : 'no-pr';
const tagPr = `canary.pr-${prLabel}`;
const tagSha = `canary.commit-${short}`;
core.setOutput('tag_pr', tagPr);
core.setOutput('tag_sha', tagSha);
core.info(`Snapshot npm dist-tags: ${tagPr} + ${tagSha}`);

- name: Publish canary snapshot packages to npm
if: steps.canary_snapshot.outputs.snapshot_publish == 'true'
env:
COMMIT_NPM_TAG: ${{ steps.snapshot_tag.outputs.tag_sha }}
PR_NPM_TAG: ${{ steps.snapshot_tag.outputs.tag_pr }}
run: |
BRANCH_NAME="${{ github.ref_name }}"
if [[ "$BRANCH_NAME" =~ ^release/ ]]; then
NPM_TAG="hotfix-canary"
else
NPM_TAG="canary"
fi
yarn changeset:publish --tag $NPM_TAG --no-git-tag
VERSION=$(node -p "require('./packages/create-content-sdk-app/package.json').version")
npm dist-tag add create-content-sdk-app@$VERSION $COMMIT_NPM_TAG
npm dist-tag add create-content-sdk-app@$VERSION $PR_NPM_TAG

3 changes: 1 addition & 2 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"lerna": "3.22.1",
"packages": ["packages/*", "samples/*"],
"version": "independent",
"npmClient": "yarn",
"useWorkspaces": true
"$schema": "node_modules/lerna/schemas/lerna-schema.json"
}

Loading
Loading