Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix nightly version and restore update of manifest #2953

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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