Skip to content

ci: add 2nd-gen-only beta publish scope to publish workflow#6406

Open
Rajdeepc wants to merge 3 commits into
mainfrom
rajdeepchandra/ci-2nd-gen-beta-publish
Open

ci: add 2nd-gen-only beta publish scope to publish workflow#6406
Rajdeepc wants to merge 3 commits into
mainfrom
rajdeepchandra/ci-2nd-gen-beta-publish

Conversation

@Rajdeepc

Copy link
Copy Markdown
Contributor

Description

Adds a manual, scoped pre-release path to the Publish Packages workflow so a private beta of the 2nd-gen packages can be cut on demand without releasing 1st-gen.

  • New workflow_dispatch input scope (all | 2nd-gen). Defaults to all.
  • New workflow_dispatch input dry_run (boolean, default false) for the 2nd-gen scope; uses npm publish --dry-run so the build/version/pack can be validated without writing to npm.
  • When scope == 2nd-gen:
    • Only @spectrum-web-components/core and @adobe/spectrum-wc are packed (yarn pack, which resolves the workspace: protocol) and published with the chosen dist-tag.
    • core continues to use OIDC trusted publishing and @adobe/spectrum-wc the npm token, matching changeset publish behavior — so this must remain in publish.yml (same workflow file + npm-publish environment) for OIDC to keep matching.
    • 1st-gen steps (custom-elements manifest, build:confirm, React wrappers) are skipped, and 1st-gen is never published even when 1st-gen changesets are present.
    • The latest tag is rejected for this scope.
  • Fixes a pre-existing bash -e bug in check-changesets: the package-detection grep aborted the job whenever a changeset referenced only @spectrum-web-components/core (grep -v matches nothing and exits 1). Added || true.

This is backward compatible: the default all scope and the automatic push-to-main next release are unchanged; scope is only evaluated for manual runs.

The new scope/dry_run inputs only appear in the Run workflow UI once this is on main (the form is rendered from the default branch). Until then they can only be passed via gh workflow run --ref <branch> -f scope=2nd-gen.

Motivation and context

We are running a private (unannounced) beta of the 2nd-gen components through mid-July. Releases need to go out under the beta dist-tag for the 2nd-gen packages only, while 1st-gen continues its normal next/latest cadence from main. The existing workflow publishes every changeset-bumped package under a single tag, so it cannot scope a beta to 2nd-gen.

Related issue(s)

  • fixes [add Jira/issue number]

Author's checklist

  • I have read the CONTRIBUTING and PULL_REQUESTS documents.
  • I have reviewed the Accessibility Practices for this feature.
  • I have added automated tests to cover my changes.
  • I have included a well-written changeset if my change needs to be published.
  • I have included updated documentation if my change required it.

Manual review test cases

  • Dry run from the branch publishes nothing but validates packing

    1. gh workflow run publish.yml --ref rajdeepchandra/ci-2nd-gen-beta-publish -f tag=beta -f scope=2nd-gen -f dry_run=true
    2. Confirm check-changesets passes and the "Publish 2nd-gen packages only" step runs npm publish --dry-run for core + @adobe/spectrum-wc.
    3. Expect no 1st-gen steps to run and nothing written to npm.
  • Real 2nd-gen beta publishes only core + swc

    1. After merge, in Actions → Publish Packages → Run workflow, set dist-tag beta, scope 2nd-gen.
    2. Expect only @spectrum-web-components/core@…-beta-… and @adobe/spectrum-wc@…-beta-… on npm under the beta tag.
    3. Expect no 1st-gen packages or React wrappers published, even if 1st-gen changesets exist.

Accessibility testing checklist

Not applicable — this PR only changes CI/release automation (.github/workflows/publish.yml); there are no component, markup, or styling changes.

  • Keyboard — N/A (no UI changes)
  • Screen reader — N/A (no UI changes)

Made with Cursor

Rajdeep Chandra and others added 3 commits June 15, 2026 17:47
Add a manual `scope` input (all | 2nd-gen) to the Publish Packages
workflow so a private beta of the 2nd-gen packages can be cut on demand
without releasing 1st-gen.

When scope is `2nd-gen`, only @spectrum-web-components/core (OIDC trusted
publishing) and @adobe/spectrum-wc (npm token) are packed and published
under the chosen pre-release dist-tag; 1st-gen steps and React wrappers
are skipped, and the `latest` tag is rejected for this scope. The default
`all` scope and the automatic push-to-main `next` release are unchanged.

Co-authored-by: Cursor <cursoragent@cursor.com>
Allow the 2nd-gen-only scope to run with npm publish --dry-run so the
build, version, and pack steps can be validated from a feature branch
without writing to the npm registry.

Co-authored-by: Cursor <cursoragent@cursor.com>
The check-changesets step runs under `bash -e`, so the package-detection
grep aborted the job whenever a changeset referenced only
@spectrum-web-components/core (grep -v matches nothing and exits 1).
Add `|| true` so core-only and @adobe-only changesets are handled.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Rajdeepc Rajdeepc requested a review from a team as a code owner June 15, 2026 12:47
@changeset-bot

changeset-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: b8f8fcf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

📚 Branch Preview Links

🔍 First Generation Visual Regression Test Results

When a visual regression test fails (or has previously failed while working on this branch), its results can be found in the following URLs:

Deployed to Azure Blob Storage: pr-6406

If the changes are expected, update the current_golden_images_cache hash in the circleci config to accept the new images. Instructions are included in that file.
If the changes are unexpected, you can investigate the cause of the differences and update the code accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant