ci: drop x86-64-v3 native variants for win32/darwin-x64 and clean up release flow

- Drop the modern (x86-64-v3) native build matrix entries for darwin-x64 and
  win32-x64. Linux x64 still ships both variants. Loader fallback chain
  (modern -> baseline -> default) means hosts on those platforms now load
  baseline; npm install via @oh-my-pi/pi-natives and the embedded standalone
  binary both keep working unchanged.
- Stop downloading .node files in scripts/install.sh and scripts/install.ps1.
  The standalone omp binary embeds the native at compile time, so the
  separate downloads were redundant and were going to 404 on platforms with
  no modern variant.
- Stop publishing standalone .node files to GitHub Releases. The npm
  registry is the only consumer that needs them.
- Drop the release-archives build entirely (omp-*.tar.gz). Nothing
  consumed them. Deleted scripts/ci-release-build-archives.ts and the
  ci:release:build-archives package script.
- Split the monolithic release job into release-github (download omp-*
  binaries, upload to GitHub Release) and release-npm (download natives,
  bun publish). Each job's steps now obviously serve its single output.
This commit is contained in:
can1357
2026-04-30 14:38:43 +02:00
parent 7015f6dfd2
commit a5a06c1be8
5 changed files with 395 additions and 495 deletions
-96
View File
@@ -1,96 +0,0 @@
#!/usr/bin/env bun
import { $ } from "bun";
import * as fs from "node:fs/promises";
import * as path from "node:path";
interface ArchiveTarget {
id: string;
binaryName: string;
archiveName: string;
executableName: string;
nativeAddons: string[];
}
const repoRoot = path.join(import.meta.dir, "..");
const binariesDir = path.join(repoRoot, "packages", "coding-agent", "binaries");
const archivesDir = path.join(binariesDir, ".archives");
const targets: ArchiveTarget[] = [
{
id: "darwin-arm64",
binaryName: "omp-darwin-arm64",
archiveName: "omp-darwin-arm64.tar.gz",
executableName: "omp",
nativeAddons: ["pi_natives.darwin-arm64.node"],
},
{
id: "darwin-x64",
binaryName: "omp-darwin-x64",
archiveName: "omp-darwin-x64.tar.gz",
executableName: "omp",
nativeAddons: ["pi_natives.darwin-x64-modern.node", "pi_natives.darwin-x64-baseline.node"],
},
{
id: "linux-x64",
binaryName: "omp-linux-x64",
archiveName: "omp-linux-x64.tar.gz",
executableName: "omp",
nativeAddons: ["pi_natives.linux-x64-modern.node", "pi_natives.linux-x64-baseline.node"],
},
{
id: "linux-arm64",
binaryName: "omp-linux-arm64",
archiveName: "omp-linux-arm64.tar.gz",
executableName: "omp",
nativeAddons: ["pi_natives.linux-arm64.node"],
},
{
id: "win32-x64",
binaryName: "omp-windows-x64.exe",
archiveName: "omp-windows-x64.tar.gz",
executableName: "omp.exe",
nativeAddons: ["pi_natives.win32-x64-modern.node", "pi_natives.win32-x64-baseline.node"],
},
];
async function copyRequiredFile(source: string, destination: string): Promise<void> {
try {
await fs.copyFile(source, destination);
} catch (error) {
throw new Error(`Missing release archive input ${path.relative(repoRoot, source)}: ${String(error)}`);
}
}
async function createArchive(target: ArchiveTarget): Promise<void> {
const stagingDir = path.join(archivesDir, target.id);
await fs.rm(stagingDir, { recursive: true, force: true });
await fs.mkdir(stagingDir, { recursive: true });
await copyRequiredFile(path.join(binariesDir, target.binaryName), path.join(stagingDir, target.executableName));
for (const addonName of target.nativeAddons) {
await copyRequiredFile(path.join(binariesDir, addonName), path.join(stagingDir, addonName));
}
if (target.executableName === "omp") {
await fs.chmod(path.join(stagingDir, target.executableName), 0o755);
}
const archivePath = path.join(binariesDir, target.archiveName);
await fs.rm(archivePath, { force: true });
await $`tar -czf ${archivePath} -C ${stagingDir} .`.quiet();
}
async function main(): Promise<void> {
await fs.mkdir(binariesDir, { recursive: true });
await fs.rm(archivesDir, { recursive: true, force: true });
await fs.mkdir(archivesDir, { recursive: true });
for (const target of targets) {
await createArchive(target);
}
await fs.rm(archivesDir, { recursive: true, force: true });
}
await main();
-11
View File
@@ -20,7 +20,6 @@ $Repo = "can1357/oh-my-pi"
$Package = "@oh-my-pi/pi-coding-agent"
$InstallDir = if ($env:PI_INSTALL_DIR) { $env:PI_INSTALL_DIR } else { "$env:LOCALAPPDATA\omp" }
$BinaryName = "omp-windows-x64.exe"
$NativeAddonNames = @("pi_natives.win32-x64-modern.node", "pi_natives.win32-x64-baseline.node")
$MinimumBunVersion = "1.3.7"
function Test-BunInstalled {
@@ -263,18 +262,8 @@ function Install-Binary {
$OutPath = Join-Path $InstallDir "omp.exe"
Invoke-WebRequest -Uri $BinaryUrl -OutFile $OutPath
# Download native addons
$downloadedNative = 0
foreach ($nativeAddonName in $NativeAddonNames) {
$nativeUrl = "https://github.com/$Repo/releases/download/$Latest/$nativeAddonName"
Write-Host "Downloading $nativeAddonName..."
$nativeOutPath = Join-Path $InstallDir $nativeAddonName
Invoke-WebRequest -Uri $nativeUrl -OutFile $nativeOutPath
$downloadedNative += 1
}
Write-Host ""
Write-Host "✓ Installed omp to $OutPath" -ForegroundColor Green
Write-Host "✓ Installed $downloadedNative native addon file(s) to $InstallDir" -ForegroundColor Green
# Add to PATH if not already there
$UserPath = [Environment]::GetEnvironmentVariable("Path", "User")
-20
View File
@@ -230,28 +230,8 @@ install_binary() {
echo "Downloading ${BINARY}..."
curl -fsSL "$BINARY_URL" -o "${INSTALL_DIR}/omp"
chmod +x "${INSTALL_DIR}/omp"
downloaded_native=0
if [ "$ARCH" = "x64" ]; then
for variant in modern baseline; do
NATIVE_ADDON="pi_natives.${PLATFORM}-${ARCH}-${variant}.node"
NATIVE_URL="https://github.com/${REPO}/releases/download/${LATEST}/${NATIVE_ADDON}"
echo "Downloading ${NATIVE_ADDON}..."
curl -fsSL "$NATIVE_URL" -o "${INSTALL_DIR}/${NATIVE_ADDON}" || {
echo "Failed to download ${NATIVE_ADDON}"
exit 1
}
downloaded_native=$((downloaded_native + 1))
done
else
NATIVE_ADDON="pi_natives.${PLATFORM}-${ARCH}.node"
NATIVE_URL="https://github.com/${REPO}/releases/download/${LATEST}/${NATIVE_ADDON}"
echo "Downloading ${NATIVE_ADDON}..."
curl -fsSL "$NATIVE_URL" -o "${INSTALL_DIR}/${NATIVE_ADDON}"
downloaded_native=1
fi
echo ""
echo "✓ Installed omp to ${INSTALL_DIR}/omp"
echo "✓ Installed ${downloaded_native} native addon file(s) to ${INSTALL_DIR}"
# Check if in PATH
case ":$PATH:" in