Skip to content

Commit 5481a15

Browse files
committed
Attempt to fix automated next releases
1 parent 88948b0 commit 5481a15

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

.github/workflows/canary.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,30 @@ jobs:
8888
run: |
8989
node - <<'NODE'
9090
const { execSync } = require('child_process');
91-
const versions = JSON.parse(process.env.VERSIONS || '{}');
91+
const info = JSON.parse(process.env.NPM_INFO || '{}');
9292
const pkgs = ['extension','extension-create','extension-develop'];
9393
for (const name of pkgs) {
94-
const expected = versions[name];
94+
const expected = info?.[name]?.version;
9595
if (!expected) continue;
9696
const tags = JSON.parse(execSync('npm view ' + name + ' dist-tags --json').toString());
97-
if (tags.next !== expected) {
98-
console.error(`[next] Dist-tag mismatch for ${name}: next=${tags.next} expected=${expected}`);
99-
process.exit(1);
97+
const isPrerelease = /-/.test(expected);
98+
if (isPrerelease) {
99+
if (tags.next !== expected) {
100+
console.error(`[next] Dist-tag mismatch for ${name}: next=${tags.next} expected=${expected}`);
101+
process.exit(1);
102+
}
103+
} else {
104+
if (!tags.next) {
105+
console.error(`[next] Dist-tag missing for ${name}: expected a 'next' tag to exist`);
106+
process.exit(1);
107+
}
108+
console.log(`[next] Skipping strict next match for ${name} (stable version ${expected}).`);
100109
}
101110
}
102111
console.log('Next dist-tags verified.');
103112
NODE
104113
env:
105-
VERSIONS: ${{ steps.versions.outputs.versions }}
114+
NPM_INFO: ${{ steps.npm.outputs.info }}
106115

107116
- name: Create deployment (next)
108117
if: ${{ !(github.event_name == 'workflow_dispatch' && inputs.dry_run) }}

0 commit comments

Comments
 (0)