mirror of
https://github.com/expo/eas-cli.git
synced 2026-11-14 10:08:06 -10:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67ef5bb97b | ||
|
|
c523029a81 |
No files matched your search
@@ -31,6 +31,7 @@ import { uploadApplicationArchive } from '../utils/artifacts';
|
||||
import {
|
||||
configureExpoUpdatesIfInstalledAsync,
|
||||
resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync,
|
||||
updateBuildRuntimeVersionInDatabaseAsync,
|
||||
} from '../utils/expoUpdates';
|
||||
import { uploadEmbeddedBundleAsync } from '../utils/expoUpdatesEmbedded';
|
||||
import { Hook, runHookIfPresent } from '../utils/hooks';
|
||||
@@ -103,7 +104,7 @@ async function buildAsync(ctx: BuildContext<Android.Job>): Promise<void> {
|
||||
const resolvedExpoUpdatesRuntimeVersion = await ctx.runBuildPhase(
|
||||
BuildPhase.CALCULATE_EXPO_UPDATES_RUNTIME_VERSION,
|
||||
async () => {
|
||||
return await resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({
|
||||
const resolved = await resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({
|
||||
cwd: ctx.getReactNativeProjectDirectory(),
|
||||
logger: ctx.logger,
|
||||
appConfig: await ctx.appConfig,
|
||||
@@ -111,6 +112,14 @@ async function buildAsync(ctx: BuildContext<Android.Job>): Promise<void> {
|
||||
workflow: ctx.job.type,
|
||||
env: ctx.env,
|
||||
});
|
||||
if (resolved?.runtimeVersion) {
|
||||
await updateBuildRuntimeVersionInDatabaseAsync(
|
||||
ctx,
|
||||
resolved.runtimeVersion,
|
||||
resolved.fingerprintSources
|
||||
);
|
||||
}
|
||||
return resolved;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import { uploadApplicationArchive } from '../utils/artifacts';
|
||||
import {
|
||||
configureExpoUpdatesIfInstalledAsync,
|
||||
resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync,
|
||||
updateBuildRuntimeVersionInDatabaseAsync,
|
||||
} from '../utils/expoUpdates';
|
||||
import { uploadEmbeddedBundleAsync } from '../utils/expoUpdatesEmbedded';
|
||||
import { Hook, runHookIfPresent } from '../utils/hooks';
|
||||
@@ -104,7 +105,7 @@ async function buildAsync(ctx: BuildContext<Ios.Job>): Promise<void> {
|
||||
const resolvedExpoUpdatesRuntimeVersion = await ctx.runBuildPhase(
|
||||
BuildPhase.CALCULATE_EXPO_UPDATES_RUNTIME_VERSION,
|
||||
async () => {
|
||||
return await resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({
|
||||
const resolved = await resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({
|
||||
cwd: ctx.getReactNativeProjectDirectory(),
|
||||
logger: ctx.logger,
|
||||
appConfig: await ctx.appConfig,
|
||||
@@ -112,6 +113,14 @@ async function buildAsync(ctx: BuildContext<Ios.Job>): Promise<void> {
|
||||
workflow: ctx.job.type,
|
||||
env: ctx.env,
|
||||
});
|
||||
if (resolved?.runtimeVersion) {
|
||||
await updateBuildRuntimeVersionInDatabaseAsync(
|
||||
ctx,
|
||||
resolved.runtimeVersion,
|
||||
resolved.fingerprintSources
|
||||
);
|
||||
}
|
||||
return resolved;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ExpoConfig } from '@expo/config';
|
||||
import { BuildJob, Job, Platform, Workflow } from '@expo/eas-build-job';
|
||||
import { BuildJob, BuildTrigger, Job, Platform, Workflow } from '@expo/eas-build-job';
|
||||
import { bunyan } from '@expo/logger';
|
||||
import { BuildStepEnv } from '@expo/steps';
|
||||
import assert from 'assert';
|
||||
@@ -194,6 +194,42 @@ export async function resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({
|
||||
return resolvedRuntimeVersion;
|
||||
}
|
||||
|
||||
export async function updateBuildRuntimeVersionInDatabaseAsync(
|
||||
ctx: BuildContext<BuildJob>,
|
||||
runtimeVersion: string,
|
||||
fingerprintSources: object[] | null
|
||||
): Promise<void> {
|
||||
const buildId = ctx.env.EAS_BUILD_ID;
|
||||
if (!buildId || ctx.job.triggeredBy !== BuildTrigger.GIT_BASED_INTEGRATION) {
|
||||
return;
|
||||
}
|
||||
const fingerprintHash = fingerprintSources ? runtimeVersion : undefined;
|
||||
const result = await ctx.graphqlClient
|
||||
.mutation(
|
||||
graphql(`
|
||||
mutation UpdateBuildRuntimeVersionMutation(
|
||||
$buildId: ID!
|
||||
$runtimeVersion: String!
|
||||
$fingerprintHash: String
|
||||
) {
|
||||
build {
|
||||
updateBuildMetadata(
|
||||
buildId: $buildId
|
||||
metadata: { runtimeVersion: $runtimeVersion, fingerprintHash: $fingerprintHash }
|
||||
) {
|
||||
id
|
||||
}
|
||||
}
|
||||
}
|
||||
`),
|
||||
{ buildId, runtimeVersion, fingerprintHash }
|
||||
)
|
||||
.toPromise();
|
||||
if (result.error) {
|
||||
throw result.error;
|
||||
}
|
||||
}
|
||||
|
||||
export async function getChannelAsync(ctx: BuildContext<Job>): Promise<string | null> {
|
||||
switch (ctx.job.platform) {
|
||||
case Platform.ANDROID: {
|
||||
|
||||
@@ -178,8 +178,13 @@ export async function prepareBuildRequestForPlatformAsync<
|
||||
}
|
||||
assert(projectArchive);
|
||||
|
||||
// In INTERNAL mode the fingerprint is computed before prebuild runs, so native directories
|
||||
// don't exist yet. The post-prebuild fingerprint is written to the DB by the
|
||||
// CALCULATE_EXPO_UPDATES_RUNTIME_VERSION build phase instead.
|
||||
const runtimeAndFingerprintMetadata =
|
||||
await computeAndMaybeUploadRuntimeAndFingerprintMetadataAsync(ctx);
|
||||
ctx.localBuildOptions.localBuildMode === LocalBuildMode.INTERNAL
|
||||
? {}
|
||||
: await computeAndMaybeUploadRuntimeAndFingerprintMetadataAsync(ctx);
|
||||
const metadata = await collectMetadataAsync(ctx, runtimeAndFingerprintMetadata);
|
||||
const buildParams = resolveBuildParamsInput(ctx, metadata);
|
||||
const job = await builder.prepareJobAsync(ctx, {
|
||||
|
||||
Reference in new issue
Block a user