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

[Flask] bitrise pipelines #6645

Merged
merged 39 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
99710ef
basic pipeline scaffold
owencraston Jun 20, 2023
f621274
flask release ios
owencraston Jun 20, 2023
95fda8a
android release scripts
owencraston Jun 20, 2023
018ff06
check for sentry props on flask build
owencraston Jun 20, 2023
3e0e16e
bitrise certificate
owencraston Jun 20, 2023
cd861a8
debug/release provisioning profiles
owencraston Jun 20, 2023
9b02f37
basic build steps
owencraston Jun 20, 2023
47b75d2
flask pipelines
owencraston Jun 20, 2023
50a3475
fix yaml
owencraston Jun 20, 2023
5247447
remap flask variables
owencraston Jun 20, 2023
5924596
remove pubnub keys
owencraston Jun 20, 2023
7b275c4
add deploy pipelines
owencraston Jun 21, 2023
56f03d4
fix file paths and undo edits to qa build
owencraston Jun 21, 2023
69ccfe9
new flask release pipelines
owencraston Jun 21, 2023
061b507
update set-versions script and try to fix sourcemaps for flask
owencraston Jun 21, 2023
df55ec1
try a different sourcemp filepath
owencraston Jun 21, 2023
e82ff36
upgrade ruby version
owencraston Jun 22, 2023
5727bc3
update signing
owencraston Jun 23, 2023
2acb01b
set env to flask
owencraston Jun 23, 2023
5ca20dd
square icons
owencraston Jun 28, 2023
5b6d2d8
manually remove icon alpha
owencraston Jun 28, 2023
48b71e8
add archive path var
owencraston Jun 28, 2023
575e326
introduce build types in build pipeline
owencraston Jun 28, 2023
2191e4c
remove echo
owencraston Jun 28, 2023
17b6758
pass params to derive sentry environment and tests
owencraston Jun 29, 2023
2a71962
new build numbers
owencraston Jul 11, 2023
37aeb8a
fix: update cookie-tough dependency (#6772)
tommasini Jul 11, 2023
80aa292
move versions into product flavours
owencraston Jul 12, 2023
78c4a01
test prod build with flask variables
owencraston Jul 13, 2023
da12ce0
cleanup deriveSentryEnvironment function
owencraston Jul 13, 2023
fe3069e
cleanup comment
owencraston Jul 13, 2023
f79aab3
reset build numbers
owencraston Jul 13, 2023
9490d89
enable deploy to android and pass in env variable
owencraston Jul 13, 2023
38d2dc6
new syntax
owencraston Jul 13, 2023
1da8ac1
is expand true
owencraston Jul 13, 2023
6dfcce6
no android pipeline
owencraston Jul 13, 2023
cbd72aa
new syntax
owencraston Jul 13, 2023
889d066
new new syntax
owencraston Jul 13, 2023
285b28c
new new new syntax
owencraston Jul 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ pipelines:
stages:
- run_smoke_e2e_ios_android_stage: {}
- notify: {}
# Pipeline for Flask
create_release_builds_flask_pipeline:
stages:
- create_build_release_flask: {}
- notify: {}

#Stages refrence workflows. Those workflows cannot but utility "_this-is-a-utility"
stages:
Expand Down Expand Up @@ -106,6 +111,10 @@ stages:
release_notify:
workflows:
- release_announcing_stores: {}
# Stage for creating Flask release build
create_build_release_flask:
workflows:
- build_flask_release: {}
workflows:
# Code Setups
setup:
Expand Down Expand Up @@ -671,6 +680,14 @@ workflows:
- pipeline_intermediate_files: sourcemaps/ios/index.js.map:BITRISE_APP_STORE_SOURCEMAP_PATH
- deploy_path: sourcemaps/ios/index.js.map
title: Deploy Source Map
# Workflow for building Flask release
build_flask_release:
before_run:
- code_setup
steps:
#todo: add steps for building flask release
after_run:
- _notify_failure_on_slack
app:
envs:
- opts:
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@
"start:android:flask": "./scripts/build.sh android debugFlask",
"build:announce": "node ./scripts/metamask-bot-build-announce-bitrise.js",
"build:android:release": "./scripts/build.sh android release",
"build:android:flask": "./scripts/build.sh android Flask",
"build:android:release:e2e": "./scripts/build.sh android releaseE2E",
"build:android:qa:e2e": "./scripts/build.sh android QAE2E",
"build:android:checksum": "./scripts/checksum.sh",
"build:android:checksum:qa": "./scripts/checksum.sh QA",
"build:android:checksum:flask": "./scripts/checksum.sh Flask",
"build:android:checksum:verify": "shasum -a 512 -c sha512sums.txt",
"build:android:pre-release": "./scripts/build.sh android release --pre",
"build:android:pre-release:bundle": "GENERATE_BUNDLE=true ./scripts/build.sh android release --pre",
Expand All @@ -42,6 +44,8 @@
"build:ios:pre-release": "./scripts/build.sh ios release --pre",
"build:ios:qa": "./scripts/build.sh ios QA",
"build:ios:pre-qa": "./scripts/build.sh ios QA --pre",
"build:ios:flask": "./scripts/build.sh ios Flask",
"build:ios:pre-flask": "./scripts/build.sh ios Flask --pre",
"build:attribution": "./scripts/generate-attributions.sh",
"release:android": "./scripts/build.sh android release && open android/app/build/outputs/apk/release/",
"release:ios": "./scripts/build.sh ios release",
Expand Down
53 changes: 52 additions & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,27 @@ buildIosRelease(){
fi
}

buildIosFlaskRelease(){
prebuild_ios

# Replace release.xcconfig with ENV vars
if [ "$PRE_RELEASE" = true ] ; then
echo "Setting up env vars...";
echo "$IOS_ENV" | tr "|" "\n" > $IOS_ENV_FILE
echo "Build started..."
brew install watchman
cd ios
generateArchivePackages "MetaMask-Flask"
# Generate sourcemaps
yarn sourcemaps:ios
else
if [ ! -f "ios/release.xcconfig" ] ; then
echo "$IOS_ENV" | tr "|" "\n" > ios/release.xcconfig
fi
./node_modules/.bin/react-native run-ios --scheme "MetaMask-Flask" --configuration Release --simulator "iPhone 12 Pro"
fi
}

buildIosReleaseE2E(){
prebuild_ios

Expand Down Expand Up @@ -346,6 +367,32 @@ buildAndroidRelease(){
fi
}

buildAndroidFlaskRelease(){
if [ "$PRE_RELEASE" = false ] ; then
adb uninstall io.metamask || true
fi
prebuild_android

# GENERATE APK
cd android && ./gradlew assembleFlaskRelease --no-daemon --max-workers 2

# GENERATE BUNDLE
if [ "$GENERATE_BUNDLE" = true ] ; then
./gradlew bundleFlaskRelease
fi

if [ "$PRE_RELEASE" = true ] ; then
# Generate sourcemaps
yarn sourcemaps:android
sethkfman marked this conversation as resolved.
Show resolved Hide resolved
# Generate checksum
yarn build:android:checksum:flask
fi

if [ "$PRE_RELEASE" = false ] ; then
adb install app/build/outputs/apk/flask/release/app-flask-release.apk
fi
}

buildAndroidReleaseE2E(){
prebuild_android
cd android && ./gradlew assembleProdRelease assembleAndroidTest -PminSdkVersion=26 -DtestBuildType=release
Expand All @@ -359,6 +406,8 @@ buildAndroidQAE2E(){
buildAndroid() {
if [ "$MODE" == "release" ] ; then
buildAndroidRelease
elif [ "$MODE" == "Flask" ] ; then
buildAndroidFlaskRelease
elif [ "$MODE" == "QA" ] ; then
buildAndroidQA
elif [ "$MODE" == "releaseE2E" ] ; then
Expand Down Expand Up @@ -390,6 +439,8 @@ buildIos() {
echo "Build iOS $MODE started..."
if [ "$MODE" == "release" ] ; then
buildIosRelease
elif [ "$MODE" == "Flask" ] ; then
buildIosFlaskRelease
elif [ "$MODE" == "releaseE2E" ] ; then
buildIosReleaseE2E
elif [ "$MODE" == "debugE2E" ] ; then
Expand Down Expand Up @@ -454,7 +505,7 @@ checkParameters "$@"

printTitle

if [ "$MODE" == "release" ] || [ "$MODE" == "releaseE2E" ] || [ "$MODE" == "QA" ]; then
if [ "$MODE" == "release" ] || [ "$MODE" == "releaseE2E" ] || [ "$MODE" == "QA" ] || [ "$MODE" == "Flask" ]; then
if [ "$PRE_RELEASE" = false ]; then
echo "RELEASE SENTRY PROPS"
checkAuthToken 'sentry.release.properties'
Expand Down
5 changes: 5 additions & 0 deletions scripts/checksum.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ FILE=./android/app/build/outputs/apk/qa/release/app-qa-release.apk
if test -f "$FILE"; then
shasum -a 512 "$FILE" > ./android/app/build/outputs/apk/qa/release/sha512sums.txt
fi
elif [ "$MODE" == "Flask" ]; then
FILE=./android/app/build/outputs/apk/flask/release/app-flask-release.apk
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: Is this the correct file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be


if test -f "$FILE"; then
shasum -a 512 "$FILE" > ./android/app/build/outputs/apk/flask/release/sha512sums.txt
fi
else
FILE=./android/app/build/outputs/apk/prod/release/app-prod-release.apk

Expand Down