Skip to content
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
56e4ee5
refactor: refactored release strategy
blunteshwar Jan 21, 2026
15293fb
chore: update publish workflows for 1st-gen and 2nd-gen
blunteshwar Jan 21, 2026
27a002e
chore: change default NPM dist-tag to 'snapshot-test' in publish work…
blunteshwar Jan 21, 2026
c9b45f3
chore: refine changeset backup logic in publish workflows for 1st-gen…
blunteshwar Jan 21, 2026
ea9c6ef
chore: minor fix
blunteshwar Jan 21, 2026
40bc802
chore: enable publishing in workflows and add changeset for @adobe/sp…
blunteshwar Jan 21, 2026
54c19ef
chore: remove private flag from swc package.json
blunteshwar Jan 21, 2026
7098a52
chore: migrated to trusted release for gen1
blunteshwar Jan 27, 2026
fb6021b
chore: update Node.js version to 20.17.0
blunteshwar Jan 27, 2026
091fc77
chore: update publish workflows for 1st-gen and 2nd-gen
blunteshwar Jan 27, 2026
f42a472
Merge branch 'main' into SWC-1405
blunteshwar Jan 27, 2026
f1ad6a7
chore: add push trigger for SWC-1405 branch in publish workflows
blunteshwar Jan 27, 2026
2f925a6
chore: update CODEOWNERS to specify file protections and maintainers …
blunteshwar Jan 27, 2026
cc8cee9
chore: replace 2nd-gen publish workflow with a unified publish workflow
blunteshwar Jan 29, 2026
ecc9239
chore: remove deprecated publish workflow for packages
blunteshwar Jan 29, 2026
800e373
chore: simplify CODEOWNERS by removing specific protections for workf…
blunteshwar Jan 29, 2026
96a07ff
chore: added "1st-gen/projects/*" to root package.json
blunteshwar Jan 29, 2026
e76d760
chore: add repository information to package.json in cem-plugin-react…
blunteshwar Jan 29, 2026
8958701
chore: update Node.js setup to use version from .nvmrc and refine pac…
blunteshwar Jan 29, 2026
b8cf8ff
chore: add "types" field to package.json for postcss-token
blunteshwar Jan 29, 2026
c983f5d
chore: brought upto main
blunteshwar Jan 29, 2026
1f5af05
Merge branch 'main' into SWC-1405
blunteshwar Jan 30, 2026
e958a57
chore: enhance publish workflow to check for 1st-gen changesets
blunteshwar Jan 30, 2026
ec9f1c0
chore: minor test
blunteshwar Feb 4, 2026
2bd5b2b
Merge branch 'SWC-1405' of github.com:adobe/spectrum-web-components i…
blunteshwar Feb 10, 2026
3c7be15
chore: removed linting errors
blunteshwar Feb 10, 2026
29390a5
chore: brought upto main
blunteshwar Feb 10, 2026
6622b8e
chore: mark css-custom-vars-viewer package as private
blunteshwar Feb 10, 2026
4233318
chore: update GitHub Actions workflow for NPM publishing and modify .…
blunteshwar Feb 16, 2026
921a7fc
chore: minor fix
blunteshwar Feb 16, 2026
8bd5faa
chore: refactor GitHub Actions workflow to separate changeset checks …
blunteshwar Feb 16, 2026
822a4ef
chore: add publish summary to GitHub Actions workflow for better visi…
blunteshwar Feb 16, 2026
5d6dbe3
chore: add support for SWC-1405 branch in GitHub Actions workflow
blunteshwar Feb 16, 2026
dae6c25
chore: adderessed feedback
blunteshwar Feb 16, 2026
653f689
Merge branch 'main' into SWC-1405
blunteshwar Feb 16, 2026
a36ef82
chore: minor fix
blunteshwar Feb 16, 2026
7f76948
chore: minor fix
blunteshwar Feb 16, 2026
5578a76
chore: minor fix
blunteshwar Feb 16, 2026
3af7742
chore: adderesed feedback
blunteshwar Feb 16, 2026
640b8e3
chore: added processing of stylesheets
blunteshwar Feb 16, 2026
b46e0c1
feat: add comprehensive publishing workflow documentation for Spectru…
blunteshwar Feb 16, 2026
25b6c9e
chore: brought upto main
blunteshwar Feb 17, 2026
b95c82f
chore: fixed linting errors
blunteshwar Feb 18, 2026
4f5812b
chore: brought upto main
blunteshwar Feb 18, 2026
a0ba779
chore: fixed linting errors
blunteshwar Feb 18, 2026
5eb6a33
chore: fixed linting errors
blunteshwar Feb 18, 2026
0606d70
Merge branch 'main' into SWC-1405
blunteshwar Feb 18, 2026
657ec08
feat: enhance publishing workflow to capture and display released pac…
blunteshwar Feb 18, 2026
bb55ab6
chore: remove outdated publishing workflow documentation
blunteshwar Feb 18, 2026
6954a44
chore: update package references in configuration and changelog
blunteshwar Feb 18, 2026
efd04ef
fix: correct package name for tag content color update
blunteshwar Feb 18, 2026
283048c
refactor: simplify prettier configuration loading in cem-plugin-react…
blunteshwar Feb 18, 2026
e85afa4
refactor: update genWrappers function signature
blunteshwar Feb 18, 2026
dbaf007
chore: update ESLint configuration to use dynamic path resolution for…
blunteshwar Feb 18, 2026
ab7ff71
chore: update ESLint rules for React wrappers to relax restrictions o…
blunteshwar Feb 18, 2026
21f3581
chore: remove current branch from publishing workflow
blunteshwar Feb 18, 2026
11fab32
chore: brought upto main
blunteshwar Feb 23, 2026
21db25f
chore: add concurrency settings to the publish workflow
blunteshwar Feb 23, 2026
7a638f8
chore: update .gitignore to include skills directory
blunteshwar Feb 23, 2026
79e2c6f
chore: remove skills directory from .gitignore
blunteshwar Feb 23, 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
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@spectrum-web-components/1st-gen",
"@spectrum-web-components/2nd-gen"
],
"linked": [["@adobe/swc", "@spectrum-web-components/core"]],
"linked": [["@adobe/spectrum-wc", "@spectrum-web-components/core"]],
"snapshot": {
"prereleaseTemplate": "{tag}.{datetime}",
"useCalculatedVersion": true
Expand Down
2 changes: 1 addition & 1 deletion .changeset/tag-content-color-fix.md
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this file is a result of a bad merge?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@spectrum-web-components/tag': patch
'@spectrum-web-components/tags': patch
'@spectrum-web-components/styles': patch
---

Expand Down
4 changes: 2 additions & 2 deletions .github/actions/setup-job/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ runs:
shell: bash
run: corepack enable

- name: Setup Node 20
- name: Setup Node from .nvmrc
uses: actions/setup-node@v4
with:
node-version: '20'
node-version-file: '.nvmrc'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'

Expand Down
49 changes: 0 additions & 49 deletions .github/workflows/preview-release.yml

This file was deleted.

315 changes: 315 additions & 0 deletions .github/workflows/publish-1st-gen.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, let's not forget to add a ticket to eventually change this to a more general publish.yml.

Original file line number Diff line number Diff line change
@@ -0,0 +1,315 @@
name: Publish Packages

on:
workflow_dispatch:
inputs:
tag:
description: 'NPM dist-tag (e.g., latest, beta, snapshot)'
required: false
default: 'next'
pull_request:
types: [labeled, synchronize]
push:
branches:
- main

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we be on the safer side here to prevent overlapping publish/version steps?
I think we can use the cancel-in-progress: false to avoid killing an in-flight publish halfway through.

Suggested change
concurrency:
group: publish-1st-gen-${{ github.ref }}
cancel-in-progress: false

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aaah Got it

concurrency:
group: publish-${{ github.ref }}
cancel-in-progress: false

jobs:
check-changesets:
runs-on: ubuntu-latest
if: >-
github.event_name == 'workflow_dispatch' ||
github.event_name == 'push' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'snapshot-release'))
outputs:
has_changesets: ${{ steps.check.outputs.has_changesets }}
has_1st_gen_changesets: ${{ steps.check.outputs.has_1st_gen_changesets }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check for changesets
id: check
run: |
if [ -z "$(ls -A .changeset/*.md 2>/dev/null | grep -v README)" ]; then
echo "has_changesets=false" >> $GITHUB_OUTPUT
echo "has_1st_gen_changesets=false" >> $GITHUB_OUTPUT
echo "No changesets found - skipping publish"
else
echo "has_changesets=true" >> $GITHUB_OUTPUT
CHANGESET_COUNT=$(ls -1 .changeset/*.md 2>/dev/null | grep -v README | wc -l | tr -d ' ')
echo "Found $CHANGESET_COUNT changesets"

# Check if any changeset mentions 1st-gen packages
# 1st-gen packages are @spectrum-web-components/* except core
HAS_1ST_GEN=false
for file in .changeset/*.md; do
if [ "$(basename "$file")" != "README.md" ]; then
PACKAGES=$(grep -oP "@spectrum-web-components/[a-z-]+" "$file")
NON_CORE=$(echo "$PACKAGES" | grep -v "^@spectrum-web-components/core$")
if [ -n "$NON_CORE" ]; then
HAS_1ST_GEN=true
break
fi
fi
done

echo "has_1st_gen_changesets=$HAS_1ST_GEN" >> $GITHUB_OUTPUT
if [ "$HAS_1ST_GEN" = "true" ]; then
echo "Found 1st-gen changesets - React wrappers will be built and published"
else
echo "No 1st-gen changesets found - React wrappers will be skipped"
fi
fi

publish:
needs: check-changesets
if: needs.check-changesets.outputs.has_changesets == 'true'
runs-on: ubuntu-latest
environment: npm-publish
permissions:
id-token: write # Required for OIDC trusted publishing (1st-gen )
contents: write # Required for git push
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup job and install dependencies
uses: ./.github/actions/setup-job

- name: Verify npm CLI version for trusted publishing
run: |
echo "Current npm version: $(npm --version)"
npx semver -r ">=11.5.1" "$(npm --version)" || {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we ever update our Node requirements (which we must because Node 20 is going out of life) this can be dropped!

echo "Upgrading npm for trusted publishing support (requires 11.5.1+)"
npm install -g npm@latest
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we avoid installing @latest? Can we pin to a good, known version? I'd prefer our workflow to be super deterministic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove once #6034 is merged

echo "Upgraded to npm version: $(npm --version)"
}

- name: Set Git identity
run: |
git config --global user.email "support+actions@github.com"
git config --global user.name "github-actions-bot"

- name: Determine release tag
id: extract-tag
env:
EVENT_NAME: ${{ github.event_name }}
INPUT_TAG: ${{ github.event.inputs.tag }}
run: |
if [ "$EVENT_NAME" == "pull_request" ]; then
# PRs with the snapshot-release label always use snapshot-test
WORKFLOW_TAG="snapshot-test"
elif [ -n "$INPUT_TAG" ]; then
# Use the tag provided via workflow_dispatch input
WORKFLOW_TAG="$INPUT_TAG"
else
# Default tag for push-triggered runs
WORKFLOW_TAG="next"
fi

echo "tag=$WORKFLOW_TAG" >> $GITHUB_OUTPUT
echo "Using npm tag: $WORKFLOW_TAG"

- name: Validate release tag
env:
TAG: ${{ steps.extract-tag.outputs.tag }}
GIT_REF: ${{ github.ref }}
run: |
if [ "$TAG" == "latest" ] && [ "$GIT_REF" != "refs/heads/main" ]; then
echo "ERROR: Cannot publish 'latest' from non-main branch"
exit 1
fi

- name: Verify OIDC token and configure NPM authentication
id: npm-auth
env:
NPM_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}
run: |
if [ -n "$ACTIONS_ID_TOKEN_REQUEST_URL" ]; then
echo "✓ OIDC token is available for 1st-gen trusted publishing"
else
echo "✗ OIDC token NOT available - trusted publishing will fail"
exit 1
fi

echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
echo "✓ NPM authentication configured for 2nd-gen (Adobe namespace)"

- name: Build all packages
run: yarn build

- name: Generate custom elements manifests
run: yarn workspace @spectrum-web-components/1st-gen custom-element-json

- name: Confirm build artifacts
run: yarn workspace @spectrum-web-components/1st-gen build:confirm

- name: Version packages
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.extract-tag.outputs.tag }}
run: |
if [ "$TAG" == "latest" ]; then
yarn workspace @spectrum-web-components/1st-gen changelog:global
yarn changeset version
else
yarn changeset version --snapshot $TAG
fi

- name: Capture released versions
id: versions
run: |
CORE_VERSION=$(node -p "require('./2nd-gen/packages/core/package.json').version")
BUNDLE_VERSION=$(node -p "require('./1st-gen/tools/bundle/package.json').version")
SWC_VERSION=$(node -p "require('./2nd-gen/packages/swc/package.json').version")
echo "core=$CORE_VERSION" >> $GITHUB_OUTPUT
echo "bundle=$BUNDLE_VERSION" >> $GITHUB_OUTPUT
echo "swc=$SWC_VERSION" >> $GITHUB_OUTPUT

- name: Refresh lockfile and rebuild
run: |
yarn install --refresh-lockfile
yarn build

- name: Publish all packages
if: steps.npm-auth.outcome == 'success'
env:
NODE_AUTH_TOKEN: ${{ secrets.ADOBE_BOT_NPM_TOKEN }}
TAG: ${{ steps.extract-tag.outputs.tag }}
run: |
# Changeset publishes all packages (1st-gen, core, and 2nd-gen)
# npm CLI automatically uses:
# - OIDC trusted publishing for 1st-gen packages (configured on npmjs.com)
# - Token authentication for 2nd-gen (from .npmrc)
if [ "$TAG" == "latest" ]; then
yarn changeset publish --no-git-tag
else
yarn changeset publish --no-git-tag --tag $TAG
fi

- name: Build React wrappers
if: needs.check-changesets.outputs.has_1st_gen_changesets == 'true'
run: yarn workspace @spectrum-web-components/1st-gen build:react

- name: Publish React wrappers
if: needs.check-changesets.outputs.has_1st_gen_changesets == 'true'
env:
TAG: ${{ steps.extract-tag.outputs.tag }}
run: |
if [ "$TAG" == "latest" ]; then
PUBLISH_CMD="npm publish --access public"
else
PUBLISH_CMD="npm publish --tag $TAG --access public"
fi

# Retry function with exponential backoff
retry_publish() {
local dir=$1
local max_attempts=3
local attempt=1

while [ $attempt -le $max_attempts ]; do
echo "Publishing $dir (attempt $attempt/$max_attempts)..."
if (cd "$dir" && $PUBLISH_CMD); then
echo "✓ Successfully published $dir"
return 0
else
if [ $attempt -lt $max_attempts ]; then
local wait_time=$((2 ** attempt))
echo "✗ Publish failed, retrying in ${wait_time}s..."
sleep $wait_time
else
echo "✗ Failed to publish $dir after $max_attempts attempts"
return 1
fi
fi
attempt=$((attempt + 1))
done
}

cd 1st-gen/react
for dir in */; do
retry_publish "$dir" || exit 1
done

- name: Publish summary
if: always()
env:
TAG: ${{ steps.extract-tag.outputs.tag }}
EVENT_NAME: ${{ github.event_name }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
HEAD_REF: ${{ github.head_ref }}
BASE_REF: ${{ github.base_ref }}
REF_NAME: ${{ github.ref_name }}
ACTOR: ${{ github.actor }}
COMMIT_SHA: ${{ github.sha }}
AUTH_OUTCOME: ${{ steps.npm-auth.outcome }}
CORE_VERSION: ${{ steps.versions.outputs.core }}
BUNDLE_VERSION: ${{ steps.versions.outputs.bundle }}
SWC_VERSION: ${{ steps.versions.outputs.swc }}
run: |
echo "## Publish summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

if [ "$EVENT_NAME" == "pull_request" ]; then
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| **Trigger** | Pull request |" >> $GITHUB_STEP_SUMMARY
echo "| **PR** | #${PR_NUMBER} — ${PR_TITLE} |" >> $GITHUB_STEP_SUMMARY
echo "| **Branch** | \`${HEAD_REF}\` → \`${BASE_REF}\` |" >> $GITHUB_STEP_SUMMARY
echo "| **NPM tag** | \`${TAG}\` |" >> $GITHUB_STEP_SUMMARY
echo "| **Author** | @${PR_AUTHOR} |" >> $GITHUB_STEP_SUMMARY
elif [ "$EVENT_NAME" == "workflow_dispatch" ]; then
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| **Trigger** | Manual dispatch |" >> $GITHUB_STEP_SUMMARY
echo "| **Branch** | \`${REF_NAME}\` |" >> $GITHUB_STEP_SUMMARY
echo "| **NPM tag** | \`${TAG}\` |" >> $GITHUB_STEP_SUMMARY
echo "| **Actor** | @${ACTOR} |" >> $GITHUB_STEP_SUMMARY
else
echo "| Field | Value |" >> $GITHUB_STEP_SUMMARY
echo "|-------|-------|" >> $GITHUB_STEP_SUMMARY
echo "| **Trigger** | Push |" >> $GITHUB_STEP_SUMMARY
echo "| **Branch** | \`${REF_NAME}\` |" >> $GITHUB_STEP_SUMMARY
echo "| **NPM tag** | \`${TAG}\` |" >> $GITHUB_STEP_SUMMARY
echo "| **Commit** | \`${COMMIT_SHA}\` |" >> $GITHUB_STEP_SUMMARY
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

core @spectrum-web-components/core version: 1.12.0-next.20260216160808
1st gen @spectrum-web-components/bundle ...
2nd gen @spectrum-wc ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

fi

if [ -n "$CORE_VERSION" ] || [ -n "$BUNDLE_VERSION" ] || [ -n "$SWC_VERSION" ]; then
echo "## Versions released" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "| Generation | Package | Version |" >> $GITHUB_STEP_SUMMARY
echo "|------------|---------|---------|" >> $GITHUB_STEP_SUMMARY
[ -n "$CORE_VERSION" ] && echo "| Core | \`@spectrum-web-components/core\` | \`${CORE_VERSION}\` |" >> $GITHUB_STEP_SUMMARY
[ -n "$BUNDLE_VERSION" ] && echo "| 1st gen | \`@spectrum-web-components/bundle\` | \`${BUNDLE_VERSION}\` |" >> $GITHUB_STEP_SUMMARY
[ -n "$SWC_VERSION" ] && echo "| 2nd gen | \`@adobe/spectrum-wc\` | \`${SWC_VERSION}\` |" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
fi

if [ "$AUTH_OUTCOME" == "success" ]; then
echo "✅ Publish completed with tag \`${TAG}\`" >> $GITHUB_STEP_SUMMARY
else
echo "❌ Publish failed — NPM authentication did not succeed" >> $GITHUB_STEP_SUMMARY
fi

- name: Commit and push changes
if: steps.extract-tag.outputs.tag == 'latest'
run: |
git add .
git commit -m "chore: release packages #publish" || echo "No changes to commit"
git push

- name: Create git tag
if: steps.extract-tag.outputs.tag == 'latest'
run: node ./1st-gen/scripts/create-git-tag.js
Loading
Loading