Skip to content

Commit a580877

Browse files
authored
Fix verify release assets (dyad-sh#699)
1 parent e4b763a commit a580877

1 file changed

Lines changed: 24 additions & 4 deletions

File tree

‎scripts/verify-release-assets.js‎

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,34 @@ async function verifyReleaseAssets() {
5959
console.log(`📦 Found ${assets.length} assets in release ${tagName}`);
6060
console.log(`📄 Release status: ${release.draft ? "DRAFT" : "PUBLISHED"}`);
6161

62-
// Define expected assets
62+
// Handle different beta naming conventions across platforms
63+
const normalizeVersionForPlatform = (version, platform) => {
64+
if (!version.includes("beta")) {
65+
return version;
66+
}
67+
68+
switch (platform) {
69+
case "rpm":
70+
case "deb":
71+
// RPM and DEB use dots: 0.14.0-beta.1 -> 0.14.0.beta.1
72+
return version.replace("-beta.", ".beta.");
73+
case "nupkg":
74+
// NuGet removes the dot: 0.14.0-beta.1 -> 0.14.0-beta1
75+
return version.replace("-beta.", "-beta");
76+
default:
77+
// Windows installer and macOS zips keep original format
78+
return version;
79+
}
80+
};
81+
82+
// Define expected assets with platform-specific version handling
6383
const expectedAssets = [
64-
`dyad-${version}-1.x86_64.rpm`,
65-
`dyad-${version}-full.nupkg`,
84+
`dyad-${normalizeVersionForPlatform(version, "rpm")}-1.x86_64.rpm`,
85+
`dyad-${normalizeVersionForPlatform(version, "nupkg")}-full.nupkg`,
6686
`dyad-${version}.Setup.exe`,
6787
`dyad-darwin-arm64-${version}.zip`,
6888
`dyad-darwin-x64-${version}.zip`,
69-
`dyad_${version}_amd64.deb`,
89+
`dyad_${normalizeVersionForPlatform(version, "deb")}_amd64.deb`,
7090
"RELEASES",
7191
];
7292

0 commit comments

Comments
 (0)