-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENG-9] [eas-cli] implement automatic version bumping for ios builds #231
Conversation
c9cce85
to
b05a134
Compare
Size Change: +103 kB (0%) Total Size: 35.9 MB
|
1935369
to
153c30c
Compare
153c30c
to
611365c
Compare
let's call the field |
packages/eas-cli/src/build/build.ts
Outdated
// Currently we are only updaing runtime version durring build, but if it changes in a future | ||
// this message should also contain more info on that (or be more generic) | ||
await reviewAndCommitChangesAsync(`Update runtime version in the ${projectType} project`, { | ||
await reviewAndCommitChangesAsync(`[EAS Build] Configure project`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For build:configure
we have
[RequestedPlatform.Android]: 'Configure EAS Build for Android',
[RequestedPlatform.iOS]: 'Configure EAS Build for iOS',
[RequestedPlatform.All]: 'Configure EAS Build',
This commit should clearly state that this is commit that happens before build and not build:configure
} | ||
} else { | ||
const buildNumber = IOSConfig.Version.getBuildNumber(exp); | ||
if (buildNumber.match(/^\d+$/)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I remember correctly we discussed that in the case of build number we require the last segment to be a number but except that we should support all formats allowed for this value.
}); | ||
|
||
const iOSManagedSchema = Joi.object({ | ||
workflow: Joi.string().valid('managed').required(), | ||
credentialsSource: Joi.string().valid('local', 'remote', 'auto').default('auto'), | ||
releaseChannel: Joi.string(), | ||
distribution: Joi.string().valid('store', 'internal').default('store'), | ||
autoIncrement: Joi.alternatives() | ||
.try(Joi.boolean(), Joi.string().valid('version', 'buildNumber')) | ||
.default('buildNumber'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.default('buildNumber'), | |
.default(false), |
modifyConfig: (config: any) => void | ||
): Promise<void> { | ||
const paths = ExpoConfig.getConfigFilePaths(projectDir); | ||
assert(paths.staticConfigPath, "can't update dynamic configs"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure that this condition is handled earlier with proper error message sth along the lines autoIncrement
options is not supported with dynamic config
(optional) when you check that you could also verify if the version in config is the same as in static config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
await writePlistAsync(infoPlistPath, infoPlist); | ||
} | ||
|
||
function ensureDynamicConfigDoesNotExist(projectDir: string): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
function ensureDynamicConfigDoesNotExist(projectDir: string): void { | |
function ensureStaticConfigDoesExist(projectDir: string): void { |
Why
https://linear.app/expo/issue/ENG-9/automatic-version-bumping
For iOS builds, we want to automatically bump
CFBundleShortVersionString
orCFBundleVersion
for every build. This lets users run fewer redundant builds. Usually, users forget to bump the version on their own. They find out that they forgot to bump the version after the build completes and .ipa cannot be uploaded to App Store.How
autoIncrement
. Possible values:true
- the same as"buildNumber"
false
- default, does not bump any version"version"
- bumpsCFBundleShortVersionString
"buildNumber"
- bumpsCFBundleVersion
CFBundleShortVersionString
is a semver. A new version is created by bumping the patch version. E.g.1.0.0
->1.0.1
CFBundleVersion
is a semver-like string (e.g.1
,1.2
,1.2.3
,1.2.3.4
, and so on). A new version is created by adding1
to the last component of the string. E.g.1.2.3.29
->1.2.3.30
eas build
fails if the project is configured with it andautoIncrement != false
.Test Plan