Skip to content

Commit 09ac293

Browse files
committed
add test that was removed in #10157
1 parent f789da2 commit 09ac293

File tree

3 files changed

+60
-6
lines changed

3 files changed

+60
-6
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# This workflow tests bun-release's code and the packages to ensure that npm,
2+
# yarn, and pnpm can install bun on all platforms. This does not test that bun
3+
# itself works as it hardcodes 1.2.0 as the version to package.
4+
name: bun-release-test
5+
concurrency: release-test
6+
7+
on:
8+
pull_request:
9+
paths:
10+
- "packages/bun-release/**"
11+
- ".github/workflows/bun-release-test.yml"
12+
13+
jobs:
14+
test-release-script:
15+
name: Test Release Script
16+
strategy:
17+
matrix:
18+
# 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
19+
machine: [
20+
ubuntu-latest, # linux x64
21+
ubuntu-24.04-arm, # linux arm
22+
macos-13, # macos x64
23+
macos-15, # macos arm
24+
# windows-latest, # windows x64
25+
]
26+
fail-fast: false
27+
runs-on: ${{ matrix.machine }}
28+
permissions:
29+
contents: read
30+
defaults:
31+
run:
32+
working-directory: packages/bun-release
33+
timeout-minutes: 5
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v4
37+
- name: Setup Bun
38+
uses: ./.github/actions/setup-bun
39+
with:
40+
bun-version: "1.2.0"
41+
- name: Setup Node
42+
uses: actions/setup-node@v4
43+
with:
44+
node-version: 22
45+
- name: Install Dependencies
46+
run: bun install && npm i -g pnpm yarn npm && which node
47+
48+
- name: Release
49+
run: bun upload-npm -- 1.2.0 test
50+
env:
51+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

packages/bun-release/npm/@oven/bun-linux-x64-musl-baseline/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Bun
22

3-
This is the Linux arm64 binary for Bun, a fast all-in-one JavaScript runtime. https://bun.com
3+
This is the Linux x64 binary for Bun, a fast all-in-one JavaScript runtime. https://bun.com
44

55
_Note: "Baseline" builds are for machines that do not support [AVX2](https://en.wikipedia.org/wiki/Advanced_Vector_Extensions) instructions._
66

packages/bun-release/scripts/upload-npm.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ without *requiring* a postinstall script.
112112
cpu,
113113
keywords: ["bun", "bun.js", "node", "node.js", "runtime", "bundler", "transpiler", "typescript"],
114114
homepage: "https://bun.com",
115-
bugs: "https://github.com/oven-sh/issues",
115+
bugs: "https://github.com/oven-sh/bun/issues",
116116
license: "MIT",
117117
repository: "https://github.com/oven-sh/bun",
118118
});
@@ -148,7 +148,7 @@ async function buildModule(
148148
version: version,
149149
description: `This is the ${osName} ${arch} binary for Bun, a fast all-in-one JavaScript runtime.`,
150150
homepage: "https://bun.com",
151-
bugs: "https://github.com/oven-sh/issues",
151+
bugs: "https://github.com/oven-sh/bun/issues",
152152
license: "MIT",
153153
repository: "https://github.com/oven-sh/bun",
154154
preferUnplugged: true,
@@ -259,7 +259,7 @@ async function test() {
259259
["npm i", "npm exec"],
260260
["yarn set version berry; yarn add", "yarn"],
261261
["yarn set version latest; yarn add", "yarn"],
262-
["pnpm i", "pnpm"],
262+
["pnpm i --dangerously-allow-all-builds", "pnpm"],
263263
["bun i", "bun run"],
264264
]) {
265265
rmSync(join(root, "node_modules"), { recursive: true, force: true });
@@ -272,7 +272,10 @@ async function test() {
272272
});
273273

274274
console.log("Testing", install + " bun");
275-
await $`${{ raw: install }} ./bun-${version}.tgz`;
275+
const nodePath = Bun.which("node")?.replace("/node", "") || "";
276+
await $`${{ raw: install }} ./bun-${version}.tgz`.env({
277+
PATH: nodePath ? `${nodePath}:${process.env.PATH}` : process.env.PATH,
278+
});
276279

277280
console.log("Running " + exec + " bun");
278281

@@ -312,7 +315,7 @@ async function test() {
312315
expect(output[0]).toBe(version);
313316
expect(output[1]).toBe(process.platform);
314317
expect(output[2]).toBe(process.arch);
315-
expect(output[3]).toStartWith(root);
318+
expect(output[3]).toInclude(root);
316319
expect(output[3]).toInclude("bun");
317320
}
318321
}

0 commit comments

Comments
 (0)