generated from bitwarden/template
-
Notifications
You must be signed in to change notification settings - Fork 53
[PM-9375] Build a debug-for-simulator version of the app for easier automated testing #1151
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
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
505678c
Initial build script
KatherineInCode da86f7a
Update scripts
KatherineInCode 445bdf8
Build out workflow
KatherineInCode ae5e2fd
Add a find to see what's going on
KatherineInCode 0bab9cd
Fix typo
KatherineInCode e3d7e04
Recursive copy
KatherineInCode 2108361
Update workflow
KatherineInCode 815b690
Add simulator build to CI main
KatherineInCode 47896a5
Merge branch 'main' into pm-9375/app-build
KatherineInCode 9bdb6f6
Start merging build-sim into build workflow
KatherineInCode 3a1ee75
Update build script to unify it
KatherineInCode 718287b
Update ci-main
KatherineInCode 0e6502b
Pass destination in to build flow
KatherineInCode 43cf693
Remove unnecessary update
KatherineInCode d9577a3
Change file name
KatherineInCode b9e1802
Update name
KatherineInCode d7aac49
Delete things
KatherineInCode c3d4098
Update step name
KatherineInCode 6b7a638
Temporary changes to test ci main flow
KatherineInCode fb6019b
Undo temporary
KatherineInCode 8b619af
Merge branch 'main' into pm-9375/app-build
KatherineInCode 6941e77
Use generic iOS simulator instead of specified one
KatherineInCode 9289566
Pull simulator destination into build script
KatherineInCode 8768c8d
Split out build mode from build variant
KatherineInCode 460d931
Remove simulator as variant
KatherineInCode b5acb08
Revert version read
KatherineInCode a62d201
Update build script doc
vvolkgang ab2431f
Refactor build script, error if an unexpected build mode is provided
vvolkgang 3956e3d
Only upload to testflight Device builds
vvolkgang 5ca715c
Refactor simulator / device prepare and upload steps.
vvolkgang f6c06fe
Only retrieve secrets for Device builds
vvolkgang 5653dc1
Fix artifacts preparation step; removes zip instructions
vvolkgang 34cf1f6
Add compiler flags to artifact name
vvolkgang 7c15338
All steps validations are now positive and specific to Device mode
vvolkgang c4dfbb0
Where we're going we don't need ruby
vvolkgang 0d9b5c5
Fix compiler_flags usage in step
vvolkgang c786d3b
Fix capitalization
KatherineInCode 1710764
Update .github/workflows/CI-main.yml
vvolkgang 9077794
Remove comment
vvolkgang df97810
Merge branch 'main' into pm-9375/app-build
vvolkgang f5dc1ac
Add build mode to artifact name
vvolkgang 371763a
Leftover copypasta :spaghetti:
vvolkgang 3afcba7
Include derived data path
KatherineInCode 3aebbfa
Update variables to match bwwl standards
KatherineInCode 5f646f0
Merge branch 'main' into pm-9375/app-build
KatherineInCode 327bcc3
Fix variable
KatherineInCode File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 0 additions & 19 deletions
19 <
10000
span class="diffstat-block-deleted">
.github/workflows/build-for-simulator.yml
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,82 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Builds the beta Bitwarden iOS app, and outputs an IPA file that can be uploaded to TestFlight. | ||
# Builds the Bitwarden iOS app. | ||
vvolkgang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# If run in Simulator mode, produces an APP file for the iOS Simulator for ease of automated testing. | ||
# If run in Device mode, produces an IPA file that can be uploaded to TestFlight. | ||
# | ||
# Usage: | ||
# | ||
# $ ./build.sh | ||
# $ ./build.sh <build_mode> | ||
# | ||
# Where mode is one of: | ||
# - Device: Build for physical iOS devices | ||
# - Simulator: Build for iOS Simulator | ||
|
||
set -euo pipefail | ||
|
||
bold=$(tput -T ansi bold) | ||
normal=$(tput -T ansi sgr0) | ||
|
||
BUILD_DIR="build" | ||
if [ $# -lt 1 ]; then | ||
echo >&2 "Called without necessary arguments: ${bold}mode${normal}" | ||
echo >&2 "For example: \`Scripts/build.sh Simulator" | ||
exit 1 | ||
fi | ||
|
||
MODE=$1 | ||
|
||
BUILD_DIR="build" | ||
DERIVED_DATA_PATH="${BUILD_DIR}/DerivedData" | ||
ARCHIVE_PATH="${BUILD_DIR}/Bitwarden.xcarchive" | ||
EXPORT_PATH="${BUILD_DIR}/Bitwarden" | ||
|
||
echo "π§± Building in $(pwd)" | ||
echo "π§± Building in ${bold}$(pwd)${normal}" | ||
echo "π§± Using build mode of ${bold}${MODE}${normal}." | ||
echo "π§± Derived Data path ${bold}${DERIVED_DATA_PATH}${normal}" | ||
echo "π§± Archive path ${bold}${ARCHIVE_PATH}${normal}" | ||
echo "π§± Export path ${bold}${EXPORT_PATH}${normal}" | ||
echo "" | ||
|
||
echo "π± Generating xcode project" | ||
echo "π± Generating Xcode project" | ||
mint run xcodegen | ||
echo "" | ||
|
||
mkdir -p "${BUILD_DIR}" | ||
|
||
echo "π¨ Performing Xcode archive" | ||
xcrun xcodebuild archive \ | ||
-project Bitwarden.xcodeproj \ | ||
-scheme Bitwarden \ | ||
-configuration Release \ | ||
-archivePath "${ARCHIVE_PATH}" \ | ||
| xcbeautify --renderer github-actions | ||
echo "" | ||
case "$MODE" in | ||
"Simulator") | ||
echo "π¨ Performing Xcode build" | ||
xcrun xcodebuild \ | ||
-project Bitwarden.xcodeproj \ | ||
-scheme Bitwarden \ | ||
-configuration Debug \ | ||
-destination "generic/platform=iOS Simulator" \ | ||
-derivedDataPath "${DERIVED_DATA_PATH}" \ | ||
| xcbeautify --renderer github-actions | ||
;; | ||
"Device") | ||
echo "π¦ Performing Xcode archive" | ||
xcrun xcodebuild archive \ | ||
-project Bitwarden.xcodeproj \ | ||
-scheme Bitwarden \ | ||
-configuration Release \ | ||
-archivePath "${ARCHIVE_PATH}" \ | ||
-derivedDataPath "${DERIVED_DATA_PATH}" \ | ||
| xcbeautify --renderer github-actions | ||
|
||
echo "π¦ Performing Xcode archive export" | ||
xcrun xcodebuild -exportArchive \ | ||
-archivePath "${ARCHIVE_PATH}" \ | ||
-exportPath "${EXPORT_PATH}" \ | ||
-exportOptionsPlist "Configs/export_options.plist" \ | ||
| xcbeautify --renderer github-actions | ||
echo "π Performing Xcode archive export" | ||
xcrun xcodebuild -exportArchive \ | ||
-archivePath "${ARCHIVE_PATH}" \ | ||
-exportPath "${EXPORT_PATH}" \ | ||
-exportOptionsPlist "Configs/export_options.plist" \ | ||
| xcbeautify --renderer github-actions | ||
;; | ||
*) | ||
echo >&2 "Invalid build mode: ${bold}${MODE}${normal}" | ||
echo >&2 "Must be one of: Simulator, Device" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
echo "" | ||
echo "π Build complete" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.