Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 34 additions & 5 deletions build/continuous-deploy-fingerprint-info/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 34 additions & 5 deletions build/continuous-deploy-fingerprint/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 29 additions & 2 deletions build/preview-build/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 29 additions & 2 deletions build/preview/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions src/fingerprintUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { getExecOutput } from '@actions/exec';
import { which } from '@actions/io';

import { BuildInfo, BuildStatus } from './expo';
import { resolvePackageRunner } from './packageRunner';

export async function getBuildInfoForCurrentFingerprintAsync({
platform,
Expand Down Expand Up @@ -68,10 +69,11 @@ async function getFingerprintHashForPlatformAsync({
let args: string[];
if (environment) {
commandLine = await which('eas', true);
const commandToExecute = ['npx', ...baseArguments].join(' ').replace(/"/g, '\\"');
const runner = await resolvePackageRunner();
const commandToExecute = [runner, ...baseArguments].join(' ').replace(/"/g, '\\"');
args = ['env:exec', '--non-interactive', environment, `"${commandToExecute}"`];
} else {
commandLine = 'npx';
commandLine = await resolvePackageRunner();
args = baseArguments;
}

Expand Down Expand Up @@ -112,7 +114,7 @@ export async function getBuildInfoWithFingerprintAsync({
platform,
'--buildProfile',
profile,
'--runtimeVersion',
'--fingerprint-hash',
fingerprintHash,
'--limit',
'1',
Expand Down
14 changes: 14 additions & 0 deletions src/packageRunner.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { which } from '@actions/io';

/**
* Resolve the package runner to use for executing expo commands.
* Prefers `bunx` if available (works better with bun-managed projects),
* falls back to `npx`.
*/
export async function resolvePackageRunner(): Promise<string> {
try {
return await which('bunx', true);
} catch {
return 'npx';
}
}
7 changes: 5 additions & 2 deletions src/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { getExecOutput } from '@actions/exec';
import { which } from '@actions/io';
import { ExpoConfig } from '@expo/config';

import { resolvePackageRunner } from './packageRunner';

/**
* Load the Expo app project config in the given directory.
* This runs `expo config` command instead of using `@expo/config` directly,
Expand All @@ -20,10 +22,11 @@ export async function loadProjectConfig(
let args: string[];
if (easEnvironment) {
commandLine = await which('eas', true);
const commandToExecute = ['npx', ...baseArguments].join(' ').replace(/"/g, '\\"');
const runner = await resolvePackageRunner();
const commandToExecute = [runner, ...baseArguments].join(' ').replace(/"/g, '\\"');
args = ['env:exec', '--non-interactive', easEnvironment, `"${commandToExecute}"`];
} else {
commandLine = 'npx';
commandLine = await resolvePackageRunner();
args = baseArguments;
}

Expand Down