Skip to content

Commit 86d0a64

Browse files
committed
ci: create GitHub Release after both registries and repair missing assets
1 parent 988ab97 commit 86d0a64

2 files changed

Lines changed: 25 additions & 7 deletions

File tree

‎.github/scripts/marketplace-pre-release-history.test.js‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,19 @@ function splitJobs(options) {
357357
}));
358358
}
359359

360+
test('split jobs: re-running only the failed registry job completes the publication', async () => {
361+
const prior = run(820, '2026-10-05', 'sha-a');
362+
const current = run(821, '2026-10-06', 'sha-a');
363+
const firstAttempt = splitJobs({ openVsxConclusion: 'failure' });
364+
const retriedOpenVsx = { ...splitJobs()[1], run_attempt: 2 };
365+
const jobs = [...firstAttempt, retriedOpenVsx];
366+
assert.equal(completedBothRegistries(firstAttempt), false);
367+
assert.equal(completedBothRegistries(jobs), true);
368+
assert.deepEqual(await decide(current, [prior, current], new Map([['820', jobs]])), {
369+
publish: false, date: '2026-10-06', reason: 'unchanged',
370+
});
371+
});
372+
360373
for (const [format, jobsFor] of [['split jobs', splitJobs], ['old combined job', (options) => [publishJob(options)]]]) {
361374
test(`${format}: both registries succeeded suppress unchanged SHA`, async () => {
362375
const prior = run(800, '2026-10-05', 'sha-a');

‎.github/workflows/release.yml‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ jobs:
3434
name: Release
3535
env:
3636
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
needs: verify
37+
# Create the GitHub Release only after both registries have the version.
38+
needs:
39+
- publish-vs-marketplace
40+
- publish-open-vsx
3841
runs-on: ubuntu-latest
3942
permissions:
4043
contents: write
@@ -51,13 +54,15 @@ jobs:
5154
VERSION=${GITHUB_REF#refs/tags/v}
5255
mv artifacts/vscode-R.vsix "artifacts/r-$VERSION.vsix"
5356
if gh release view "v$VERSION" >/dev/null 2>&1; then
54-
echo "Release v$VERSION already exists; skipping creation."
55-
exit 0
57+
# A previous attempt may have created the release without the asset.
58+
echo "Release v$VERSION already exists; uploading the VSIX."
59+
gh release upload "v$VERSION" "artifacts/r-$VERSION.vsix" --clobber
60+
else
61+
gh release create "v$VERSION" "artifacts/r-$VERSION.vsix" \
62+
--title "v$VERSION" \
63+
--notes "Release v$VERSION" \
64+
--generate-notes
5665
fi
57-
gh release create "v$VERSION" "artifacts/r-$VERSION.vsix" \
58-
--title "v$VERSION" \
59-
--notes "Release v$VERSION" \
60-
--generate-notes
6166
6267
publish-vs-marketplace:
6368
name: Publish to Visual Studio Marketplace

0 commit comments

Comments
 (0)