From 6c70ed33095ed92834711e8d626836a22dec24c0 Mon Sep 17 00:00:00 2001 From: Atanas Chanev Date: Thu, 20 May 2021 10:04:46 +0100 Subject: [PATCH 01/16] Configured provisioning --- BitriseTest.xcodeproj/project.pbxproj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/BitriseTest.xcodeproj/project.pbxproj b/BitriseTest.xcodeproj/project.pbxproj index 25d1745..b643d6b 100644 --- a/BitriseTest.xcodeproj/project.pbxproj +++ b/BitriseTest.xcodeproj/project.pbxproj @@ -417,9 +417,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Manual; DEVELOPMENT_ASSET_PATHS = "\"BitriseTest/Preview Content\""; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 72SA8V3WYL; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = BitriseTest/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; @@ -429,7 +430,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.bitrise.test.BitriseTest; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE_SPECIFIER = "Atanas Chanev Bitrise iOS"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -440,9 +441,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Manual; DEVELOPMENT_ASSET_PATHS = "\"BitriseTest/Preview Content\""; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 72SA8V3WYL; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = BitriseTest/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 14.0; @@ -452,7 +454,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.bitrise.test.BitriseTest; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE_SPECIFIER = "Atanas Chanev Bitrise iOS"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; From ab3eba3ff824b93bdb9fb1fcb487d214428ec1af Mon Sep 17 00:00:00 2001 From: Atanas Chanev Date: Fri, 28 May 2021 15:45:15 +0100 Subject: [PATCH 02/16] Changed readme for testing pull request trigger --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ee7a5d8..f26407d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Bitrise-iOS-Sample -Simple iOS Project +Forked Simple iOS Project Working bitrise.yml included in the root of the project From 51b0386f9839d3c5bdfb7fac4fa6c444d98be837 Mon Sep 17 00:00:00 2001 From: Atanas Chanev Date: Fri, 28 May 2021 15:59:04 +0100 Subject: [PATCH 03/16] Added dot --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f26407d..7228a01 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,6 @@ Forked Simple iOS Project -Working bitrise.yml included in the root of the project +Working bitrise.yml included in the root of the project. bitrise.yml builds iOS .ipa and runs tests From 68bac2f5ca4a98dcc464c81b5770ef6ddb6d341f Mon Sep 17 00:00:00 2001 From: atanas-bitrise <84032001+atanas-bitrise@users.noreply.github.com> Date: Fri, 28 May 2021 16:29:17 +0100 Subject: [PATCH 04/16] Dot (#2) Co-authored-by: Atanas Chanev --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7228a01..075927e 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,4 @@ Forked Simple iOS Project Working bitrise.yml included in the root of the project. -bitrise.yml builds iOS .ipa and runs tests +bitrise.yml builds iOS .ipa and runs tests. From a88f516add08922ecea6e92e308b9f02c3d1bc8e Mon Sep 17 00:00:00 2001 From: atanas-bitrise <84032001+atanas-bitrise@users.noreply.github.com> Date: Tue, 27 Jul 2021 17:18:31 +0100 Subject: [PATCH 05/16] Most recent code from the original repository (#20) * ignore user data * change that shouldnt invoke trigger * info on archiving * remove extra file * Correct workflow name * remove recreate user schemes step Co-authored-by: Ben Boral Co-authored-by: Ben Boral <82456480+benbitrise@users.noreply.github.com> Co-authored-by: DamienBitrise <60897705+DamienBitrise@users.noreply.github.com> --- .gitignore | 1 + README.md | 8 +++++--- bitrise.yml | 6 ------ 3 files changed, 6 insertions(+), 9 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c545112 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +xcuserdata/ diff --git a/README.md b/README.md index 075927e..09e8a1d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # Bitrise-iOS-Sample -Forked Simple iOS Project +Simple iOS Project with working bitrise.yml included in the root of the project that builds iOS .ipa and runs tests. -Working bitrise.yml included in the root of the project. +## Bitrise Setup -bitrise.yml builds iOS .ipa and runs tests. +Create a new project in Bitrise using this repo as you normally would. Use the `bitrise.yml` from the repo to define your workflows. + +In order to sign the app during the `deploy` workflow archive step, you must set a valid provisioning profile and signing certificate in the `bitrise.yml` (`BITRISE_PROFILE_ID` and `BITRISE_CODE_SIGNING_IDENTITY` env vars) and upload those to your account. More details can be found in the [internal wiki](https://bitrise.atlassian.net/wiki/spaces/~833061986/pages/1554875463/Demo+App-Bitrise+Deploy+Workflow). diff --git a/bitrise.yml b/bitrise.yml index e165ba3..1e5ae42 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -15,9 +15,6 @@ workflows: - git-clone@4: {} - cache-pull@2: {} - certificate-and-profile-installer@1: {} - - recreate-user-schemes@1: - inputs: - - project_path: "$BITRISE_PROJECT_PATH" - xcode-archive@3: inputs: - project_path: "$BITRISE_PROJECT_PATH" @@ -37,9 +34,6 @@ workflows: - git-clone@4: {} - cache-pull@2: {} - certificate-and-profile-installer@1: {} - - recreate-user-schemes@1: - inputs: - - project_path: "$BITRISE_PROJECT_PATH" - xcode-test@2: inputs: - project_path: "$BITRISE_PROJECT_PATH" From e9d444c634640ae94cc4c1f41a71da93d9959b60 Mon Sep 17 00:00:00 2001 From: Atanas Chanev Date: Tue, 3 May 2022 11:55:53 +0100 Subject: [PATCH 06/16] Added provisioning for UI tests --- BitriseTest.xcodeproj/project.pbxproj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/BitriseTest.xcodeproj/project.pbxproj b/BitriseTest.xcodeproj/project.pbxproj index b643d6b..636a918 100644 --- a/BitriseTest.xcodeproj/project.pbxproj +++ b/BitriseTest.xcodeproj/project.pbxproj @@ -512,8 +512,9 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 72SA8V3WYL; INFOPLIST_FILE = BitriseTestUITests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -522,7 +523,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.bitrise.test.BitriseTestUITests; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE_SPECIFIER = "Atanas Chanev Bitrise iOS"; "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -534,8 +535,9 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_STYLE = Manual; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = 72SA8V3WYL; INFOPLIST_FILE = BitriseTestUITests/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", @@ -544,7 +546,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.bitrise.test.BitriseTestUITests; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; + PROVISIONING_PROFILE_SPECIFIER = "Atanas Chanev Bitrise iOS"; "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; From d2f8767a063c7df1d04d860cf02ed5ad7fbfd77f Mon Sep 17 00:00:00 2001 From: Atanas Chanev Date: Mon, 16 May 2022 14:50:48 +0100 Subject: [PATCH 07/16] Simulator 15.4 on Xcode 13.3 --- BitriseTest.xcodeproj/project.pbxproj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/BitriseTest.xcodeproj/project.pbxproj b/BitriseTest.xcodeproj/project.pbxproj index 636a918..cf355f4 100644 --- a/BitriseTest.xcodeproj/project.pbxproj +++ b/BitriseTest.xcodeproj/project.pbxproj @@ -423,7 +423,7 @@ DEVELOPMENT_TEAM = 72SA8V3WYL; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = BitriseTest/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -447,7 +447,7 @@ DEVELOPMENT_TEAM = 72SA8V3WYL; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = BitriseTest/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -468,7 +468,7 @@ CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = 72SA8V3WYL; INFOPLIST_FILE = BitriseTestTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -492,7 +492,7 @@ CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = 72SA8V3WYL; INFOPLIST_FILE = BitriseTestTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -516,6 +516,7 @@ CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = 72SA8V3WYL; INFOPLIST_FILE = BitriseTestUITests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -539,6 +540,7 @@ CODE_SIGN_STYLE = Manual; DEVELOPMENT_TEAM = 72SA8V3WYL; INFOPLIST_FILE = BitriseTestUITests/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 15.4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", From b1ba3f983d91e8c6420c4257a6e720a749c567e7 Mon Sep 17 00:00:00 2001 From: Atanas Chanev Date: Fri, 20 May 2022 14:45:28 +0100 Subject: [PATCH 08/16] Updated provisioning profile name in project --- BitriseTest.xcodeproj/project.pbxproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BitriseTest.xcodeproj/project.pbxproj b/BitriseTest.xcodeproj/project.pbxproj index cf355f4..2dc4771 100644 --- a/BitriseTest.xcodeproj/project.pbxproj +++ b/BitriseTest.xcodeproj/project.pbxproj @@ -430,7 +430,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.bitrise.test.BitriseTest; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "Atanas Chanev Bitrise iOS"; + PROVISIONING_PROFILE_SPECIFIER = "Atanas Chanev Bitrise iOS 2023"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -454,7 +454,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.bitrise.test.BitriseTest; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "Atanas Chanev Bitrise iOS"; + PROVISIONING_PROFILE_SPECIFIER = "Atanas Chanev Bitrise iOS 2023"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; }; @@ -524,7 +524,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.bitrise.test.BitriseTestUITests; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "Atanas Chanev Bitrise iOS"; + PROVISIONING_PROFILE_SPECIFIER = "Atanas Chanev Bitrise iOS 2023"; "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -548,7 +548,7 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.bitrise.test.BitriseTestUITests; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "Atanas Chanev Bitrise iOS"; + PROVISIONING_PROFILE_SPECIFIER = "Atanas Chanev Bitrise iOS 2023"; "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; From 982f72b5396dcc7c67f3cbfeff41eca165da37e6 Mon Sep 17 00:00:00 2001 From: Atanas Chanev Date: Mon, 23 May 2022 14:07:48 +0100 Subject: [PATCH 09/16] Test rolling builds 1 --- to-delete | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 to-delete diff --git a/to-delete b/to-delete new file mode 100644 index 0000000..e69de29 From 703ef890313034a320b2419a185ac3425cf841d6 Mon Sep 17 00:00:00 2001 From: Atanas Chanev Date: Mon, 23 May 2022 14:08:30 +0100 Subject: [PATCH 10/16] Removed to delete file to test rolling builds --- to-delete | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 to-delete diff --git a/to-delete b/to-delete deleted file mode 100644 index e69de29..0000000 From f24f3c0c5ef98548d6ae59a604f06c4dee5dfd00 Mon Sep 17 00:00:00 2001 From: Atanas Chanev Date: Mon, 23 May 2022 14:10:30 +0100 Subject: [PATCH 11/16] Rolling builds all enabled --- second | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 second diff --git a/second b/second new file mode 100644 index 0000000..e69de29 From 0e724e386af746823e933135131f327e67d1f62d Mon Sep 17 00:00:00 2001 From: Atanas Chanev Date: Mon, 23 May 2022 14:15:16 +0100 Subject: [PATCH 12/16] Rolling builds stop manual builds --- second | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 second diff --git a/second b/second deleted file mode 100644 index e69de29..0000000 From fc6a2c15167b4bdbeb88c34616c1399dd8ba05ee Mon Sep 17 00:00:00 2001 From: Atanas Chanev Date: Tue, 7 Jun 2022 18:01:56 +0100 Subject: [PATCH 13/16] Running from repository --- bitrise.yml | 635 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 631 insertions(+), 4 deletions(-) diff --git a/bitrise.yml b/bitrise.yml index 1e5ae42..95e0de4 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -7,14 +7,332 @@ trigger_map: workflow: primary - pull_request_source_branch: "*" workflow: primary +pipelines: + save-credits: + stages: + - prepare-for-testing: {} + - test-on-firebase: {} +stages: + prepare-for-testing: + workflows: + - pipelines-prepare-for-testing: {} + test-on-firebase: + workflows: + - pipelines-firebase: {} workflows: - deploy: + android-orchestrator: + steps: + - activate-ssh-key@4: + run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' + - git-clone@4: {} + - cache-pull@2: {} + - certificate-and-profile-installer@1: + inputs: + - install_defaults: 'no' + - xcode-build-for-test@1: + inputs: + - verbose_log: 'yes' + - deploy-to-bitrise-io@1: {} + - set-env-var@0: + inputs: + - destination_keys: ORCHESTRATOR_BUILD_SLUG + - value: "$BITRISE_BUILD_SLUG" + - build-router-start@0: + inputs: + - access_token: "$BITRISE_API_TOKEN" + - workflows: android-ui-tests-xcode + - environment_key_list: ORCHESTRATOR_BUILD_SLUG + - verbose: 'yes' + - cache-push@2: {} + meta: + bitrise.io: + stack: osx-xcode-13.3.x + machine_type_id: g2.8core + android-shard: + steps: + - script@1: + inputs: + - is_debug: 'yes' + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully + set -o pipefail + # debug log + set -x + + echo $ORCHESTRATOR_BUILD_SLUG + + curl -X 'GET' \ + "https://api.bitrise.io/v0.1/apps/$BITRISE_APP_SLUG/builds/$ORCHESTRATOR_BUILD_SLUG/artifacts" \ + -H 'accept: application/json' \ + -H "Authorization: $BITRISE_API_TOKEN" | jq -r --arg title "testbundle.zip" '.data[] | select(.title == $title).slug' | tr -d '\n' | envman add --key ARTIFACT_SLUG + + # write your script here + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + - script@1: + inputs: + - is_debug: 'yes' + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully + set -o pipefail + # debug log + set -x + + echo "The artifact slug is[$ARTIFACT_SLUG]" + + curl -X 'GET' \ + "https://api.bitrise.io/v0.1/apps/$BITRISE_APP_SLUG/builds/$ORCHESTRATOR_BUILD_SLUG/artifacts/$ARTIFACT_SLUG" \ + -H 'accept: application/json' \ + -H "Authorization: $BITRISE_API_TOKEN" | jq -r '.data.expiring_download_url' | tr -d '\n' | envman add --key ARTIFACT_URL + + + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + - script@1: + inputs: + - is_debug: 'yes' + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully + set -o pipefail + # debug log + set -x + + echo $ARTIFACT_URL + + curl $ARTIFACT_URL -o testbundle.zip + + + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + - script@1: + title: Modify TestBundle + inputs: + - is_debug: 'yes' + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully + set -o pipefail + # debug log + set -x + + # write your script here + curl $BITRISEIO_MODIFIED_XCRUN_URL_URL -o BitriseTest_iphoneos15.4-arm64.xctestrun + ls + mkdir testbundle + # mv BitriseTest_iphoneos15.4-arm64.xctestrun testbundle/BitriseTest_iphoneos15.4-arm64.xctestrun + touch testbundle/BitriseTest_iphoneos15.4-arm64.xctestrun + zip testbundle.zip testbundle/BitriseTest_iphoneos15.4-arm64.xctestrun + # zip -d testbundle.zip BitriseTest_iphoneos15.4-arm64.xctestrun + # unzip testbundle.zip -d testbundle + # ls testbundle + # rm testbundle.zip + # rm testbundle/BitriseTest_iphoneos15.4-arm64.xctestrun + # ls testbundle + # mv BitriseTest_iphoneos15.4-arm64.xctestrun testbundle/BitriseTest_iphoneos15.4-arm64.xctestrun + # zip -vr testbundle.zip testbundle/ -x "*.DS_Store" + + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + - virtual-device-testing-for-ios@1: + inputs: + - test_devices: iphone11pro,14.7,en,portrait + - zip_path: "$BITRISE_SOURCE_DIR/testbundle.zip" + - deploy-to-bitrise-io@1: {} + meta: + bitrise.io: + stack: linux-docker-android-20.04 + machine_type_id: standard + android-ui-tests: + steps: + - script@1: + inputs: + - is_debug: 'yes' + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully + set -o pipefail + # debug log + set -x + + echo $ORCHESTRATOR_BUILD_SLUG + + curl -X 'GET' \ + "https://api.bitrise.io/v0.1/apps/$BITRISE_APP_SLUG/builds/$ORCHESTRATOR_BUILD_SLUG/artifacts" \ + -H 'accept: application/json' \ + -H "Authorization: $BITRISE_API_TOKEN" | jq -r --arg title "testbundle.zip" '.data[] | select(.title == $title).slug' | tr -d '\n' | envman add --key ARTIFACT_SLUG + + # write your script here + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + - script@1: + inputs: + - is_debug: 'yes' + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully + set -o pipefail + # debug log + set -x + + echo "The artifact slug is[$ARTIFACT_SLUG]" + + curl -X 'GET' \ + "https://api.bitrise.io/v0.1/apps/$BITRISE_APP_SLUG/builds/$ORCHESTRATOR_BUILD_SLUG/artifacts/$ARTIFACT_SLUG" \ + -H 'accept: application/json' \ + -H "Authorization: $BITRISE_API_TOKEN" | jq -r '.data.expiring_download_url' | tr -d '\n' | envman add --key ARTIFACT_URL + + + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + - script@1: + inputs: + - is_debug: 'yes' + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully + set -o pipefail + # debug log + set -x + + echo $ARTIFACT_URL + + curl $ARTIFACT_URL -o testbundle.zip + + + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + - virtual-device-testing-for-ios@1: + inputs: + - test_devices: ipad5,15.4,en,portrait + - test_timeout: '900' + - zip_path: "$BITRISE_SOURCE_DIR/testbundle.zip" + - deploy-to-bitrise-io@1: {} + meta: + bitrise.io: + stack: linux-docker-android-20.04 + machine_type_id: standard + android-ui-tests-xcode: + steps: + - script@1: + inputs: + - is_debug: 'yes' + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully + set -o pipefail + # debug log + set -x + + echo $ORCHESTRATOR_BUILD_SLUG + + curl -X 'GET' \ + "https://api.bitrise.io/v0.1/apps/$BITRISE_APP_SLUG/builds/$ORCHESTRATOR_BUILD_SLUG/artifacts" \ + -H 'accept: application/json' \ + -H "Authorization: $BITRISE_API_TOKEN" | jq -r --arg title "testbundle.zip" '.data[] | select(.title == $title).slug' | tr -d '\n' | envman add --key ARTIFACT_SLUG + + # write your script here + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + - script@1: + inputs: + - is_debug: 'yes' + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully + set -o pipefail + # debug log + set -x + + echo "The artifact slug is[$ARTIFACT_SLUG]" + + curl -X 'GET' \ + "https://api.bitrise.io/v0.1/apps/$BITRISE_APP_SLUG/builds/$ORCHESTRATOR_BUILD_SLUG/artifacts/$ARTIFACT_SLUG" \ + -H 'accept: application/json' \ + -H "Authorization: $BITRISE_API_TOKEN" | jq -r '.data.expiring_download_url' | tr -d '\n' | envman add --key ARTIFACT_URL + + + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + - script@1: + inputs: + - is_debug: 'yes' + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully + set -o pipefail + # debug log + set -x + + echo $ARTIFACT_URL + + curl $ARTIFACT_URL -o testbundle.zip + + + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + - git::https://github.com/atanas-bitrise/steps-virtual-device-testing-for-ios.git@ios15.4: + inputs: + - test_devices: ipad5,15.4,en,portrait + - test_timeout: '900' + - zip_path: "$BITRISE_SOURCE_DIR/testbundle.zip" + - deploy-to-bitrise-io@1: {} + meta: + bitrise.io: + stack: linux-docker-android-20.04 + machine_type_id: standard + benchmark_deploy: steps: - activate-ssh-key@4: run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' - git-clone@4: {} - cache-pull@2: {} - certificate-and-profile-installer@1: {} + - recreate-user-schemes@1: + inputs: + - project_path: "$BITRISE_PROJECT_PATH" - xcode-archive@3: inputs: - project_path: "$BITRISE_PROJECT_PATH" @@ -27,7 +345,11 @@ workflows: - export_method: "$BITRISE_EXPORT_METHOD" - deploy-to-bitrise-io@1: {} - cache-push@2: {} - primary: + meta: + bitrise.io: + stack: osx-xcode-12.5.x + machine_type_id: g2.8core + benchmark_test: steps: - activate-ssh-key@4: run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' @@ -40,6 +362,307 @@ workflows: - scheme: "$BITRISE_SCHEME" - deploy-to-bitrise-io@1: {} - cache-push@2: {} + meta: + bitrise.io: + stack: osx-xcode-13.2.x + machine_type_id: g2.12core + certificate-installer: + steps: + - certificate-and-profile-installer@1: + inputs: + - install_defaults: 'no' + meta: + bitrise.io: + stack: osx-xcode-13.0.x + deploy: + steps: + - activate-ssh-key@4: + run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' + - git-clone@4: {} + - cache-pull@2: {} + - recreate-user-schemes@1: + inputs: + - project_path: "$BITRISE_SOURCE_DIR/BitriseTest.xcodeproj" + - certificate-and-profile-installer@1: + inputs: + - install_defaults: 'no' + - xcode-archive@4.2: + inputs: + - project_path: "$BITRISE_PROJECT_PATH" + - scheme: "$BITRISE_SCHEME" + - force_code_sign_identity: "$BITRISE_CODE_SIGNING_IDENTITY" + - force_provisioning_profile: "$BITRISE_PROFILE_ID" + - compile_bitcode: 'no' + - upload_bitcode: 'no' + - team_id: "$BITRISE_TEAM" + - export_method: "$BITRISE_EXPORT_METHOD" + - deploy-to-bitrise-io@1: {} + - cache-push@2: {} + meta: + bitrise.io: + stack: osx-xcode-13.2.x + machine_type_id: g2.12core + download-spm: + steps: + - script@1: + inputs: + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # debug log + set -x + + # write your script here + curl https://releases.amplify.aws/aws-sdk-ios/AWSEC2-2.24.3.zip -o AWSEC2-2.24.3.zip + + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + meta: + bitrise.io: + stack: osx-xcode-13.2.x + machine_type_id: g2.4core + empty: + steps: + - script@1: + inputs: + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # debug log + set -x + + echo $ENV + + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + firebase-deploy: + steps: + - activate-ssh-key@4: + run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' + - git-clone@4: {} + - cache-pull@2: {} + - recreate-user-schemes@1: + inputs: + - project_path: "$BITRISE_SOURCE_DIR/BitriseTest.xcodeproj" + - certificate-and-profile-installer@1: {} + - xcode-archive@4.2: + inputs: + - project_path: "$BITRISE_PROJECT_PATH" + - scheme: "$BITRISE_SCHEME" + - force_code_sign_identity: "$BITRISE_CODE_SIGNING_IDENTITY" + - force_provisioning_profile: "$BITRISE_PROFILE_ID" + - compile_bitcode: 'no' + - upload_bitcode: 'no' + - team_id: "$BITRISE_TEAM" + - export_method: "$BITRISE_EXPORT_METHOD" + - firebase-app-distribution@0: + inputs: + - app: 1:729822476188:ios:70b0808e590217c154fa59 + - release_notes: '' + - testers: '' + - upgrade_firebase_tools: 'true' + - firebase_token: "$FIREBASE_TOKEN" + - cache-push@2: {} + meta: + bitrise.io: + stack: osx-xcode-13.2.x + machine_type_id: g2.4core + gen2-primary: + steps: + - activate-ssh-key@4: + run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' + - git-clone@4: {} + - cache-pull@2: {} + - certificate-and-profile-installer@1: {} + - xcode-test@2: + inputs: + - project_path: "$BITRISE_PROJECT_PATH" + - scheme: "$BITRISE_SCHEME" + - deploy-to-bitrise-io@1: {} + - cache-push@2: {} + meta: + bitrise.io: + stack: osx-xcode-13.0.x + list-tests: + steps: + - activate-ssh-key@4: + run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' + - git-clone@6.1: {} + - xcode-test@4.1: + inputs: + - project_path: "$BITRISE_PROJECT_PATH" + - simulator_device: iPhone 13 Pro + - xcodebuild_test_options: "-parallel-testing-enabled YES -parallel-testing-worker-count + 4" + - verbose: 'yes' + - destination: platform=iOS Simulator,name=Atanas-Device,OS=15.4 + - verbose_log: 'yes' + - collect_simulator_diagnostics: on_failure + - xcodebuild_options: "-parallel-testing-enabled YES -parallel-testing-worker-count + 4" + - scheme: "$BITRISE_SCHEME" + - deploy-to-bitrise-io@2.0: {} + meta: + bitrise.io: + stack: osx-xcode-13.2.x + machine_type_id: g2.8core + pipelines-cli: + steps: + - script@1: + inputs: + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully + set -o pipefail + # debug log + set -x + + # write your script here + curl https://app.bitrise.io/app/$APP_SLUG/build/start.json --data "{\"hook_info\":{\"type\":\"bitrise\",\"build_trigger_token\":\"$BUILD_TRIGGER_TOKEN\"},\"build_params\":{\"branch\":\"master\",\"pipeline_id\":\"save-credits\"},\"triggered_by\":\"curl\"}" + + + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + pipelines-firebase: + steps: + - git::https://github.com/bitrise-steplib/bitrise-step-artifact-pull.git@main: + title: Pull artifacts + inputs: + - verbose: true + - artifact_sources: prepare-for-testing.* + - script@1: + inputs: + - is_debug: 'yes' + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully + set -o pipefail + # debug log + set -x + + # write your script here + echo $BITRISE_ARTIFACT_PATHS + echo ${BITRISE_ARTIFACT_PATHS##*|} + + envman add --key ARTIFACT_PATH --value ${BITRISE_ARTIFACT_PATHS##*|} + + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + title: Print artifact paths + - virtual-device-testing-for-ios@1: + inputs: + - test_timeout: '900' + - zip_path: "$ARTIFACT_PATH" + - deploy-to-bitrise-io@1: {} + meta: + bitrise.io: + stack: linux-docker-android-20.04 + machine_type_id: standard + pipelines-prepare-for-testing: + steps: + - activate-ssh-key@4: + run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' + - git-clone@6.1: {} + - cache-pull@2: {} + - certificate-and-profile-installer@1: + inputs: + - install_defaults: 'no' + - xcode-build-for-test@1: + inputs: + - verbose_log: 'yes' + - deploy-to-bitrise-io@1: {} + - cache-push@2: {} + meta: + bitrise.io: + stack: osx-xcode-13.1.x + machine_type_id: g2.12core + primary: + steps: + - activate-ssh-key@4: + run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' + - git-clone@6.1: {} + - cache-pull@2: {} + - certificate-and-profile-installer@1: + inputs: + - install_defaults: 'no' + - xcode-test@4.1: + inputs: + - project_path: "$BITRISE_PROJECT_PATH" + - simulator_device: iPhone 13 Pro + - xcodebuild_test_options: "-parallel-testing-enabled YES -parallel-testing-worker-count + 4" + - verbose: 'yes' + - destination: platform=iOS Simulator,name=iPhone 13 Pro,OS=latest + - verbose_log: 'yes' + - collect_simulator_diagnostics: on_failure + - xcodebuild_options: "-parallel-testing-enabled YES -parallel-testing-worker-count + 4" + - maximum_test_repetitions: '0' + - log_formatter: xcodebuild + - scheme: "$BITRISE_SCHEME" + - deploy-to-bitrise-io@2.0: {} + - cache-push@2: {} + meta: + bitrise.io: + stack: osx-xcode-13.3.x + machine_type_id: g2.4core + primary-ui-tests: + steps: + - activate-ssh-key@4: + run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}' + - git-clone@4: {} + - cache-pull@2: {} + - certificate-and-profile-installer@1: + inputs: + - install_defaults: 'no' + - xcode-build-for-test@1: + inputs: + - verbose_log: 'yes' + - virtual-device-testing-for-ios@1: {} + - deploy-to-bitrise-io@1: {} + - cache-push@2: {} + meta: + bitrise.io: + stack: osx-xcode-13.2.x + machine_type_id: g2.4core + which-code: + steps: + - script@1: + inputs: + - content: |- + #!/usr/bin/env bash + # fail if any commands fails + set -e + # make pipelines' return status equal the last command to exit with a non-zero status, or zero if all commands exit successfully + set -o pipefail + # debug log + set -x + + # write your script here + xcodebuild -version + + # or run a script from your repository, like: + # bash ./path/to/script.sh + # not just bash, e.g.: + # ruby ./path/to/script.rb + meta: + bitrise.io: + stack: osx-xcode-13.3.x + machine_type_id: g2.12core app: envs: - opts: @@ -53,10 +676,14 @@ app: BITRISE_EXPORT_METHOD: development - opts: is_expand: false - BITRISE_PROFILE_ID: b103a1f0-1f51-4d53-a41f-c08719676e94 + BITRISE_PROFILE_ID: a043c226-0b15-4780-814a-14a0313360c9 - opts: is_expand: false - BITRISE_CODE_SIGNING_IDENTITY: 'iPhone Developer: Dev Portal Bot Bitrise (E89JV3W9K4)' + BITRISE_CODE_SIGNING_IDENTITY: iPhone Developer - opts: is_expand: false BITRISE_TEAM: 72SA8V3WYL +meta: + bitrise.io: + stack: osx-xcode-13.2.x + machine_type_id: g2.8core From f8d9e11fbf7cbda4200aac5a30a82d492c6c4b20 Mon Sep 17 00:00:00 2001 From: Atanas Chanev Date: Mon, 13 Jan 2025 15:18:02 +0000 Subject: [PATCH 14/16] Create a merge conflict --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 09e8a1d..7c901eb 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Simple iOS Project with working bitrise.yml included in the root of the project ## Bitrise Setup +Create a merge conflict. + Create a new project in Bitrise using this repo as you normally would. Use the `bitrise.yml` from the repo to define your workflows. In order to sign the app during the `deploy` workflow archive step, you must set a valid provisioning profile and signing certificate in the `bitrise.yml` (`BITRISE_PROFILE_ID` and `BITRISE_CODE_SIGNING_IDENTITY` env vars) and upload those to your account. More details can be found in the [internal wiki](https://bitrise.atlassian.net/wiki/spaces/~833061986/pages/1554875463/Demo+App-Bitrise+Deploy+Workflow). From 7937b239f9c91f888686c22cf971cad9c3bb5a7e Mon Sep 17 00:00:00 2001 From: atanas-bitrise <84032001+atanas-bitrise@users.noreply.github.com> Date: Wed, 23 Apr 2025 11:10:58 +0100 Subject: [PATCH 15/16] Create ios.yml --- .github/workflows/ios.yml | 44 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/ios.yml diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml new file mode 100644 index 0000000..634a777 --- /dev/null +++ b/.github/workflows/ios.yml @@ -0,0 +1,44 @@ +name: iOS starter workflow + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + name: Build and Test default scheme using any available iPhone simulator + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set Default Scheme + run: | + scheme_list=$(xcodebuild -list -json | tr -d "\n") + default=$(echo $scheme_list | ruby -e "require 'json'; puts JSON.parse(STDIN.gets)['project']['targets'][0]") + echo $default | cat >default + echo Using default scheme: $default + - name: Build + env: + scheme: ${{ 'default' }} + platform: ${{ 'iOS Simulator' }} + run: | + # xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959) + device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"` + if [ $scheme = default ]; then scheme=$(cat default); fi + if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi + file_to_build=`echo $file_to_build | awk '{$1=$1;print}'` + xcodebuild build-for-testing -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device" + - name: Test + env: + scheme: ${{ 'default' }} + platform: ${{ 'iOS Simulator' }} + run: | + # xcrun xctrace returns via stderr, not the expected stdout (see https://developer.apple.com/forums/thread/663959) + device=`xcrun xctrace list devices 2>&1 | grep -oE 'iPhone.*?[^\(]+' | head -1 | awk '{$1=$1;print}' | sed -e "s/ Simulator$//"` + if [ $scheme = default ]; then scheme=$(cat default); fi + if [ "`ls -A | grep -i \\.xcworkspace\$`" ]; then filetype_parameter="workspace" && file_to_build="`ls -A | grep -i \\.xcworkspace\$`"; else filetype_parameter="project" && file_to_build="`ls -A | grep -i \\.xcodeproj\$`"; fi + file_to_build=`echo $file_to_build | awk '{$1=$1;print}'` + xcodebuild test-without-building -scheme "$scheme" -"$filetype_parameter" "$file_to_build" -destination "platform=$platform,name=$device" From 3b78e036f4ec733d3c04242b6a4b77d9b5393f1c Mon Sep 17 00:00:00 2001 From: atanas-bitrise <84032001+atanas-bitrise@users.noreply.github.com> Date: Wed, 23 Apr 2025 11:20:36 +0100 Subject: [PATCH 16/16] Update ios.yml --- .github/workflows/ios.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 634a777..3295a86 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -9,7 +9,7 @@ on: jobs: build: name: Build and Test default scheme using any available iPhone simulator - runs-on: macos-latest + runs-on: self-hosted steps: - name: Checkout