Compare commits

...

5 Commits

Author SHA1 Message Date
Jarred Sumner
77324cceaf Merge branch 'main' into riskymh/npm-publish-upd 2025-07-16 03:07:02 -07:00
Jarred Sumner
1922498ade Merge branch 'main' into riskymh/npm-publish-upd 2025-07-10 21:28:49 -07:00
RiskyMH
c3258f37ad Update README.md 2025-07-11 03:35:32 +10:00
RiskyMH
09ac2930c2 add test that was removed in #10157 2025-07-11 03:18:04 +10:00
RiskyMH
f789da2fc7 update published npm binaries
add some missing README's, fix the package description, and hopefully make musl not downloaded for linux by default (unless its needed)
2025-07-11 03:18:04 +10:00
7 changed files with 93 additions and 9 deletions

51
.github/workflows/bun-release-test.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
# This workflow tests bun-release's code and the packages to ensure that npm,
# yarn, and pnpm can install bun on all platforms. This does not test that bun
# itself works as it hardcodes 1.2.0 as the version to package.
name: bun-release-test
concurrency: release-test
on:
pull_request:
paths:
- "packages/bun-release/**"
- ".github/workflows/bun-release-test.yml"
jobs:
test-release-script:
name: Test Release Script
strategy:
matrix:
# https://docs.github.com/en/actions/how-tos/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job#choosing-github-hosted-runners
machine: [
ubuntu-latest, # linux x64
ubuntu-24.04-arm, # linux arm
macos-13, # macos x64
macos-15, # macos arm
# windows-latest, # windows x64
]
fail-fast: false
runs-on: ${{ matrix.machine }}
permissions:
contents: read
defaults:
run:
working-directory: packages/bun-release
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: "1.2.0"
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install Dependencies
run: bun install && npm i -g pnpm yarn npm && which node
- name: Release
run: bun upload-npm -- 1.2.0 test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -0,0 +1,5 @@
# Bun
This is the Linux arm64 binary for Bun, a fast all-in-one JavaScript runtime. https://bun.com
_Note: "musl" builds are for machines that use [musl](https://musl.libc.org/) instead of [glibc](https://www.gnu.org/software/libc/)._

View File

@@ -0,0 +1,7 @@
# Bun
This is the Linux x64 binary for Bun, a fast all-in-one JavaScript runtime. https://bun.com
_Note: "Baseline" builds are for machines that do not support [AVX2](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions) instructions._
_Note: "musl" builds are for machines that use [musl](https://musl.libc.org/) instead of [glibc](https://www.gnu.org/software/libc/)._

View File

@@ -0,0 +1,5 @@
# Bun
This is the Linux x64 binary for Bun, a fast all-in-one JavaScript runtime. https://bun.com
_Note: "musl" builds are for machines that use [musl](https://musl.libc.org/) instead of [glibc](https://www.gnu.org/software/libc/)._

View File

@@ -20,8 +20,11 @@ bun upgrade
- [macOS, x64](https://www.npmjs.com/package/@oven/bun-darwin-x64)
- [macOS, x64 (without AVX2 instructions)](https://www.npmjs.com/package/@oven/bun-darwin-x64-baseline)
- [Linux, arm64](https://www.npmjs.com/package/@oven/bun-linux-aarch64)
- [Linux, arm64 (musl)](https://www.npmjs.com/package/@oven/bun-linux-aarch64-musl)
- [Linux, x64](https://www.npmjs.com/package/@oven/bun-linux-x64)
- [Linux, x64 (without AVX2 instructions)](https://www.npmjs.com/package/@oven/bun-linux-x64-baseline)
- [Linux, x64 (musl)](https://www.npmjs.com/package/@oven/bun-linux-x64-musl)
- [Linux, x64 (without AVX2 instructions, musl)](https://www.npmjs.com/package/@oven/bun-linux-x64-musl-baseline)
- [Windows](https://www.npmjs.com/package/@oven/bun-windows-x64)
- [Windows (without AVX2 instructions)](https://www.npmjs.com/package/@oven/bun-windows-x64-baseline)

View File

@@ -112,7 +112,7 @@ without *requiring* a postinstall script.
cpu,
keywords: ["bun", "bun.js", "node", "node.js", "runtime", "bundler", "transpiler", "typescript"],
homepage: "https://bun.com",
bugs: "https://github.com/oven-sh/issues",
bugs: "https://github.com/oven-sh/bun/issues",
license: "MIT",
repository: "https://github.com/oven-sh/bun",
});
@@ -123,7 +123,7 @@ without *requiring* a postinstall script.
async function buildModule(
release: Awaited<ReturnType<typeof getRelease>>,
{ bin, exe, os, arch }: Platform,
{ bin, exe, os, arch, abi }: Platform,
): Promise<void> {
const module = `${owner}/${bin}`;
log("Building:", `${module}@${version}`);
@@ -137,17 +137,24 @@ async function buildModule(
mkdirSync(dirname(join(cwd, exe)), { recursive: true });
write(join(cwd, exe), await bun.async("arraybuffer"));
chmod(join(cwd, exe), 0o755);
const osName =
{
darwin: "macOS",
win32: "windows",
linux: "linux",
}[os] || os;
writeJson(join(cwd, "package.json"), {
name: module,
version: version,
description: "This is the macOS arm64 binary for Bun, a fast all-in-one JavaScript runtime.",
description: `This is the ${osName} ${arch} binary for Bun, a fast all-in-one JavaScript runtime.`,
homepage: "https://bun.com",
bugs: "https://github.com/oven-sh/issues",
bugs: "https://github.com/oven-sh/bun/issues",
license: "MIT",
repository: "https://github.com/oven-sh/bun",
preferUnplugged: true,
os: [os],
cpu: [arch],
libc: abi ? [abi] : undefined,
});
if (exists(".npmrc")) {
copy(".npmrc", join(cwd, ".npmrc"));
@@ -252,7 +259,7 @@ async function test() {
["npm i", "npm exec"],
["yarn set version berry; yarn add", "yarn"],
["yarn set version latest; yarn add", "yarn"],
["pnpm i", "pnpm"],
["pnpm i --dangerously-allow-all-builds", "pnpm"],
["bun i", "bun run"],
]) {
rmSync(join(root, "node_modules"), { recursive: true, force: true });
@@ -265,7 +272,10 @@ async function test() {
});
console.log("Testing", install + " bun");
await $`${{ raw: install }} ./bun-${version}.tgz`;
const nodePath = Bun.which("node")?.replace("/node", "") || "";
await $`${{ raw: install }} ./bun-${version}.tgz`.env({
PATH: nodePath ? `${nodePath}:${process.env.PATH}` : process.env.PATH,
});
console.log("Running " + exec + " bun");
@@ -305,7 +315,7 @@ async function test() {
expect(output[0]).toBe(version);
expect(output[1]).toBe(process.platform);
expect(output[2]).toBe(process.arch);
expect(output[3]).toStartWith(root);
expect(output[3]).toInclude(root);
expect(output[3]).toInclude("bun");
}
}

View File

@@ -10,12 +10,12 @@ export const avx2 =
arch === "x64" &&
((os === "linux" && isLinuxAVX2()) || (os === "darwin" && isDarwinAVX2()) || (os === "win32" && isWindowsAVX2()));
export const abi = os === "linux" && isLinuxMusl() ? "musl" : undefined;
export const abi = os === "linux" ? (isLinuxMusl() ? "musl" : "glibc") : undefined;
export type Platform = {
os: string;
arch: string;
abi?: "musl";
abi?: "musl" | "glibc";
avx2?: boolean;
bin: string;
exe: string;
@@ -44,12 +44,14 @@ export const platforms: Platform[] = [
{
os: "linux",
arch: "arm64",
abi: "glibc",
bin: "bun-linux-aarch64",
exe: "bin/bun",
},
{
os: "linux",
arch: "x64",
abi: "glibc",
avx2: true,
bin: "bun-linux-x64",
exe: "bin/bun",
@@ -57,6 +59,7 @@ export const platforms: Platform[] = [
{
os: "linux",
arch: "x64",
abi: "glibc",
bin: "bun-linux-x64-baseline",
exe: "bin/bun",
},