Skip to content

Commit ea97ad8

Browse files
ack
1 parent 0661574 commit ea97ad8

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

packages/@pglt/pglt/scripts/generate-packages.mjs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,14 @@ async function downloadBinary(platform, arch, os, releaseTag, githubToken) {
6464
console.log(`Downloaded asset for ${buildName} (v${releaseTag})`);
6565
}
6666

67-
async function overwriteManifestVersions(releaseTag) {
67+
async function overwriteManifestVersions(releaseTag, isPrerelease) {
68+
const version = getVersion(releaseTag, isPrerelease);
69+
6870
const manifestClone = structuredClone(rootManifest);
6971

70-
manifestClone.version = releaseTag;
72+
manifestClone.version = version;
7173
for (const key in manifestClone.optionalDependencies) {
72-
manifestClone.optionalDependencies[key] = releaseTag;
74+
manifestClone.optionalDependencies[key] = version;
7375
}
7476

7577
fs.writeFileSync(MANIFEST_PATH, JSON.stringify(manifestClone, null, 2));
@@ -174,19 +176,20 @@ function getOs(platform) {
174176
return platform.split("-").find((_, idx) => idx === 1);
175177
}
176178

179+
function getVersion(releaseTag, isPrerelease) {
180+
return releaseTag + (isPrerelease ? "-rc" : "");
181+
}
182+
177183
(async function main() {
178184
const githubToken = process.env.GITHUB_TOKEN;
179185
let releaseTag = process.env.RELEASE_TAG;
180186
assert(githubToken, "GITHUB_TOKEN not defined!");
181187
assert(releaseTag, "RELEASE_TAG not defined!");
182188

183189
const isPrerelease = process.env.PRERELEASE === "true";
184-
if (isPrerelease) {
185-
releaseTag += "-rc";
186-
}
187190

188191
await downloadSchema(releaseTag, githubToken);
189-
overwriteManifestVersions(releaseTag);
192+
overwriteManifestVersions(releaseTag, isPrerelease);
190193

191194
for (const platform of SUPPORTED_PLATFORMS) {
192195
const os = getOs(platform);

0 commit comments

Comments
 (0)