-
Notifications
You must be signed in to change notification settings - Fork 128
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
Add automation and configuration for Prototype Builds #1769
Conversation
As in, the configuration for prototype builds
# Notice the `in_house: true` parameter. | ||
# Unfortunately, even using it, the API does not allow modifying certs or profiles via API key. | ||
# It's here for reference and future-proofing. | ||
api_key = app_store_connect_api_key(in_house: true) |
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 discovered the in_house
parameter in the docs while working on something else. I had my hopes up it would have spared us the trouble of authenticating locally when running for Enterprise in readonly: false
but it didn't work...
@@ -120,7 +103,7 @@ | |||
buildConfiguration = "Debug"> | |||
</AnalyzeAction> | |||
<ArchiveAction | |||
buildConfiguration = "Release" | |||
buildConfiguration = "Prototype" | |||
revealArchiveInOrganizer = "YES"> | |||
</ArchiveAction> | |||
</Scheme> |
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.
This scheme looks like and edit of an existing in this diff because of how textual diffs work, but once #1767 lands it'll be a new one.
<string>group.au.com.shiftyjelly.pocketcasts.prototype</string> | ||
</array> | ||
</dict> | ||
</plist> |
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 don't like how the entitlements are in the root of the target but I didn't change it to avoid more noise in the diff. I'd like to:
- Have them in
podcasts/entitlements/
- For the debug one to follow the
.<config>.entitlement
naming convention
bc058f0
to
3bf522d
Compare
.buildkite/commands/build.sh
Outdated
@@ -1,9 +1,6 @@ | |||
#!/bin/bash -u | |||
|
|||
echo "--- Set up SPM" | |||
# We'd like to use this, but it doesn't work yet. See | |||
# https://github.com/Automattic/bash-cache-buildkite-plugin/issues/20 ... | |||
# |
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.
This comment was a leftover. But looking at the rest of the code it seems like all the following SSH code is unnecessary now that 1) everything is private and 2) we have a CI pluging command for SPM
3258f46
to
c34b76a
Compare
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.
@mokagio the Staging
is actually used though. 😬
Basically, we always build this configuration when we want to test stuff using the staging backend. You can see some #if STAGING
macros in the code.
We've been discussing moving that to a toggle because the change in configuration is not obvious and Xcode rebuilds the whole app when we do so — so this is not a blocker.
However, I'm having issues testing the Prototype configuration:
Showing All Errors Only
/Users/leandroalonso/Documents/pocketcasts/alpha/podcasts.xcodeproj:1:1: Unable to open base configuration reference file '/Users/leandroalonso/Documents/pocketcasts/alpha/Pods/Target Support Files/Pods-podcasts/Pods-podcasts.prototype.xcconfig'.
Unable to load contents of file list: '/Target Support Files/Pods-podcasts/Pods-podcasts-frameworks-Prototype-input-files.xcfilelist'
Unable to load contents of file list: '/Target Support Files/Pods-podcasts/Pods-podcasts-frameworks-Prototype-output-files.xcfilelist'
There's an additional step I need to do to build it?
@leandroalonso Hey there!
Ouch! 🤦♂️
That would also make it easier to test WIP features in the staging backend on a prototype build 😄 I'll open a PR to restore the Staging build configuration 👍 |
From the logs, I think you might need to run CocoaPods generates |
See conversation at #1769 (review)
Generated by 🚫 Danger |
I didn't realize on which branch I was and pushed to this PR instead of opening a new one. Anyway, the Staging build configuration is back in place. It seems better to have it available than to have to remember about the build flag until the day a toggle in the settings will be implemented. |
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.
@leandroalonso I removed the hardcoded value that resulted in the failure. The prototype build runs on my end. And so do the staging and debug builds. |
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.
@mokagio now it works for me!
However when running bundle exec fastlane build_enterprise
it fails:
[!] pocket-casts-ios.env not found in /Users/leandroalonso/.a8c-apps!
Please copy fastlane/example.env to /Users/leandroalonso/.a8c-apps/pocket-casts-ios.env and fill in the values for the automation you require.
mkdir -p /Users/leandroalonso/.a8c-apps && cp fastlane/example.env /Users/leandroalonso/.a8c-apps/pocket-casts-ios.env
Here I saw you mentioning:
I'll followup tomorrow with a PR that sets up the .env pattern to account for local builds.
Was that done? Do I need to run any command to have this set up?
Yes, via #1761 The prompt suggests to run:
Which should create the file in the expected location. Then, one needs to add the correct env vars in there. You can find the values in |
@mokagio if I just execute the command, the build fails. Then I copied the
Am I doing something wrong? |
@leandroalonso sorry for the late followup
Suggest to me that something is missing or misconfigured in your local pods installation. I say "your" because CI builds fine once instructed to bypass the pods cache (i.e. generated Pods from scratch including the |
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.
Now it worked!
Sorry for the back and forth @mokagio, good to go!
No worries at all. I found it helped me better understand what CocoaPods does in terms of its |
Internal ref pdnsEh-1D4-p2
This PR replaces the unused "Staging" build configuration with a "Prototype" one.
To get there:
.entitlements
files have been added to the targets that need themxcconfig
level, to avoid having to edit the project file via the error prone Xcode GUIThere is a minor naming asymmetry that I'd like your thoughts on. At the Xcode level, I referred to the new build configuration as "Prototype", in Fastlane as "Enterprise". I did that because the Xcode level is closer to the dev-side of things, where I think it's good to identify the scheme and configuration as "Prototype" because devs will "consume" the build in the established "Prototype Build" pattern within Automattic. But in Fastlane, where we deal with infra and ASC, I found it useful to think with the vocabulary Apple uses.
What do you think?
If the asymmetry is annoying, I'd then use "Prototype" name in Fastlane, too.
Side note, while working on this, I opened the cleanups #1768 and #1767.
To test
Run
bundle exec fastlane build_enterprise
Checklist
CHANGELOG.md
if necessary.