mirror of
https://github.com/oven-sh/setup-bun.git
synced 2026-05-13 20:50:13 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ecf28ddc73 | |||
| 95edc153a3 | |||
| 4c32875876 | |||
| 0ff83bfc51 | |||
| ab8cb4e8f8 | |||
| 196aaa2bd2 |
@@ -57,6 +57,7 @@ jobs:
|
||||
- latest
|
||||
- canary
|
||||
- "1.1.0"
|
||||
- "1.3.10"
|
||||
- "1.x"
|
||||
- "1"
|
||||
- "> 1.0.0"
|
||||
|
||||
@@ -5,20 +5,20 @@
|
||||
"": {
|
||||
"name": "setup-bun",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^4.0.0",
|
||||
"@actions/core": "^1.11.0",
|
||||
"@actions/cache": "^4.1.0",
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/glob": "^0.4.0",
|
||||
"@actions/io": "^1.1.2",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"@actions/io": "^1.1.3",
|
||||
"@actions/tool-cache": "^2.0.2",
|
||||
"@iarna/toml": "^2.2.5",
|
||||
"compare-versions": "^6.1.1",
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "^1.1.13",
|
||||
"@types/node": "^20.8.2",
|
||||
"esbuild": "^0.19.2",
|
||||
"prettier": "^3.4.2",
|
||||
"@types/bun": "^1.3.10",
|
||||
"@types/node": "^20.19.35",
|
||||
"esbuild": "^0.19.12",
|
||||
"prettier": "^3.8.1",
|
||||
"typescript": "^4.9.5",
|
||||
},
|
||||
},
|
||||
@@ -30,7 +30,7 @@
|
||||
"form-data": "^4.0.4",
|
||||
},
|
||||
"packages": {
|
||||
"@actions/cache": ["@actions/cache@4.0.3", "", { "dependencies": { "@actions/core": "^1.11.1", "@actions/exec": "^1.0.1", "@actions/glob": "^0.1.0", "@actions/http-client": "^2.1.1", "@actions/io": "^1.0.1", "@azure/abort-controller": "^1.1.0", "@azure/ms-rest-js": "^2.6.0", "@azure/storage-blob": "^12.13.0", "@protobuf-ts/plugin": "^2.9.4", "semver": "^6.3.1" } }, "sha512-SvrqFtYJ7I48A/uXNkoJrnukx5weQv1fGquhs3+4nkByZThBH109KTIqj5x/cGV7JGNvb8dLPVywUOqX1fjiXg=="],
|
||||
"@actions/cache": ["@actions/cache@4.1.0", "", { "dependencies": { "@actions/core": "^1.11.1", "@actions/exec": "^1.0.1", "@actions/glob": "^0.1.0", "@actions/http-client": "^2.1.1", "@actions/io": "^1.0.1", "@azure/abort-controller": "^1.1.0", "@azure/ms-rest-js": "^2.6.0", "@azure/storage-blob": "^12.13.0", "@protobuf-ts/runtime-rpc": "^2.11.1", "semver": "^6.3.1" } }, "sha512-z3Opg+P4Y7baq+g1dODXgdtsvPLSewr3ZKpp3U0HQR1A/vWCoJFS52XSezjdngo4SIOdR5oHtyK3a3Arar+X9A=="],
|
||||
|
||||
"@actions/core": ["@actions/core@1.11.1", "", { "dependencies": { "@actions/exec": "^1.1.1", "@actions/http-client": "^2.0.1" } }, "sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A=="],
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
"@actions/io": ["@actions/io@1.1.3", "", {}, ""],
|
||||
|
||||
"@actions/tool-cache": ["@actions/tool-cache@2.0.1", "", { "dependencies": { "@actions/core": "^1.2.6", "@actions/exec": "^1.0.0", "@actions/http-client": "^2.0.1", "@actions/io": "^1.1.1", "semver": "^6.1.0", "uuid": "^3.3.2" } }, ""],
|
||||
"@actions/tool-cache": ["@actions/tool-cache@2.0.2", "", { "dependencies": { "@actions/core": "^1.11.1", "@actions/exec": "^1.0.0", "@actions/http-client": "^2.0.1", "@actions/io": "^1.1.1", "semver": "^6.1.0" } }, "sha512-fBhNNOWxuoLxztQebpOaWu6WeVmuwa77Z+DxIZ1B+OYvGkGQon6kTVg6Z32Cb13WCuw0szqonK+hh03mJV7Z6w=="],
|
||||
|
||||
"@azure/abort-controller": ["@azure/abort-controller@1.1.0", "", { "dependencies": { "tslib": "^2.2.0" } }, ""],
|
||||
|
||||
@@ -64,72 +64,66 @@
|
||||
|
||||
"@azure/storage-blob": ["@azure/storage-blob@12.15.0", "", { "dependencies": { "@azure/abort-controller": "^1.0.0", "@azure/core-http": "^3.0.0", "@azure/core-lro": "^2.2.0", "@azure/core-paging": "^1.1.1", "@azure/core-tracing": "1.0.0-preview.13", "@azure/logger": "^1.0.0", "events": "^3.0.0", "tslib": "^2.2.0" } }, ""],
|
||||
|
||||
"@esbuild/android-arm": ["@esbuild/android-arm@0.19.2", "", { "os": "android", "cpu": "arm" }, "sha512-tM8yLeYVe7pRyAu9VMi/Q7aunpLwD139EY1S99xbQkT4/q2qa6eA4ige/WJQYdJ8GBL1K33pPFhPfPdJ/WzT8Q=="],
|
||||
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.19.12", "", { "os": "aix", "cpu": "ppc64" }, "sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA=="],
|
||||
|
||||
"@esbuild/android-arm64": ["@esbuild/android-arm64@0.19.2", "", { "os": "android", "cpu": "arm64" }, "sha512-lsB65vAbe90I/Qe10OjkmrdxSX4UJDjosDgb8sZUKcg3oefEuW2OT2Vozz8ef7wrJbMcmhvCC+hciF8jY/uAkw=="],
|
||||
"@esbuild/android-arm": ["@esbuild/android-arm@0.19.12", "", { "os": "android", "cpu": "arm" }, "sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w=="],
|
||||
|
||||
"@esbuild/android-x64": ["@esbuild/android-x64@0.19.2", "", { "os": "android", "cpu": "x64" }, "sha512-qK/TpmHt2M/Hg82WXHRc/W/2SGo/l1thtDHZWqFq7oi24AjZ4O/CpPSu6ZuYKFkEgmZlFoa7CooAyYmuvnaG8w=="],
|
||||
"@esbuild/android-arm64": ["@esbuild/android-arm64@0.19.12", "", { "os": "android", "cpu": "arm64" }, "sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA=="],
|
||||
|
||||
"@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.19.2", "", { "os": "darwin", "cpu": "arm64" }, ""],
|
||||
"@esbuild/android-x64": ["@esbuild/android-x64@0.19.12", "", { "os": "android", "cpu": "x64" }, "sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew=="],
|
||||
|
||||
"@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.19.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-tP+B5UuIbbFMj2hQaUr6EALlHOIOmlLM2FK7jeFBobPy2ERdohI4Ka6ZFjZ1ZYsrHE/hZimGuU90jusRE0pwDw=="],
|
||||
"@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.19.12", "", { "os": "darwin", "cpu": "arm64" }, "sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g=="],
|
||||
|
||||
"@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.19.2", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-YbPY2kc0acfzL1VPVK6EnAlig4f+l8xmq36OZkU0jzBVHcOTyQDhnKQaLzZudNJQyymd9OqQezeaBgkTGdTGeQ=="],
|
||||
"@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.19.12", "", { "os": "darwin", "cpu": "x64" }, "sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A=="],
|
||||
|
||||
"@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.19.2", "", { "os": "freebsd", "cpu": "x64" }, "sha512-nSO5uZT2clM6hosjWHAsS15hLrwCvIWx+b2e3lZ3MwbYSaXwvfO528OF+dLjas1g3bZonciivI8qKR/Hm7IWGw=="],
|
||||
"@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.19.12", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA=="],
|
||||
|
||||
"@esbuild/linux-arm": ["@esbuild/linux-arm@0.19.2", "", { "os": "linux", "cpu": "arm" }, "sha512-Odalh8hICg7SOD7XCj0YLpYCEc+6mkoq63UnExDCiRA2wXEmGlK5JVrW50vZR9Qz4qkvqnHcpH+OFEggO3PgTg=="],
|
||||
"@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.19.12", "", { "os": "freebsd", "cpu": "x64" }, "sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg=="],
|
||||
|
||||
"@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.19.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-ig2P7GeG//zWlU0AggA3pV1h5gdix0MA3wgB+NsnBXViwiGgY77fuN9Wr5uoCrs2YzaYfogXgsWZbm+HGr09xg=="],
|
||||
"@esbuild/linux-arm": ["@esbuild/linux-arm@0.19.12", "", { "os": "linux", "cpu": "arm" }, "sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w=="],
|
||||
|
||||
"@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.19.2", "", { "os": "linux", "cpu": "ia32" }, "sha512-mLfp0ziRPOLSTek0Gd9T5B8AtzKAkoZE70fneiiyPlSnUKKI4lp+mGEnQXcQEHLJAcIYDPSyBvsUbKUG2ri/XQ=="],
|
||||
"@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.19.12", "", { "os": "linux", "cpu": "arm64" }, "sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA=="],
|
||||
|
||||
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.19.2", "", { "os": "linux", "cpu": "none" }, "sha512-hn28+JNDTxxCpnYjdDYVMNTR3SKavyLlCHHkufHV91fkewpIyQchS1d8wSbmXhs1fiYDpNww8KTFlJ1dHsxeSw=="],
|
||||
"@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.19.12", "", { "os": "linux", "cpu": "ia32" }, "sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA=="],
|
||||
|
||||
"@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.19.2", "", { "os": "linux", "cpu": "none" }, "sha512-KbXaC0Sejt7vD2fEgPoIKb6nxkfYW9OmFUK9XQE4//PvGIxNIfPk1NmlHmMg6f25x57rpmEFrn1OotASYIAaTg=="],
|
||||
"@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.19.12", "", { "os": "linux", "cpu": "none" }, "sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA=="],
|
||||
|
||||
"@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.19.2", "", { "os": "linux", "cpu": "ppc64" }, "sha512-dJ0kE8KTqbiHtA3Fc/zn7lCd7pqVr4JcT0JqOnbj4LLzYnp+7h8Qi4yjfq42ZlHfhOCM42rBh0EwHYLL6LEzcw=="],
|
||||
"@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.19.12", "", { "os": "linux", "cpu": "none" }, "sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w=="],
|
||||
|
||||
"@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.19.2", "", { "os": "linux", "cpu": "none" }, "sha512-7Z/jKNFufZ/bbu4INqqCN6DDlrmOTmdw6D0gH+6Y7auok2r02Ur661qPuXidPOJ+FSgbEeQnnAGgsVynfLuOEw=="],
|
||||
"@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.19.12", "", { "os": "linux", "cpu": "ppc64" }, "sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg=="],
|
||||
|
||||
"@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.19.2", "", { "os": "linux", "cpu": "s390x" }, "sha512-U+RinR6aXXABFCcAY4gSlv4CL1oOVvSSCdseQmGO66H+XyuQGZIUdhG56SZaDJQcLmrSfRmx5XZOWyCJPRqS7g=="],
|
||||
"@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.19.12", "", { "os": "linux", "cpu": "none" }, "sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg=="],
|
||||
|
||||
"@esbuild/linux-x64": ["@esbuild/linux-x64@0.19.2", "", { "os": "linux", "cpu": "x64" }, "sha512-oxzHTEv6VPm3XXNaHPyUTTte+3wGv7qVQtqaZCrgstI16gCuhNOtBXLEBkBREP57YTd68P0VgDgG73jSD8bwXQ=="],
|
||||
"@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.19.12", "", { "os": "linux", "cpu": "s390x" }, "sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg=="],
|
||||
|
||||
"@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.19.2", "", { "os": "none", "cpu": "x64" }, "sha512-WNa5zZk1XpTTwMDompZmvQLHszDDDN7lYjEHCUmAGB83Bgs20EMs7ICD+oKeT6xt4phV4NDdSi/8OfjPbSbZfQ=="],
|
||||
"@esbuild/linux-x64": ["@esbuild/linux-x64@0.19.12", "", { "os": "linux", "cpu": "x64" }, "sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg=="],
|
||||
|
||||
"@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.19.2", "", { "os": "openbsd", "cpu": "x64" }, "sha512-S6kI1aT3S++Dedb7vxIuUOb3oAxqxk2Rh5rOXOTYnzN8JzW1VzBd+IqPiSpgitu45042SYD3HCoEyhLKQcDFDw=="],
|
||||
"@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.19.12", "", { "os": "none", "cpu": "x64" }, "sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA=="],
|
||||
|
||||
"@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.19.2", "", { "os": "sunos", "cpu": "x64" }, "sha512-VXSSMsmb+Z8LbsQGcBMiM+fYObDNRm8p7tkUDMPG/g4fhFX5DEFmjxIEa3N8Zr96SjsJ1woAhF0DUnS3MF3ARw=="],
|
||||
"@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.19.12", "", { "os": "openbsd", "cpu": "x64" }, "sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw=="],
|
||||
|
||||
"@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.19.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-5NayUlSAyb5PQYFAU9x3bHdsqB88RC3aM9lKDAz4X1mo/EchMIT1Q+pSeBXNgkfNmRecLXA0O8xP+x8V+g/LKg=="],
|
||||
"@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.19.12", "", { "os": "sunos", "cpu": "x64" }, "sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA=="],
|
||||
|
||||
"@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.19.2", "", { "os": "win32", "cpu": "ia32" }, "sha512-47gL/ek1v36iN0wL9L4Q2MFdujR0poLZMJwhO2/N3gA89jgHp4MR8DKCmwYtGNksbfJb9JoTtbkoe6sDhg2QTA=="],
|
||||
"@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.19.12", "", { "os": "win32", "cpu": "arm64" }, "sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A=="],
|
||||
|
||||
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.19.2", "", { "os": "win32", "cpu": "x64" }, "sha512-tcuhV7ncXBqbt/Ybf0IyrMcwVOAPDckMK9rXNHtF17UTK18OKLpg08glminN06pt2WCoALhXdLfSPbVvK/6fxw=="],
|
||||
"@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.19.12", "", { "os": "win32", "cpu": "ia32" }, "sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ=="],
|
||||
|
||||
"@esbuild/win32-x64": ["@esbuild/win32-x64@0.19.12", "", { "os": "win32", "cpu": "x64" }, "sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA=="],
|
||||
|
||||
"@iarna/toml": ["@iarna/toml@2.2.5", "", {}, "sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg=="],
|
||||
|
||||
"@opentelemetry/api": ["@opentelemetry/api@1.5.0", "", {}, ""],
|
||||
|
||||
"@protobuf-ts/plugin": ["@protobuf-ts/plugin@2.9.6", "", { "dependencies": { "@protobuf-ts/plugin-framework": "^2.9.6", "@protobuf-ts/protoc": "^2.9.6", "@protobuf-ts/runtime": "^2.9.6", "@protobuf-ts/runtime-rpc": "^2.9.6", "typescript": "^3.9" }, "bin": { "protoc-gen-dump": "bin/protoc-gen-dump", "protoc-gen-ts": "bin/protoc-gen-ts" } }, "sha512-Wpv5rkXeu6E5Y4r0TjWE0bzRGddiTYl/RM+tLgVlS0r8CqOBqNAmlWv+s8ltf/F75rVrahUal0cpyhFwha9GRA=="],
|
||||
"@protobuf-ts/runtime": ["@protobuf-ts/runtime@2.11.1", "", {}, "sha512-KuDaT1IfHkugM2pyz+FwiY80ejWrkH1pAtOBOZFuR6SXEFTsnb/jiQWQ1rCIrcKx2BtyxnxW6BWwsVSA/Ie+WQ=="],
|
||||
|
||||
"@protobuf-ts/plugin-framework": ["@protobuf-ts/plugin-framework@2.9.6", "", { "dependencies": { "@protobuf-ts/runtime": "^2.9.6", "typescript": "^3.9" } }, "sha512-w7A1RXrDCiVzcaRE6YJP7FCARuAFe/Vc4SNQnHAi4CF0V6mEtyjAYEIC5BNYgIRaJEqB26zzsBQjIem3R02SCA=="],
|
||||
"@protobuf-ts/runtime-rpc": ["@protobuf-ts/runtime-rpc@2.11.1", "", { "dependencies": { "@protobuf-ts/runtime": "^2.11.1" } }, "sha512-4CqqUmNA+/uMz00+d3CYKgElXO9VrEbucjnBFEjqI4GuDrEQ32MaI3q+9qPBvIGOlL4PmHXrzM32vBPWRhQKWQ=="],
|
||||
|
||||
"@protobuf-ts/protoc": ["@protobuf-ts/protoc@2.9.6", "", { "bin": { "protoc": "protoc.js" } }, "sha512-c0XvAPDIBAovH9HxV8gBv8gzOTreQIqibcusrB1+DxvFiSvy+2V1tjbUmG5gJEbjk3aAOaoj0a3+QuE+P28xUw=="],
|
||||
"@types/bun": ["@types/bun@1.3.10", "", { "dependencies": { "bun-types": "1.3.10" } }, "sha512-0+rlrUrOrTSskibryHbvQkDOWRJwJZqZlxrUs1u4oOoTln8+WIXBPmAuCF35SWB2z4Zl3E84Nl/D0P7803nigQ=="],
|
||||
|
||||
"@protobuf-ts/runtime": ["@protobuf-ts/runtime@2.9.6", "", {}, "sha512-C0CfpKx4n4LBbUrajOdRj2BTbd3qBoK0SiKWLq7RgCoU6xiN4wesBMFHUOBp3fFzKeZwgU8Q2KtzaqzIvPLRXg=="],
|
||||
|
||||
"@protobuf-ts/runtime-rpc": ["@protobuf-ts/runtime-rpc@2.9.6", "", { "dependencies": { "@protobuf-ts/runtime": "^2.9.6" } }, "sha512-0UeqDRzNxgsh08lY5eWzFJNfD3gZ8Xf+WG1HzbIAbVAigzigwjwsYNNhTeas5H3gco1U5owTzCg177aambKOOw=="],
|
||||
|
||||
"@types/bun": ["@types/bun@1.2.18", "", { "dependencies": { "bun-types": "1.2.18" } }, "sha512-Xf6RaWVheyemaThV0kUfaAUvCNokFr+bH8Jxp+tTZfx7dAPA8z9ePnP9S9+Vspzuxxx9JRAXhnyccRj3GyCMdQ=="],
|
||||
|
||||
"@types/node": ["@types/node@20.9.1", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-HhmzZh5LSJNS5O8jQKpJ/3ZcrrlG6L70hpGqMIAoM9YVD0YBRNWYsfwcXq8VnSjlNpCpgLzMXdiPo+dxcvSmiA=="],
|
||||
"@types/node": ["@types/node@20.19.35", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-Uarfe6J91b9HAUXxjvSOdiO2UPOKLm07Q1oh0JHxoZ1y8HoqxDAu3gVrsrOHeiio0kSsoVBt4wFrKOm0dKxVPQ=="],
|
||||
|
||||
"@types/node-fetch": ["@types/node-fetch@2.6.4", "", { "dependencies": { "@types/node": "*", "form-data": "^3.0.0" } }, ""],
|
||||
|
||||
"@types/react": ["@types/react@19.1.8", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g=="],
|
||||
|
||||
"@types/tunnel": ["@types/tunnel@0.0.3", "", { "dependencies": { "@types/node": "*" } }, ""],
|
||||
|
||||
"abort-controller": ["abort-controller@3.0.0", "", { "dependencies": { "event-target-shim": "^5.0.0" } }, ""],
|
||||
@@ -140,7 +134,7 @@
|
||||
|
||||
"brace-expansion": ["brace-expansion@1.1.11", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, ""],
|
||||
|
||||
"bun-types": ["bun-types@1.2.18", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-04+Eha5NP7Z0A9YgDAzMk5PHR16ZuLVa83b26kH5+cp1qZW4F6FmAURngE7INf4tKOvCE69vYvDEwoNl1tGiWw=="],
|
||||
"bun-types": ["bun-types@1.3.10", "", { "dependencies": { "@types/node": "*" } }, "sha512-tcpfCCl6XWo6nCVnpcVrxQ+9AYN1iqMIzgrSKYMB/fjLtV2eyAVEg7AxQJuCq/26R6HpKWykQXuSOq/21RYcbg=="],
|
||||
|
||||
"call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="],
|
||||
|
||||
@@ -150,8 +144,6 @@
|
||||
|
||||
"concat-map": ["concat-map@0.0.1", "", {}, ""],
|
||||
|
||||
"csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="],
|
||||
|
||||
"delayed-stream": ["delayed-stream@1.0.0", "", {}, ""],
|
||||
|
||||
"dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="],
|
||||
@@ -164,7 +156,7 @@
|
||||
|
||||
"es-set-tostringtag": ["es-set-tostringtag@2.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA=="],
|
||||
|
||||
"esbuild": ["esbuild@0.19.2", "", { "optionalDependencies": { "@esbuild/android-arm": "0.19.2", "@esbuild/android-arm64": "0.19.2", "@esbuild/android-x64": "0.19.2", "@esbuild/darwin-arm64": "0.19.2", "@esbuild/darwin-x64": "0.19.2", "@esbuild/freebsd-arm64": "0.19.2", "@esbuild/freebsd-x64": "0.19.2", "@esbuild/linux-arm": "0.19.2", "@esbuild/linux-arm64": "0.19.2", "@esbuild/linux-ia32": "0.19.2", "@esbuild/linux-loong64": "0.19.2", "@esbuild/linux-mips64el": "0.19.2", "@esbuild/linux-ppc64": "0.19.2", "@esbuild/linux-riscv64": "0.19.2", "@esbuild/linux-s390x": "0.19.2", "@esbuild/linux-x64": "0.19.2", "@esbuild/netbsd-x64": "0.19.2", "@esbuild/openbsd-x64": "0.19.2", "@esbuild/sunos-x64": "0.19.2", "@esbuild/win32-arm64": "0.19.2", "@esbuild/win32-ia32": "0.19.2", "@esbuild/win32-x64": "0.19.2" }, "bin": "bin/esbuild" }, ""],
|
||||
"esbuild": ["esbuild@0.19.12", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.19.12", "@esbuild/android-arm": "0.19.12", "@esbuild/android-arm64": "0.19.12", "@esbuild/android-x64": "0.19.12", "@esbuild/darwin-arm64": "0.19.12", "@esbuild/darwin-x64": "0.19.12", "@esbuild/freebsd-arm64": "0.19.12", "@esbuild/freebsd-x64": "0.19.12", "@esbuild/linux-arm": "0.19.12", "@esbuild/linux-arm64": "0.19.12", "@esbuild/linux-ia32": "0.19.12", "@esbuild/linux-loong64": "0.19.12", "@esbuild/linux-mips64el": "0.19.12", "@esbuild/linux-ppc64": "0.19.12", "@esbuild/linux-riscv64": "0.19.12", "@esbuild/linux-s390x": "0.19.12", "@esbuild/linux-x64": "0.19.12", "@esbuild/netbsd-x64": "0.19.12", "@esbuild/openbsd-x64": "0.19.12", "@esbuild/sunos-x64": "0.19.12", "@esbuild/win32-arm64": "0.19.12", "@esbuild/win32-ia32": "0.19.12", "@esbuild/win32-x64": "0.19.12" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg=="],
|
||||
|
||||
"event-target-shim": ["event-target-shim@5.0.1", "", {}, ""],
|
||||
|
||||
@@ -196,7 +188,7 @@
|
||||
|
||||
"node-fetch": ["node-fetch@2.7.0", "", { "dependencies": { "whatwg-url": "^5.0.0" }, "peerDependencies": { "encoding": "^0.1.0" }, "optionalPeers": ["encoding"] }, ""],
|
||||
|
||||
"prettier": ["prettier@3.4.2", "", { "bin": "bin/prettier.cjs" }, "sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ=="],
|
||||
"prettier": ["prettier@3.8.1", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-UOnG6LftzbdaHZcKoPFtOcCKztrQ57WkHDeRD9t/PTQtmT0NHSeWWepj6pS0z/N7+08BHFDQVUrfmfMRcZwbMg=="],
|
||||
|
||||
"process": ["process@0.11.10", "", {}, ""],
|
||||
|
||||
@@ -212,9 +204,9 @@
|
||||
|
||||
"typescript": ["typescript@4.9.5", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, ""],
|
||||
|
||||
"undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
|
||||
"undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="],
|
||||
|
||||
"uuid": ["uuid@3.4.0", "", { "bin": "bin/uuid" }, ""],
|
||||
"uuid": ["uuid@8.3.2", "", { "bin": "dist/bin/uuid" }, ""],
|
||||
|
||||
"webidl-conversions": ["webidl-conversions@3.0.1", "", {}, ""],
|
||||
|
||||
@@ -226,14 +218,14 @@
|
||||
|
||||
"@actions/cache/@actions/glob": ["@actions/glob@0.1.2", "", { "dependencies": { "@actions/core": "^1.2.6", "minimatch": "^3.0.4" } }, ""],
|
||||
|
||||
"@azure/core-http/uuid": ["uuid@8.3.2", "", { "bin": "dist/bin/uuid" }, ""],
|
||||
|
||||
"@azure/ms-rest-js/tslib": ["tslib@1.14.1", "", {}, ""],
|
||||
|
||||
"@azure/ms-rest-js/uuid": ["uuid@8.3.2", "", { "bin": "dist/bin/uuid" }, ""],
|
||||
"@types/node-fetch/@types/node": ["@types/node@20.9.1", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-HhmzZh5LSJNS5O8jQKpJ/3ZcrrlG6L70hpGqMIAoM9YVD0YBRNWYsfwcXq8VnSjlNpCpgLzMXdiPo+dxcvSmiA=="],
|
||||
|
||||
"@protobuf-ts/plugin/typescript": ["typescript@3.9.10", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q=="],
|
||||
"@types/tunnel/@types/node": ["@types/node@20.9.1", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-HhmzZh5LSJNS5O8jQKpJ/3ZcrrlG6L70hpGqMIAoM9YVD0YBRNWYsfwcXq8VnSjlNpCpgLzMXdiPo+dxcvSmiA=="],
|
||||
|
||||
"@protobuf-ts/plugin-framework/typescript": ["typescript@3.9.10", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q=="],
|
||||
"@types/node-fetch/@types/node/undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
|
||||
|
||||
"@types/tunnel/@types/node/undici-types": ["undici-types@5.26.5", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
|
||||
}
|
||||
}
|
||||
|
||||
+38
-38
File diff suppressed because one or more lines are too long
+50
-50
File diff suppressed because one or more lines are too long
Generated
-1214
File diff suppressed because it is too large
Load Diff
+9
-9
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "setup-bun",
|
||||
"version": "2.1.0",
|
||||
"version": "2.1.3",
|
||||
"description": "Setup Bun on GitHub Actions.",
|
||||
"keywords": [
|
||||
"bun",
|
||||
@@ -22,20 +22,20 @@
|
||||
"start": "npm run build && node dist/setup/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@actions/cache": "^4.0.0",
|
||||
"@actions/core": "^1.11.0",
|
||||
"@actions/cache": "^4.1.0",
|
||||
"@actions/core": "^1.11.1",
|
||||
"@actions/exec": "^1.1.1",
|
||||
"@actions/glob": "^0.4.0",
|
||||
"@actions/io": "^1.1.2",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
"@actions/io": "^1.1.3",
|
||||
"@actions/tool-cache": "^2.0.2",
|
||||
"@iarna/toml": "^2.2.5",
|
||||
"compare-versions": "^6.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/bun": "^1.1.13",
|
||||
"@types/node": "^20.8.2",
|
||||
"esbuild": "^0.19.2",
|
||||
"prettier": "^3.4.2",
|
||||
"@types/bun": "^1.3.10",
|
||||
"@types/node": "^20.19.35",
|
||||
"esbuild": "^0.19.12",
|
||||
"prettier": "^3.8.1",
|
||||
"typescript": "^4.9.5"
|
||||
},
|
||||
"patchedDependencies": {
|
||||
|
||||
+18
-5
@@ -1,4 +1,3 @@
|
||||
import { createHash } from "node:crypto";
|
||||
import { homedir } from "node:os";
|
||||
import { join } from "node:path";
|
||||
import {
|
||||
@@ -16,7 +15,7 @@ import { getExecOutput } from "@actions/exec";
|
||||
import { Registry } from "./registry";
|
||||
import { writeBunfig } from "./bunfig";
|
||||
import { saveState } from "@actions/core";
|
||||
import { addExtension } from "./utils";
|
||||
import { addExtension, extractVersionFromUrl, getCacheKey } from "./utils";
|
||||
import { getDownloadUrl } from "./download-url";
|
||||
import { cwd } from "node:process";
|
||||
|
||||
@@ -90,14 +89,28 @@ export default async (options: Input): Promise<Output> => {
|
||||
|
||||
if (!revision) {
|
||||
if (cacheEnabled) {
|
||||
const cacheKey = createHash("sha1").update(url).digest("base64");
|
||||
const cacheKey = getCacheKey(url);
|
||||
|
||||
const cacheRestored = await restoreCache([bunPath], cacheKey);
|
||||
if (cacheRestored) {
|
||||
revision = await getRevision(bunPath);
|
||||
if (revision) {
|
||||
cacheHit = true;
|
||||
info(`Using a cached version of Bun: ${revision}`);
|
||||
const expectedVersion = extractVersionFromUrl(url);
|
||||
const [actualVersion] = revision.split("+");
|
||||
if (!expectedVersion) {
|
||||
warning(
|
||||
`Could not parse expected version from URL: ${url}. Ignoring cache.`,
|
||||
);
|
||||
revision = undefined;
|
||||
} else if (actualVersion !== expectedVersion) {
|
||||
warning(
|
||||
`Cached Bun version ${revision} does not match expected version ${expectedVersion}. Re-downloading.`,
|
||||
);
|
||||
revision = undefined;
|
||||
} else {
|
||||
cacheHit = true;
|
||||
info(`Using a cached version of Bun: ${revision}`);
|
||||
}
|
||||
} else {
|
||||
warning(
|
||||
`Found a cached version of Bun: ${revision} (but it appears to be corrupted?)`,
|
||||
|
||||
+2
-2
@@ -1,11 +1,11 @@
|
||||
import { saveCache } from "@actions/cache";
|
||||
import { getState, warning } from "@actions/core";
|
||||
import { CacheState } from "./action";
|
||||
import { createHash } from "node:crypto";
|
||||
import { getCacheKey } from "./utils";
|
||||
(async () => {
|
||||
const state: CacheState = JSON.parse(getState("cache"));
|
||||
if (state.cacheEnabled && !state.cacheHit) {
|
||||
const cacheKey = createHash("sha1").update(state.url).digest("base64");
|
||||
const cacheKey = getCacheKey(state.url);
|
||||
|
||||
try {
|
||||
await saveCache([state.bunPath], cacheKey);
|
||||
|
||||
+51
-36
@@ -1,4 +1,9 @@
|
||||
import { compareVersions, satisfies, validate } from "compare-versions";
|
||||
import {
|
||||
compareVersions,
|
||||
satisfies,
|
||||
validate,
|
||||
validateStrict,
|
||||
} from "compare-versions";
|
||||
import { Input } from "./action";
|
||||
import { getArchitecture, getAvx2, getPlatform, request } from "./utils";
|
||||
|
||||
@@ -12,49 +17,59 @@ export async function getDownloadUrl(options: Input): Promise<string> {
|
||||
}
|
||||
|
||||
async function getSemverDownloadUrl(options: Input): Promise<string> {
|
||||
const res = (await (
|
||||
await request("https://api.github.com/repos/oven-sh/bun/git/refs/tags", {
|
||||
headers: options.token
|
||||
? { "Authorization": `Bearer ${options.token}` }
|
||||
: {},
|
||||
})
|
||||
).json()) as { ref: string }[];
|
||||
|
||||
let tags = res
|
||||
.filter(
|
||||
(tag) =>
|
||||
tag.ref.startsWith("refs/tags/bun-v") || tag.ref === "refs/tags/canary",
|
||||
)
|
||||
.map((item) => item.ref.replace(/refs\/tags\/(bun-v)?/g, ""))
|
||||
.filter(Boolean);
|
||||
|
||||
const { version, os, arch, avx2, profile } = options;
|
||||
let tag: string | undefined;
|
||||
|
||||
let tag = tags.find((t) => t === version);
|
||||
if (!tag) {
|
||||
tags = tags.filter((t) => validate(t)).sort(compareVersions);
|
||||
|
||||
const matchedTag =
|
||||
version === "latest" || !version
|
||||
? tags.at(-1)
|
||||
: tags.filter((t) => satisfies(t, version)).at(-1);
|
||||
|
||||
if (!matchedTag) {
|
||||
throw new Error(`No Bun release found matching version '${version}'`);
|
||||
}
|
||||
|
||||
tag = `bun-v${matchedTag}`;
|
||||
} else if (validate(tag)) {
|
||||
tag = `bun-v${tag}`;
|
||||
if (validateStrict(version)) {
|
||||
tag = `bun-v${version}`;
|
||||
}
|
||||
|
||||
const eversion = encodeURIComponent(tag ?? version);
|
||||
if (!tag) {
|
||||
const res = (await (
|
||||
await request("https://api.github.com/repos/oven-sh/bun/git/refs/tags", {
|
||||
headers: options.token
|
||||
? { "Authorization": `Bearer ${options.token}` }
|
||||
: {},
|
||||
})
|
||||
).json()) as { ref: string }[];
|
||||
|
||||
let tags = res
|
||||
.filter(
|
||||
(tag) =>
|
||||
tag.ref.startsWith("refs/tags/bun-v") ||
|
||||
tag.ref === "refs/tags/canary",
|
||||
)
|
||||
.map((item) => item.ref.replace(/refs\/tags\/(bun-v)?/g, ""))
|
||||
.filter(Boolean);
|
||||
|
||||
tag = tags.find((t) => t === version);
|
||||
if (!tag) {
|
||||
tags = tags.filter((t) => validate(t)).sort(compareVersions);
|
||||
|
||||
const matchedTag =
|
||||
version === "latest" || !version
|
||||
? tags.at(-1)
|
||||
: tags.filter((t) => satisfies(t, version)).at(-1);
|
||||
|
||||
if (!matchedTag) {
|
||||
throw new Error(`No Bun release found matching version '${version}'`);
|
||||
}
|
||||
|
||||
tag = `bun-v${matchedTag}`;
|
||||
} else if (validate(tag)) {
|
||||
tag = `bun-v${tag}`;
|
||||
}
|
||||
}
|
||||
|
||||
const resolvedTag = tag ?? version;
|
||||
const eversion = encodeURIComponent(resolvedTag);
|
||||
const eos = encodeURIComponent(os ?? getPlatform());
|
||||
const earch = encodeURIComponent(
|
||||
getArchitecture(os ?? getPlatform(), arch ?? process.arch),
|
||||
getArchitecture(os ?? getPlatform(), arch ?? process.arch, resolvedTag),
|
||||
);
|
||||
const eavx2 = encodeURIComponent(
|
||||
getAvx2(os ?? getPlatform(), arch ?? process.arch, avx2) === false
|
||||
getAvx2(os ?? getPlatform(), arch ?? process.arch, avx2, resolvedTag) ===
|
||||
false
|
||||
? "-baseline"
|
||||
: "",
|
||||
);
|
||||
|
||||
+63
-14
@@ -1,7 +1,21 @@
|
||||
import { debug, warning } from "@actions/core";
|
||||
import { info } from "node:console";
|
||||
import { createHash } from "node:crypto";
|
||||
import { existsSync, readFileSync, renameSync } from "node:fs";
|
||||
import { resolve, basename } from "node:path";
|
||||
import { compareVersions, validate } from "compare-versions";
|
||||
|
||||
// First Bun version that ships native Windows ARM64 binaries.
|
||||
const WINDOWS_ARM64_MIN_VERSION = "1.3.10";
|
||||
|
||||
export function getCacheKey(url: string): string {
|
||||
return `bun-${createHash("sha1").update(url).digest("base64")}`;
|
||||
}
|
||||
|
||||
export function extractVersionFromUrl(url: string): string | undefined {
|
||||
const match = url.match(/\/bun-v([^/]+)\//);
|
||||
return match?.[1];
|
||||
}
|
||||
|
||||
export async function request(
|
||||
url: string,
|
||||
@@ -42,28 +56,63 @@ export function getPlatform(): string {
|
||||
return platform;
|
||||
}
|
||||
|
||||
export function getArchitecture(os: string, arch: string): string {
|
||||
if (os === "windows" && (arch === "aarch64" || arch === "arm64")) {
|
||||
warning(
|
||||
[
|
||||
"⚠️ Bun does not provide native arm64 builds for Windows.",
|
||||
"Using x64 baseline build which will run through Microsoft's x64 emulation layer.",
|
||||
"This may result in reduced performance and potential compatibility issues.",
|
||||
"💡 For best performance, consider using x64 Windows runners or other platforms with native support.",
|
||||
].join("\n"),
|
||||
);
|
||||
export function hasNativeWindowsArm64(version?: string): boolean {
|
||||
if (!version) return false;
|
||||
const cleaned = version.replace(/^bun-v/, "");
|
||||
// Non-semver versions like "canary" represent latest builds which ship ARM64.
|
||||
if (!validate(cleaned)) return true;
|
||||
return compareVersions(cleaned, WINDOWS_ARM64_MIN_VERSION) >= 0;
|
||||
}
|
||||
|
||||
return "x64";
|
||||
export function getArchitecture(
|
||||
os: string,
|
||||
arch: string,
|
||||
version?: string,
|
||||
): string {
|
||||
if (os === "windows" && (arch === "aarch64" || arch === "arm64")) {
|
||||
if (!hasNativeWindowsArm64(version)) {
|
||||
warning(
|
||||
[
|
||||
"⚠️ This version of Bun does not provide native arm64 builds for Windows.",
|
||||
"Using x64 baseline build which will run through Microsoft's x64 emulation layer.",
|
||||
"This may result in reduced performance and potential compatibility issues.",
|
||||
"💡 For best performance, consider using Bun >= 1.3.10, x64 Windows runners, or other platforms with native support.",
|
||||
].join("\n"),
|
||||
);
|
||||
|
||||
return "x64";
|
||||
}
|
||||
}
|
||||
|
||||
if (arch === "arm64") return "aarch64";
|
||||
return arch;
|
||||
}
|
||||
|
||||
export function getAvx2(os: string, arch: string, avx2?: boolean): boolean {
|
||||
// Temporary workaround for absence of arm64 builds on Windows (#130)
|
||||
export function getAvx2(
|
||||
os: string,
|
||||
arch: string,
|
||||
avx2?: boolean,
|
||||
version?: string,
|
||||
): boolean {
|
||||
// Workaround for absence of arm64 builds on Windows before 1.3.10 (#130)
|
||||
if (os === "windows" && (arch === "aarch64" || arch === "arm64")) {
|
||||
return false;
|
||||
if (!hasNativeWindowsArm64(version)) {
|
||||
return false;
|
||||
}
|
||||
// Native ARM64 builds don't use AVX2 suffix
|
||||
return true;
|
||||
}
|
||||
|
||||
// Check AVX2 support on x64 Linux
|
||||
if (os === "linux" && arch === "x64" && avx2 === undefined) {
|
||||
try {
|
||||
const cpuInfo = readFileSync("/proc/cpuinfo", "utf8");
|
||||
const hasAvx2 = cpuInfo.includes("avx2");
|
||||
return hasAvx2;
|
||||
} catch (error) {
|
||||
warning(`Failed to detect AVX2 support.`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return avx2 ?? true;
|
||||
|
||||
@@ -0,0 +1,244 @@
|
||||
import { afterEach, beforeEach, describe, expect, it, spyOn } from "bun:test";
|
||||
import { getDownloadUrl } from "../src/download-url";
|
||||
import * as utils from "../src/utils";
|
||||
|
||||
const MOCK_TAGS = [
|
||||
{ ref: "refs/tags/bun-v0.5.0" },
|
||||
{ ref: "refs/tags/bun-v1.0.0" },
|
||||
{ ref: "refs/tags/bun-v1.0.1" },
|
||||
{ ref: "refs/tags/bun-v1.1.0" },
|
||||
{ ref: "refs/tags/bun-v1.3.9" },
|
||||
{ ref: "refs/tags/bun-v1.3.10" },
|
||||
{ ref: "refs/tags/bun-v1.4.0" },
|
||||
{ ref: "refs/tags/canary" },
|
||||
];
|
||||
|
||||
describe("getDownloadUrl", () => {
|
||||
let requestSpy: ReturnType<typeof spyOn>;
|
||||
|
||||
beforeEach(() => {
|
||||
requestSpy = spyOn(utils, "request").mockResolvedValue({
|
||||
json: async () => MOCK_TAGS,
|
||||
} as Response);
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
requestSpy.mockRestore();
|
||||
});
|
||||
|
||||
describe("Custom URL", () => {
|
||||
it("should return customUrl if provided", async () => {
|
||||
const url = await getDownloadUrl({
|
||||
customUrl: "https://example.com/bun.zip",
|
||||
});
|
||||
expect(url).toBe("https://example.com/bun.zip");
|
||||
expect(requestSpy).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Optimization (No API Call)", () => {
|
||||
it("should construct URL directly for specific version 1.0.0", async () => {
|
||||
const url = await getDownloadUrl({
|
||||
version: "1.0.0",
|
||||
os: "linux",
|
||||
arch: "x64",
|
||||
});
|
||||
|
||||
expect(url).toBe(
|
||||
"https://github.com/oven-sh/bun/releases/download/bun-v1.0.0/bun-linux-x64.zip",
|
||||
);
|
||||
expect(requestSpy).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
|
||||
it("should construct URL directly for specific version 0.5.0", async () => {
|
||||
const url = await getDownloadUrl({
|
||||
version: "0.5.0",
|
||||
os: "darwin",
|
||||
arch: "aarch64",
|
||||
});
|
||||
|
||||
expect(url).toBe(
|
||||
"https://github.com/oven-sh/bun/releases/download/bun-v0.5.0/bun-darwin-aarch64.zip",
|
||||
);
|
||||
expect(requestSpy).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
|
||||
it("should handle avx2=false (baseline) without API call", async () => {
|
||||
const url = await getDownloadUrl({
|
||||
version: "1.1.0",
|
||||
os: "linux",
|
||||
arch: "x64",
|
||||
avx2: false,
|
||||
});
|
||||
|
||||
expect(url).toBe(
|
||||
"https://github.com/oven-sh/bun/releases/download/bun-v1.1.0/bun-linux-x64-baseline.zip",
|
||||
);
|
||||
expect(requestSpy).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
|
||||
it("should handle profile=true without API call", async () => {
|
||||
const url = await getDownloadUrl({
|
||||
version: "1.1.0",
|
||||
os: "linux",
|
||||
arch: "x64",
|
||||
profile: true,
|
||||
});
|
||||
|
||||
expect(url).toBe(
|
||||
"https://github.com/oven-sh/bun/releases/download/bun-v1.1.0/bun-linux-x64-profile.zip",
|
||||
);
|
||||
expect(requestSpy).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
});
|
||||
|
||||
describe("API Lookup (Dynamic Versions)", () => {
|
||||
it("should call API and resolve 'latest' to the newest version", async () => {
|
||||
const url = await getDownloadUrl({
|
||||
version: "latest",
|
||||
os: "linux",
|
||||
arch: "x64",
|
||||
});
|
||||
|
||||
expect(url).toBe(
|
||||
"https://github.com/oven-sh/bun/releases/download/bun-v1.4.0/bun-linux-x64.zip",
|
||||
);
|
||||
expect(requestSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("should call API and resolve semver range '^1.0.0'", async () => {
|
||||
const url = await getDownloadUrl({
|
||||
version: "^1.0.0",
|
||||
os: "linux",
|
||||
arch: "x64",
|
||||
});
|
||||
|
||||
expect(url).toBe(
|
||||
"https://github.com/oven-sh/bun/releases/download/bun-v1.4.0/bun-linux-x64.zip",
|
||||
);
|
||||
expect(requestSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("should call API and resolve 'canary'", async () => {
|
||||
const url = await getDownloadUrl({
|
||||
version: "canary",
|
||||
os: "linux",
|
||||
arch: "x64",
|
||||
});
|
||||
|
||||
expect(url).toBe(
|
||||
"https://github.com/oven-sh/bun/releases/download/canary/bun-linux-x64.zip",
|
||||
);
|
||||
expect(requestSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("should throw error if semver range matches nothing", async () => {
|
||||
expect(
|
||||
getDownloadUrl({
|
||||
version: "^2.0.0",
|
||||
os: "linux",
|
||||
arch: "x64",
|
||||
}),
|
||||
).rejects.toThrow("No Bun release found matching version '^2.0.0'");
|
||||
expect(requestSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Windows ARM64", () => {
|
||||
it("should use native aarch64 binary for Bun >= 1.3.10", async () => {
|
||||
const url = await getDownloadUrl({
|
||||
version: "1.3.10",
|
||||
os: "windows",
|
||||
arch: "arm64",
|
||||
});
|
||||
|
||||
expect(url).toBe(
|
||||
"https://github.com/oven-sh/bun/releases/download/bun-v1.3.10/bun-windows-aarch64.zip",
|
||||
);
|
||||
expect(requestSpy).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
|
||||
it("should use native aarch64 binary for Bun 1.4.0", async () => {
|
||||
const url = await getDownloadUrl({
|
||||
version: "1.4.0",
|
||||
os: "windows",
|
||||
arch: "arm64",
|
||||
});
|
||||
|
||||
expect(url).toBe(
|
||||
"https://github.com/oven-sh/bun/releases/download/bun-v1.4.0/bun-windows-aarch64.zip",
|
||||
);
|
||||
expect(requestSpy).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
|
||||
it("should fall back to x64-baseline for Bun < 1.3.10", async () => {
|
||||
const url = await getDownloadUrl({
|
||||
version: "1.1.0",
|
||||
os: "windows",
|
||||
arch: "arm64",
|
||||
});
|
||||
|
||||
expect(url).toBe(
|
||||
"https://github.com/oven-sh/bun/releases/download/bun-v1.1.0/bun-windows-x64-baseline.zip",
|
||||
);
|
||||
expect(requestSpy).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
|
||||
it("should fall back to x64-baseline for Bun 1.3.9", async () => {
|
||||
const url = await getDownloadUrl({
|
||||
version: "1.3.9",
|
||||
os: "windows",
|
||||
arch: "arm64",
|
||||
});
|
||||
|
||||
expect(url).toBe(
|
||||
"https://github.com/oven-sh/bun/releases/download/bun-v1.3.9/bun-windows-x64-baseline.zip",
|
||||
);
|
||||
expect(requestSpy).toHaveBeenCalledTimes(0);
|
||||
});
|
||||
|
||||
it("should use native aarch64 for dynamic version resolving to >= 1.3.10", async () => {
|
||||
const url = await getDownloadUrl({
|
||||
version: "^1.3.0",
|
||||
os: "windows",
|
||||
arch: "arm64",
|
||||
});
|
||||
|
||||
expect(url).toBe(
|
||||
"https://github.com/oven-sh/bun/releases/download/bun-v1.4.0/bun-windows-aarch64.zip",
|
||||
);
|
||||
expect(requestSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it("should use native aarch64 for canary on Windows ARM64", async () => {
|
||||
const url = await getDownloadUrl({
|
||||
version: "canary",
|
||||
os: "windows",
|
||||
arch: "arm64",
|
||||
});
|
||||
|
||||
expect(url).toBe(
|
||||
"https://github.com/oven-sh/bun/releases/download/canary/bun-windows-aarch64.zip",
|
||||
);
|
||||
expect(requestSpy).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Token Handling", () => {
|
||||
it("should pass token to API request when resolving dynamic versions", async () => {
|
||||
await getDownloadUrl({
|
||||
version: "latest",
|
||||
token: "my-secret-token",
|
||||
os: "linux",
|
||||
arch: "x64",
|
||||
});
|
||||
|
||||
expect(requestSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining("api.github.com"),
|
||||
expect.objectContaining({
|
||||
headers: { Authorization: "Bearer my-secret-token" },
|
||||
}),
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
+105
-32
@@ -1,7 +1,52 @@
|
||||
import { afterEach, describe, expect, it, spyOn } from "bun:test";
|
||||
import { getArchitecture, getAvx2 } from "../src/utils";
|
||||
import { extractVersionFromUrl, getArchitecture, getAvx2, hasNativeWindowsArm64 } from "../src/utils";
|
||||
import * as core from "@actions/core";
|
||||
|
||||
describe("extractVersionFromUrl", () => {
|
||||
it("should extract version from standard download URL", () => {
|
||||
expect(extractVersionFromUrl("https://github.com/oven-sh/bun/releases/download/bun-v1.3.1/bun-linux-x64.zip")).toBe("1.3.1");
|
||||
expect(extractVersionFromUrl("https://github.com/oven-sh/bun/releases/download/bun-v1.0.0/bun-darwin-aarch64.zip")).toBe("1.0.0");
|
||||
expect(extractVersionFromUrl("https://github.com/oven-sh/bun/releases/download/bun-v0.5.0/bun-linux-x64-baseline.zip")).toBe("0.5.0");
|
||||
});
|
||||
|
||||
it("should extract version from URL with profile suffix", () => {
|
||||
expect(extractVersionFromUrl("https://github.com/oven-sh/bun/releases/download/bun-v1.1.0/bun-linux-x64-profile.zip")).toBe("1.1.0");
|
||||
});
|
||||
|
||||
it("should return undefined for canary URL", () => {
|
||||
expect(extractVersionFromUrl("https://github.com/oven-sh/bun/releases/download/canary/bun-linux-x64.zip")).toBeUndefined();
|
||||
});
|
||||
|
||||
it("should return undefined for custom/non-standard URL", () => {
|
||||
expect(extractVersionFromUrl("https://example.com/bun.zip")).toBeUndefined();
|
||||
});
|
||||
});
|
||||
|
||||
describe("hasNativeWindowsArm64", () => {
|
||||
it("should return true for version >= 1.3.10", () => {
|
||||
expect(hasNativeWindowsArm64("bun-v1.3.10")).toBe(true);
|
||||
expect(hasNativeWindowsArm64("bun-v1.3.11")).toBe(true);
|
||||
expect(hasNativeWindowsArm64("bun-v1.4.0")).toBe(true);
|
||||
expect(hasNativeWindowsArm64("bun-v2.0.0")).toBe(true);
|
||||
});
|
||||
|
||||
it("should return false for version < 1.3.10", () => {
|
||||
expect(hasNativeWindowsArm64("bun-v1.3.9")).toBe(false);
|
||||
expect(hasNativeWindowsArm64("bun-v1.2.0")).toBe(false);
|
||||
expect(hasNativeWindowsArm64("bun-v1.0.0")).toBe(false);
|
||||
expect(hasNativeWindowsArm64("bun-v0.5.0")).toBe(false);
|
||||
});
|
||||
|
||||
it("should return true for non-semver versions like canary", () => {
|
||||
expect(hasNativeWindowsArm64("canary")).toBe(true);
|
||||
expect(hasNativeWindowsArm64("latest")).toBe(true);
|
||||
});
|
||||
|
||||
it("should return false for undefined version", () => {
|
||||
expect(hasNativeWindowsArm64(undefined)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("getArchitecture", () => {
|
||||
let warningSpy: ReturnType<typeof spyOn>;
|
||||
|
||||
@@ -9,30 +54,54 @@ describe("getArchitecture", () => {
|
||||
warningSpy?.mockRestore();
|
||||
});
|
||||
|
||||
it("should return x64 for Windows with arm64 architecture", () => {
|
||||
it("should return aarch64 for Windows arm64 with Bun >= 1.3.10", () => {
|
||||
warningSpy = spyOn(core, "warning");
|
||||
const result = getArchitecture("windows", "arm64", "bun-v1.3.10");
|
||||
|
||||
expect(result).toBe("aarch64");
|
||||
expect(warningSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should return aarch64 for Windows aarch64 with Bun >= 1.3.10", () => {
|
||||
warningSpy = spyOn(core, "warning");
|
||||
const result = getArchitecture("windows", "aarch64", "bun-v1.4.0");
|
||||
|
||||
expect(result).toBe("aarch64");
|
||||
expect(warningSpy).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("should return x64 for Windows arm64 with Bun < 1.3.10", () => {
|
||||
warningSpy = spyOn(core, "warning");
|
||||
const result = getArchitecture("windows", "arm64", "bun-v1.2.0");
|
||||
|
||||
expect(result).toBe("x64");
|
||||
expect(warningSpy).toHaveBeenCalledTimes(1);
|
||||
expect(warningSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining(
|
||||
"⚠️ This version of Bun does not provide native arm64 builds for Windows."
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
it("should return x64 for Windows aarch64 with Bun < 1.3.10", () => {
|
||||
warningSpy = spyOn(core, "warning");
|
||||
const result = getArchitecture("windows", "aarch64", "bun-v1.0.0");
|
||||
|
||||
expect(result).toBe("x64");
|
||||
expect(warningSpy).toHaveBeenCalledTimes(1);
|
||||
expect(warningSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining(
|
||||
"⚠️ This version of Bun does not provide native arm64 builds for Windows."
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
it("should return x64 for Windows arm64 with no version (fallback)", () => {
|
||||
warningSpy = spyOn(core, "warning");
|
||||
const result = getArchitecture("windows", "arm64");
|
||||
|
||||
expect(result).toBe("x64");
|
||||
expect(warningSpy).toHaveBeenCalledTimes(1);
|
||||
expect(warningSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining(
|
||||
"⚠️ Bun does not provide native arm64 builds for Windows."
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
it("should return x64 for Windows with aarch64 architecture", () => {
|
||||
warningSpy = spyOn(core, "warning");
|
||||
const result = getArchitecture("windows", "aarch64");
|
||||
|
||||
expect(result).toBe("x64");
|
||||
expect(warningSpy).toHaveBeenCalledTimes(1);
|
||||
expect(warningSpy).toHaveBeenCalledWith(
|
||||
expect.stringContaining(
|
||||
"⚠️ Bun does not provide native arm64 builds for Windows."
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
it("should return aarch64 for non-Windows platforms with arm64", () => {
|
||||
@@ -77,24 +146,28 @@ describe("getArchitecture", () => {
|
||||
});
|
||||
|
||||
describe("getAvx2", () => {
|
||||
it("should return false when called with os: 'windows' and arch: 'arm64'", () => {
|
||||
const result = getAvx2("windows", "arm64");
|
||||
expect(result).toBe(false);
|
||||
it("should return false for Windows arm64 with Bun < 1.3.10", () => {
|
||||
expect(getAvx2("windows", "arm64", undefined, "bun-v1.2.0")).toBe(false);
|
||||
});
|
||||
|
||||
it("should return false when called with os: 'windows' and arch: 'aarch64'", () => {
|
||||
const result = getAvx2("windows", "aarch64");
|
||||
expect(result).toBe(false);
|
||||
it("should return false for Windows aarch64 with Bun < 1.3.10", () => {
|
||||
expect(getAvx2("windows", "aarch64", undefined, "bun-v1.0.0")).toBe(false);
|
||||
});
|
||||
|
||||
it("should return false when called with os: 'windows', arch: 'arm64', and avx2: true", () => {
|
||||
const result = getAvx2("windows", "arm64", true);
|
||||
expect(result).toBe(false);
|
||||
it("should return false for Windows arm64 with no version (fallback)", () => {
|
||||
expect(getAvx2("windows", "arm64")).toBe(false);
|
||||
});
|
||||
|
||||
it("should return false when called with os: 'windows', arch: 'aarch64', and avx2: false", () => {
|
||||
const result = getAvx2("windows", "aarch64", false);
|
||||
expect(result).toBe(false);
|
||||
it("should return false for Windows aarch64 with no version (fallback)", () => {
|
||||
expect(getAvx2("windows", "aarch64")).toBe(false);
|
||||
});
|
||||
|
||||
it("should return true for Windows arm64 with Bun >= 1.3.10", () => {
|
||||
expect(getAvx2("windows", "arm64", undefined, "bun-v1.3.10")).toBe(true);
|
||||
});
|
||||
|
||||
it("should return true for Windows aarch64 with Bun >= 1.3.10", () => {
|
||||
expect(getAvx2("windows", "aarch64", undefined, "bun-v1.4.0")).toBe(true);
|
||||
});
|
||||
|
||||
it("should return the provided avx2 value (true) when specified and not on Windows ARM64", () => {
|
||||
|
||||
Reference in New Issue
Block a user