Skip to content
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

[eas-cli] feat(build:version:set): Allow for build version to be passed as arg so build:version:set can be used non-interactively #2825

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shaneboyar
Copy link

Why

Since build versions for iOS apps do not need to be incremented across release versions like Android apps, I like to reset the version back to 0 after releasing a new native version of my app. Currently, this must be done interactively and so cant easily be incorporated into an automated process like a Github Action. Allowing for the build version to be passed as an argument will allow for a simple step to be added to an action that can reset my build version as needed.

How

Added a new optional arg to the BuildVersionSetView and bypassed the current prompt if it is provided. If it is preferred to use a flag instead of an arg, I can make that change.

Test Plan

I used the cli with the argument to change my own apps build version.

Setting the version to 0

 ▲ $ easd build:version:set 0 -p ios -e preview                                                                                                                                     
Resolved "development" environment for the build. Learn more: https://docs.expo.dev/eas/environment-variables/#setting-the-environment-for-your-builds
No environment variables with visibility "Plain text" and "Sensitive" found for the "development" environment on EAS.
Environment variables loaded from the "preview" build profile "env" configuration: [REDACTED]

Set buildNumber for project [REDACTED] with bundle identifier [REDACTED] to 0.

Confirming the version is updated with build:version:get

▲ $ easd build:version:get -p ios -e preview
The EAS build profile does not specify a Node.js version. Using the version specified in .nvmrc: 20 
Resolved "development" environment for the build. Learn more: https://docs.expo.dev/eas/environment-variables/#setting-the-environment-for-your-builds
No environment variables with visibility "Plain text" and "Sensitive" found for the "development" environment on EAS.
Environment variables loaded from the "preview" build profile "env" configuration: [REDACTED]

iOS buildNumber - 0

Setting the version to 0 when it is already set to 0

 ▲ $ easd build:version:set 0 -p ios -e preview
Resolved "development" environment for the build. Learn more: https://docs.expo.dev/eas/environment-variables/#setting-the-environment-for-your-builds
No environment variables with visibility "Plain text" and "Sensitive" found for the "development" environment on EAS.
Environment variables loaded from the "preview" build profile "env" configuration: [REDACTED]

Version is already set to 0 for project [REDACTED] with bundle identifier [REDACTED].

Attempting to set the version with invalid input

 ▲ $ easd build:version:set foo -p ios -e preview
Resolved "development" environment for the build. Learn more: https://docs.expo.dev/eas/environment-variables/#setting-the-environment-for-your-builds
No environment variables with visibility "Plain text" and "Sensitive" found for the "development" environment on EAS.
Environment variables loaded from the "preview" build profile "env" configuration: [REDACTED] 

Invalid value: buildNumber needs to consist only of up to 3 dot-separated positive integers

…ment so the command can be used non-interactively
Copy link

Subscribed to pull request

File Patterns Mentions
**/* @szdziedzic, @khamilowicz, @sjchmiela, @radoslawkrzemien

Generated by CodeMention

@shaneboyar
Copy link
Author

/changelog-entry new-feature Allow for build version to be passed as arg so command can be used non-interactively

@shaneboyar shaneboyar changed the title feat(build:version:set): Allow for build version to be passed as arg so command can be used non-interactively feat(build:version:set): Allow for build version to be passed as arg so build:version:set can be used non-interactively Jan 16, 2025
@shaneboyar shaneboyar changed the title feat(build:version:set): Allow for build version to be passed as arg so build:version:set can be used non-interactively [eas-cli] feat(build:version:set): Allow for build version to be passed as arg so build:version:set can be used non-interactively Jan 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant