-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Implementing sz deploy ios
for Automating iOS App Deployment
#695
Conversation
To view this pull requests documentation preview, visit the following URL: docs.page/sharezoneapp/sharezone-app~695 Documentation is deployed and generated using docs.page. |
Gonna review it completely tomorrow (sorry! ;p), but one "bigger" thing I'm not sure about right now is if we should always build the app in the "deploy" command. For me that is a bit unexpected. I guess there could be the default case that no prod app was built, so it will be build when running the deploy command. In this case if there is already a prod app built then it would be used automatically for deployment? Or maybe, since this could be complicating it unnecessarily, lets just add a Ah and for the first approach I don't know how easy it would be to check if an already built app has the |
..addOption( | ||
releaseStageOptionName, | ||
abbr: 's', | ||
allowed: _iosStages, | ||
help: | ||
'The stage to deploy to. The "stable" stage is used for App Store ' | ||
'releases, the "alpha" stage is used for TestFlight releases.', | ||
defaultsTo: 'stable', | ||
) |
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.
Random note: For the deploy web command the have the stages [alpha, beta, prod]
instead of [alpha, beta, stable]
. I guess these should be the same everywhere?
Also can you describe in the help what the stages do exactly and how they are used? From what I gathered "--stage alpha" will need a matching "beta group" in TestFlight called "alpha". Additonally the stage is used in the build process, what will it change there? Is there a change?
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.
Random note: For the deploy web command the have the stages [alpha, beta, prod] instead of [alpha, beta, stable]. I guess these should be the same everywhere?
For now, we don't have an iOS beta track. Web is the only platform with a beta track (which btw we don't use xD).
Also can you describe in the help what the stages do exactly and how they are used? From what I gathered "--stage alpha" will need a matching "beta group" in TestFlight called "alpha". Additonally the stage is used in the build process, what will it change there? Is there a change?
Do you think it's a good idea to describe what the stage parameter changes in the build process / in the app at the help string of the iOS deploy command? I'll also create a PR for sz deploy android
and sz deploy macos
command. Changing the behavior how --dart-define=DEVELOPEMTENT_STAGE
affects the app behavior would require to update the documentation at 5 difference locations (inside the app, at sz deploy ios
, sz deploy android
, sz deploy web
and sz deploy macos
).
My current draft of the help
text is:
The stage to deploy to. The "stable" stage is used for App Store releases, the "alpha" stage is used for TestFlight releases (publishing to a TestFligh group that matches "alpha" as a group name). Additionally, the stage value is passed to the build command.
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.
It was just confusing for me because for me just reading the argument description I thought it was only for TestFlight which confused me because I saw it was also passed to the build command (I forgot all about stages :D).
So I guess one thing I don't like is that the stage name and the TestFlight beta group names are coupled. In my opinion they should be decoupled so that we could change the stage names and not break anything for TestFlight. Decoupling it would have also helped me to understand that the stage string is not primarily for TestFlight, but our definition of deployment stages. They could be decoupled like in the deploy web-app
code (just a simple map should be enough I guess).
Do you think it's a good idea to describe what the stage parameter changes in the build process / in the app at the help string of the iOS deploy command? I'll also create a PR for sz deploy android and sz deploy macos command. Changing the behavior how --dart-define=DEVELOPEMTENT_STAGE affects the app behavior would require to update the documentation at 5 difference locations (inside the app, at sz deploy ios, sz deploy android, sz deploy web and sz deploy macos).
Yeah you're right, a detailed description would be bad.
I like your description. If we decoupled the TestFlight stage name then we could leave the stuff about the beta group out in my opinion.
What about this?
The deployment stage to deploy to. The "stable" stage is used for App Store releases, the "alpha" stage is used for TestFlight releases. The value will be forwarded to the "sz build" command (if a fresh build is necessary).
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.
I'm using now the following the help
value for --stage
:
"The deployment stage to deploy to. The "stable" stage is used for App Store releases, the "alpha" stage is used for TestFlight releases. The value will be forwarded to the "sz build" command "
I also decoupled the stage and the TestFligh Group names 👍
My main intention for the Technically, it's just copying the For this reason, the With this in mind I think having things like |
…698) In #695 I need to work with the attributes of `ProcessResult` but it would be helpful to still use `runProcessSucessfullyOrThrow` since this method checks if the command execution was successful (#695 (comment)).
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.
LGTM 👍
With this PR we make use of the new `sz deploy ios` command (#695) to remove code duplication.
Description
This pull request introduces a significant enhancement to our deployment pipeline, specifically for the iOS app. It automates various stages of the deployment process, including the retrieval of the next build number, app building, and publication to the App Store or TestFlight.
Key changes include:
Deployment Stages and Flavors: The code defines different stages (
stable
,alpha
) and flavors (prod
) for the iOS app deployment. This allows for flexibility in managing various versions of the app.Command Line Options: Several command-line options have been added to provide necessary parameters for the deployment process. These include API keys, issuer ID, private key, release notes, and the build flavor.
Build Number Automation: The function
_getNextBuildNumber
is implemented to fetch the latest build number from Google Play and increment it for the next build.App Building and Publishing: Functions for building the app (
_buildApp
) and publishing it (_publish
) have been implemented. They use the Codemagic CLI tools and require the build number as an argument.Environment Variables: Sensitive information, such as API keys, are fetched from environment variables, keeping them secure and out of the codebase.
This new implementation greatly simplifies the iOS deployment process, making it more streamlined and less prone to manual errors.
Testing
Usage
sz deploy ios --help