mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-02-23 10:40:10 +08:00
fix: dont fail
This commit is contained in:
parent
633e7abe1e
commit
37657f4f9f
6
.github/workflows/test.yml
vendored
6
.github/workflows/test.yml
vendored
@ -29,4 +29,8 @@ jobs:
|
|||||||
misc-test-builds: ${{ matrix.misc-test-builds }}
|
misc-test-builds: ${{ matrix.misc-test-builds }}
|
||||||
|
|
||||||
- name: Try bun
|
- name: Try bun
|
||||||
run: bun --version
|
run: bun --version
|
||||||
|
|
||||||
|
- name: Show status
|
||||||
|
if: always()
|
||||||
|
run: echo $status
|
2
dist/index.js
vendored
2
dist/index.js
vendored
@ -21,7 +21,7 @@ const main = async () => {
|
|||||||
if ((release === null || release === void 0 ? void 0 : release.message) === 'Not Found')
|
if ((release === null || release === void 0 ? void 0 : release.message) === 'Not Found')
|
||||||
return exit('Invalid bun version.', miscTestBuilds);
|
return exit('Invalid bun version.', miscTestBuilds);
|
||||||
info(`Going to install release ${release.version}`);
|
info(`Going to install release ${release.version}`);
|
||||||
await install(release, miscTestBuilds);
|
await install(release);
|
||||||
setOutput('bun-version', release.tag_name);
|
setOutput('bun-version', release.tag_name);
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
|
8
dist/utils/getAsset.js
vendored
8
dist/utils/getAsset.js
vendored
@ -1,5 +1,5 @@
|
|||||||
import { exit } from '../index.js';
|
import { exit } from '../index.js';
|
||||||
export default (assets, miscTestBuilds) => {
|
export default (assets) => {
|
||||||
let arch;
|
let arch;
|
||||||
switch (process.arch) {
|
switch (process.arch) {
|
||||||
case 'arm64':
|
case 'arm64':
|
||||||
@ -15,10 +15,8 @@ export default (assets, miscTestBuilds) => {
|
|||||||
throw new Error(`Unsupported platform ${process.platform}.`);
|
throw new Error(`Unsupported platform ${process.platform}.`);
|
||||||
const assetName = `bun-${process.platform}-${arch}.zip`;
|
const assetName = `bun-${process.platform}-${arch}.zip`;
|
||||||
const asset = assets.find(asset => asset.name === assetName);
|
const asset = assets.find(asset => asset.name === assetName);
|
||||||
if (!asset) {
|
if (!asset)
|
||||||
exit(`Invalid asset ${assetName}`, miscTestBuilds);
|
exit(`Invalid asset ${assetName}`);
|
||||||
process.exit();
|
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
name: `bun-${process.platform}-${arch}`,
|
name: `bun-${process.platform}-${arch}`,
|
||||||
asset: assets.find(asset => asset.name === `bun-${process.platform}-${arch}.zip`),
|
asset: assets.find(asset => asset.name === `bun-${process.platform}-${arch}.zip`),
|
||||||
|
4
dist/utils/install.js
vendored
4
dist/utils/install.js
vendored
@ -4,8 +4,8 @@ import { addPath, info } from '@actions/core';
|
|||||||
import getAsset from './getAsset.js';
|
import getAsset from './getAsset.js';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { homedir } from 'os';
|
import { homedir } from 'os';
|
||||||
export default async (release, miscTestBuilds) => {
|
export default async (release) => {
|
||||||
const asset = getAsset(release.assets, miscTestBuilds);
|
const asset = getAsset(release.assets);
|
||||||
const path = join(homedir(), '.bun', 'bin', asset.name);
|
const path = join(homedir(), '.bun', 'bin', asset.name);
|
||||||
const cache = find('bun', release.version) || await restoreCache([path], `bun-${process.platform}-${asset.name}-${release.version}`);
|
const cache = find('bun', release.version) || await restoreCache([path], `bun-${process.platform}-${asset.name}-${release.version}`);
|
||||||
if (cache) {
|
if (cache) {
|
||||||
|
@ -24,7 +24,7 @@ const main = async() => {
|
|||||||
|
|
||||||
info(`Going to install release ${release.version}`);
|
info(`Going to install release ${release.version}`);
|
||||||
|
|
||||||
await install(release, miscTestBuilds);
|
await install(release);
|
||||||
|
|
||||||
setOutput('bun-version', release.tag_name);
|
setOutput('bun-version', release.tag_name);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { exit } from '../index.js';
|
import { exit } from '../index.js';
|
||||||
import { Asset } from './getGithubRelease.js';
|
import { Asset } from './getGithubRelease.js';
|
||||||
|
|
||||||
export default (assets: Asset[], miscTestBuilds: boolean) => {
|
export default (assets: Asset[]) => {
|
||||||
let arch;
|
let arch;
|
||||||
switch (process.arch) {
|
switch (process.arch) {
|
||||||
case 'arm64':
|
case 'arm64':
|
||||||
@ -20,10 +20,7 @@ export default (assets: Asset[], miscTestBuilds: boolean) => {
|
|||||||
const assetName = `bun-${process.platform}-${arch}.zip`;
|
const assetName = `bun-${process.platform}-${arch}.zip`;
|
||||||
const asset = assets.find(asset => asset.name === assetName);
|
const asset = assets.find(asset => asset.name === assetName);
|
||||||
|
|
||||||
if (!asset) {
|
if (!asset) exit(`Invalid asset ${assetName}`);
|
||||||
exit(`Invalid asset ${assetName}`, miscTestBuilds);
|
|
||||||
process.exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
name: `bun-${process.platform}-${arch}`,
|
name: `bun-${process.platform}-${arch}`,
|
||||||
|
@ -6,8 +6,8 @@ import getAsset from './getAsset.js';
|
|||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { homedir } from 'os';
|
import { homedir } from 'os';
|
||||||
|
|
||||||
export default async(release: Release, miscTestBuilds: boolean) => {
|
export default async(release: Release) => {
|
||||||
const asset = getAsset(release.assets, miscTestBuilds);
|
const asset = getAsset(release.assets);
|
||||||
const path = join(homedir(), '.bun', 'bin', asset.name);
|
const path = join(homedir(), '.bun', 'bin', asset.name);
|
||||||
const cache = find('bun', release.version) || await restoreCache([path], `bun-${process.platform}-${asset.name}-${release.version}`);
|
const cache = find('bun', release.version) || await restoreCache([path], `bun-${process.platform}-${asset.name}-${release.version}`);
|
||||||
if (cache) {
|
if (cache) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user