Skip to content
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
13 changes: 10 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1946,9 +1946,16 @@ jobs:
# ──────────────────────────────────────────────────────────────────────
# The publish itself. `pnpm run release` = build (both scopes; the turbo
# cache makes it the build above) + console:build (the Console dist into
# packages/console) + scripts/release-publish.sh, which is `changeset
# publish` followed by ONE atomic `git push origin --tags` (#2191: the action's concurrent per-tag
# pushes raced GitHub's ref backend and lost ~half the tags).
# packages/console) + scripts/release-publish.sh, which runs, in order:
# 1. `node ui/scripts/check-published-dist-tooling.mjs --no-build`, which
# refuses the publish when a published @object-ui package carries
# tooling material (a test, a mock, a `*.tsbuildinfo`) or has no build
# output. `--no-build` because the build above is what gets packed,
# so the scan reads exactly those artifacts;
# 2. `changeset publish`, with npm's own per-package answers recorded for
# scripts/release-verify-npm.mjs, which this step runs next;
# 3. ONE atomic `git push origin --tags` (#2191: the action's concurrent
# per-tag pushes raced GitHub's ref backend and lost ~half the tags).
#
# changesets/action is NOT used here, and that is deliberate: handed a
# workspace with pending changesets it would take the VERSION path and mint
Expand Down
1 change: 0 additions & 1 deletion ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@
"changeset:check": "node scripts/check-changeset-fixed.mjs && node scripts/check-changeset-no-major.mjs",
"changeset": "changeset",
"changeset:version": "changeset version",
"changeset:publish": "node scripts/check-published-dist-tooling.mjs && changeset publish",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"test:e2e:live": "playwright test --config=playwright.live.config.ts",
Expand Down
24 changes: 17 additions & 7 deletions ui/scripts/__tests__/check-published-dist-tooling.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -503,13 +503,23 @@ describe('wiring', () => {

it('runs on the publish path, before anything is published', () => {
// The ruling (objectui#4846 comment 5307574139) put the gate where the harm
// materialises. `changeset:publish` is the command `changesets/action` runs
// to push tarballs to npm, so a red gate stops the publish itself rather
// than reporting after the fact.
expect(manifest.scripts['changeset:publish']).toContain(GATE);
expect(manifest.scripts['changeset:publish'].indexOf(GATE)).toBeLessThan(
manifest.scripts['changeset:publish'].indexOf('changeset publish'),
);
// materialises. The release publishes through the workspace root's
// `release` script (release.yml's publish step runs `pnpm run release`),
// whose last command is `scripts/release-publish.sh`; that script runs the
// gate with `--no-build` and refuses to go on when it is red, before
// `changeset publish` packs a single tarball. So a red gate stops the
// publish itself rather than reporting after the fact. Comment lines are
// dropped first: the script's header names `changeset publish` in prose.
// `repoRoot` in this file is the objectui root, `ui/` under the monorepo.
const workspace = workspaceRoot(repoRoot);
const scripts = rootManifest(repoRoot).scripts as Record<string, string>;
expect(scripts.release.endsWith(' && bash scripts/release-publish.sh')).toBe(true);
const publish = withoutComments(fs.readFileSync(path.join(workspace, 'scripts/release-publish.sh'), 'utf8'));
const gate = `node ${path.relative(workspace, path.join(repoRoot, GATE))} --no-build`;
expect(publish).toMatch(new RegExp(`^if ! ${gate.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}; then$`, 'm'));
const publishAt = publish.search(/^changeset publish\b/m);
expect(publishAt).toBeGreaterThan(-1);
expect(publish.indexOf(gate)).toBeLessThan(publishAt);
});

// The full-battery half (objectstack#26717). objectui scheduled the scan
Expand Down
Loading