Skip to content

Commit a9de975

Browse files
arminazimiclaude
andauthored
ci(release): use the scoped package name after publish (#42)
* ci(release): use the scoped package name in release smoke and verify steps The rename left unscoped offing@<version> in the post-publish smoke, provenance, gitlab-sync and quickstart checks. The unscoped name is not this package, so the v0.1.0 smoke waited for a version that never appears. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * test(release): expect the scoped package name in the smoke steps Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent fbfe88e commit a9de975

6 files changed

Lines changed: 13 additions & 13 deletions

File tree

‎.github/scripts/quickstart-smoke.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ if ((mode !== "--published" && mode !== "--local") || !target) {
1818

1919
const windows = process.platform === "win32";
2020
const command =
21-
mode === "--published" ? ["npx", "--yes", `offing@${target}`] : ["node", target];
21+
mode === "--published" ? ["npx", "--yes", `@velella/offing@${target}`] : ["node", target];
2222

2323
function run(args) {
2424
const [program, ...rest] = command;

‎.github/workflows/gitlab-sync.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ jobs:
3737
run: |
3838
version="${GITHUB_REF_NAME#v}"
3939
for _ in $(seq 1 "$POLL_ATTEMPTS"); do
40-
if [ "$(npm view "offing@${version}" version 2>/dev/null)" = "$version" ]; then exit 0; fi
40+
if [ "$(npm view "@velella/offing@${version}" version 2>/dev/null)" = "$version" ]; then exit 0; fi
4141
sleep "$POLL_INTERVAL_SECONDS"
4242
done
4343
minutes=$((POLL_ATTEMPTS * POLL_INTERVAL_SECONDS / 60))
44-
echo "offing@${version} is not on npm after ${minutes} minutes; the component's pinned package would not install." >&2
44+
echo "@velella/offing@${version} is not on npm after ${minutes} minutes; the component's pinned package would not install." >&2
4545
exit 1
4646
- name: Push to GitLab
4747
env:

‎.github/workflows/publish.yml‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ jobs:
4343
# npm says a new version "may take a few minutes to become available"; 0.2.0 took longer than the
4444
# first ten-attempt wait of 2.5 minutes, so wait up to ten minutes.
4545
for attempt in $(seq 1 40); do
46-
if npm view "offing@$version" version >/dev/null 2>&1; then exit 0; fi
46+
if npm view "@velella/offing@$version" version >/dev/null 2>&1; then exit 0; fi
4747
echo "Attempt $attempt: $version is not visible yet."
4848
sleep 15
4949
done
50-
echo "offing@$version never appeared on the registry." >&2
50+
echo "@velella/offing@$version never appeared on the registry." >&2
5151
exit 1
5252
- name: Run the published package on a small fixture
5353
# Run from a temporary directory: inside the checkout, npx would resolve this repository's own bin.
@@ -56,7 +56,7 @@ jobs:
5656
version="${GITHUB_REF_NAME#v}"
5757
mkdir -p "$RUNNER_TEMP/offing-smoke"
5858
cp "$GITHUB_WORKSPACE/tests/fixtures/smoke/package.json.fixture" "$RUNNER_TEMP/offing-smoke/package.json"
59-
node "$GITHUB_WORKSPACE/.github/scripts/smoke.mjs" "$RUNNER_TEMP/offing-smoke" -- npx --yes "offing@$version"
59+
node "$GITHUB_WORKSPACE/.github/scripts/smoke.mjs" "$RUNNER_TEMP/offing-smoke" -- npx --yes "@velella/offing@$version"
6060
6161
# The release fails if the npm attestation is missing or does not match the published tarball.
6262
# npm generates it during trusted publishing on a GitHub-hosted runner, so the builder identity
@@ -78,10 +78,10 @@ jobs:
7878
TAG: ${{ github.ref_name }}
7979
run: |
8080
version="${TAG#v}"
81-
curl -fsSL --retry 3 -o package.tgz "$(npm view "offing@$version" dist.tarball)"
82-
url="$(npm view "offing@$version" --json | jq -r '.dist.attestations.url')"
81+
curl -fsSL --retry 3 -o package.tgz "$(npm view "@velella/offing@$version" dist.tarball)"
82+
url="$(npm view "@velella/offing@$version" --json | jq -r '.dist.attestations.url')"
8383
if [ -z "$url" ] || [ "$url" = "null" ]; then
84-
echo "offing@$version has no npm provenance attestation." >&2
84+
echo "@velella/offing@$version has no npm provenance attestation." >&2
8585
exit 1
8686
fi
8787
curl -fsSL --retry 3 -o attestations.json "$url"

‎.github/workflows/release-smoke.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
working-directory: ${{ runner.temp }}
5454
env:
5555
VERSION: ${{ steps.release.outputs.version }}
56-
run: npx --yes "offing@$VERSION" scan "$GITHUB_WORKSPACE" --json > "$RUNNER_TEMP/published.json"
56+
run: npx --yes "@velella/offing@$VERSION" scan "$GITHUB_WORKSPACE" --json > "$RUNNER_TEMP/published.json"
5757
- name: Compare the summaries
5858
run: node .github/scripts/release-smoke.mjs "$RUNNER_TEMP/built.json" "$RUNNER_TEMP/published.json"
5959

@@ -115,6 +115,6 @@ jobs:
115115
node "$GITHUB_WORKSPACE/.github/scripts/smoke.mjs" "$dir" -- node "$cli"
116116
node "$GITHUB_WORKSPACE/.github/scripts/quickstart-smoke.mjs" --local "$cli"
117117
else
118-
node "$GITHUB_WORKSPACE/.github/scripts/smoke.mjs" "$dir" -- npx --yes "offing@$VERSION"
118+
node "$GITHUB_WORKSPACE/.github/scripts/smoke.mjs" "$dir" -- npx --yes "@velella/offing@$VERSION"
119119
node "$GITHUB_WORKSPACE/.github/scripts/quickstart-smoke.mjs" --published "$VERSION"
120120
fi

‎tests/release-smoke.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ test("the release workflow compares the published package with the build after a
7070
const job = smoke.jobs["published-scan"]!;
7171
assert.match(job.if!, /!inputs\.dry_run/);
7272
const commands = job.steps.map((step) => step.run ?? "").join("\n");
73-
assert.match(commands, /npx --yes "offing@\$VERSION" scan/);
73+
assert.match(commands, /npx --yes "@velella\/offing@\$VERSION" scan/);
7474
assert.match(commands, /dist\/src\/cli\.js scan/);
7575
assert.match(commands, /release-smoke\.mjs/);
7676
assert.equal(job.permissions, undefined, "inherits the read-only workflow permissions");

‎tests/smoke.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ test("the publish workflow runs the smoke script on a fresh job after publishing
5656
assert.deepEqual(smokeJob.permissions, { contents: "read" });
5757
const step = smokeJob.steps.find((item) => item.run?.includes("smoke.mjs"));
5858
assert.ok(step, "a step runs smoke.mjs");
59-
assert.match(step.run!, /npx --yes "offing@\$version"/);
59+
assert.match(step.run!, /npx --yes "@velella\/offing@\$version"/);
6060
assert.match(
6161
step["working-directory"] ?? "",
6262
/runner\.temp/,

0 commit comments

Comments
 (0)