Skip to content

Commit

Permalink
ci: fix nightly version and restore update of manifest (#2953)
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed May 23, 2024
1 parent af70ac2 commit 125f34b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
29 changes: 29 additions & 0 deletions packages/@biomejs/biome/scripts/generate-packages.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,35 @@ function copyBinaryToNativePackage(platform, arch) {
const os = platform.split("-")[0];
const buildName = getName(platform, arch);
const packageRoot = resolve(PACKAGES_ROOT, buildName);
const packageName = `@biomejs/${buildName}`;

// Update the package.json manifest
const { version, license, repository, engines, homepage } = rootManifest;

const manifest = JSON.stringify(
{
name: packageName,
version,
license,
repository,
engines,
homepage,
os: [os],
cpu: [arch],
libc:
os === "linux"
? packageName.endsWith("musl")
? ["musl"]
: ["glibc"]
: undefined,
},
null,
2,
);

const manifestPath = resolve(packageRoot, "package.json");
console.log(`Update manifest ${manifestPath}`);
fs.writeFileSync(manifestPath, manifest);

// Copy the CLI binary
const ext = os === "win32" ? ".exe" : "";
Expand Down
6 changes: 3 additions & 3 deletions packages/@biomejs/biome/scripts/update-nightly-version.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import * as fs from "node:fs";
import { resolve } from "node:path";
import { fileURLToPath } from "node:url";

const ROMECLI_ROOT = resolve(fileURLToPath(import.meta.url), "../..");
const MANIFEST_PATH = resolve(ROMECLI_ROOT, "package.json");
const BIOME_CLI_ROOT = resolve(fileURLToPath(import.meta.url), "../..");
const MANIFEST_PATH = resolve(BIOME_CLI_ROOT, "package.json");

const rootManifest = JSON.parse(
fs.readFileSync(MANIFEST_PATH).toString("utf-8"),
Expand All @@ -14,7 +14,7 @@ let [major, minor, patch] = rootManifest.version
.map((num) => Number.parseInt(num));
// increment patch version
patch += 1;
let version = rootManifest.version;
let version = `${major}.${minor}.${patch}`;

if (
typeof process.env.GITHUB_SHA !== "string" ||
Expand Down

0 comments on commit 125f34b

Please sign in to comment.