Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
Create iOS CI #500
Browse files Browse the repository at this point in the history
  • Loading branch information
CihanOezkan authored and Boehrsi committed Apr 17, 2020
1 parent 890da3a commit ae493cf
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 25 deletions.
45 changes: 35 additions & 10 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
before_script:
- export GRADLE_USER_HOME=`pwd`/.gradle
- source setup-build-id

cache:
paths:
- .gradle/wrapper
- .gradle/caches

variables:
LANG: "en_US.UTF-8"
GIT_SUBMODULE_STRATEGY: "recursive"


stages:
- build
- deploy
- build-ios
- deploy-ios
- status-report

build:
Expand All @@ -18,11 +24,32 @@ build:
- docker
image: gitlab.open-xchange.com:4567/mobile/build/container/flutter
script:
- tools/build.triggerBuild.sh android debug development 0.999.9 $BUILD_ID latest
- tools/build.triggerBuild.sh android debug development 0.999.9 $CI_PIPELINE_ID latest
artifacts:
paths:
- build/app/outputs/apk/development/debug/*.apk

build-ios:
cache: {}
stage: build-ios
tags:
- ios
script:
- tools/build.triggerBuild.sh ios release development 0.999.9 $CI_PIPELINE_ID latest
artifacts:
paths:
- build/app/outputs/ios/development/Runner.ipa/*.ipa

deploy-ios:
cache: {}
stage: deploy-ios
tags:
- ios
dependencies:
- build-ios
script:
- tools/deploy.uploadToAppCenter.sh ios

deploy:
stage: deploy
tags:
Expand All @@ -31,22 +58,20 @@ deploy:
dependencies:
- build
script:
- tools/deploy.uploadToAppCenter.sh
- tools/deploy.uploadToAppCenter.sh android

status-report-success:
stage: status-report
tags:
- docker
image: gitlab.open-xchange.com:4567/mobile/build/container/flutter
- ios
script:
- post-ticket-comment -s success
- tools/utils/add-issue-link -s success
when: on_success

status-report-failure:
stage: status-report
tags:
- docker
image: gitlab.open-xchange.com:4567/mobile/build/container/flutter
- ios
script:
- post-ticket-comment -s failure
when: on_failure
- tools/utils/add-issue-link -s failure
when: on_failure
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "tools/utils"]
path = tools/utils
url = ../utils.git
12 changes: 9 additions & 3 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
2AB5BDA32396A33B005FDB10 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 2AB5BDA22396A33B005FDB10 /* GeneratedPluginRegistrant.m */; };
374E43D3FB49E295AE9799DD /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 899B7188477F2A02FA10829E /* Pods_Runner.framework */; };
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
649470442445BCF800239B7B /* .gitlab-ci.yml in Resources */ = {isa = PBXBuildFile; fileRef = 649470432445BCF800239B7B /* .gitlab-ci.yml */; };
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
Expand Down Expand Up @@ -68,6 +69,7 @@
646BAA7523D893CB004295B1 /* sv-SE */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "sv-SE"; path = "sv-SE.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
646BAA7623D894B2004295B1 /* zh-Hant-CN */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant-CN"; path = "zh-Hant-CN.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
646BAA7723D894C7004295B1 /* zh-Hant-TW */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant-TW"; path = "zh-Hant-TW.lproj/InfoPlist.strings"; sourceTree = "<group>"; };
649470432445BCF800239B7B /* .gitlab-ci.yml */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.yaml; name = ".gitlab-ci.yml"; path = "../.gitlab-ci.yml"; sourceTree = "<group>"; };
6F6BA9A235C8C854C6105BBB /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
81A3BCC8525B6F2D0510F16F /* Pods-Runner.stable.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.stable.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.stable.xcconfig"; sourceTree = "<group>"; };
899B7188477F2A02FA10829E /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -141,6 +143,7 @@
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
649470432445BCF800239B7B /* .gitlab-ci.yml */,
FD51737223266F04007458CC /* .swiftlint.yml */,
97C146F01CF9000F007C117D /* OX Coi */,
9740EEB11CF90186004384FC /* Flutter */,
Expand Down Expand Up @@ -356,6 +359,7 @@
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
649470442445BCF800239B7B /* .gitlab-ci.yml in Resources */,
FD2FD6F323E099F900B39EA2 /* GoogleService-Info-Development.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -1031,7 +1035,8 @@
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: iOS Developer (G8Y6CF25ZP)";
CODE_SIGN_STYLE = Manual;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
Expand Down Expand Up @@ -1064,7 +1069,8 @@
CLANG_WARN_DOCUMENTATION_COMMENTS = NO;
CODE_SIGN_ENTITLEMENTS = "OX Coi/Runner.entitlements";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution: Open-Xchange AG";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = 528HQ38877;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -1223,7 +1229,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = "${PRODUCT_BUNDLE_IDENTIFIER}";
PRODUCT_NAME = "${PRODUCT_NAME}";
PROVISIONING_PROFILE_SPECIFIER = "";
PROVISIONING_PROFILE_SPECIFIER = com.openxchange.oxcoi.dev;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OBJC_BRIDGING_HEADER = "OX Coi/Application/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down
2 changes: 1 addition & 1 deletion ios/exportOptionsdevelopment.plist
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<key>provisioningProfiles</key>
<dict>
<key>com.openxchange.oxcoi.dev</key>
<string>OX COI Messenger Dev</string>
<string>InHouse com.openxchange.oxcoi.dev</string>
</dict>
<key>method</key>
<string>enterprise</string>
Expand Down
19 changes: 11 additions & 8 deletions tools/build.triggerBuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ function iosReleaseBuild {
flutter build ios --release --build-name=${buildName} --build-number=${buildNumber} --flavor ${flavor}
flutter clean

xcodebuild -workspace ios/Runner.xcworkspace -scheme ${flavor} -sdk iphoneos -configuration Release-${flavor} archive -archivePath "${IOS_BUILD_FOLDER}/Runner.xcarchive" -allowProvisioningUpdates
xcodebuild -exportArchive -archivePath "${IOS_BUILD_FOLDER}/Runner.xcarchive" -exportOptionsPlist ios/exportOptions${flavor}.plist -exportPath "${IOS_BUILD_FOLDER}/Runner.ipa" -allowProvisioningUpdates
xcodebuild -workspace ios/Runner.xcworkspace -scheme ${flavor} -sdk iphoneos -configuration Release-${flavor} archive -archivePath "${IOS_BUILD_FOLDER}/Runner.xcarchive" -allowProvisioningUpdates | xcpretty
xcodebuild -exportArchive -archivePath "${IOS_BUILD_FOLDER}/Runner.xcarchive" -exportOptionsPlist ios/exportOptions${flavor}.plist -exportPath "${IOS_BUILD_FOLDER}/Runner.ipa" -allowProvisioningUpdates | xcpretty
}

function setupPlugin {
Expand All @@ -116,6 +116,7 @@ function setupPlugin {
else
git checkout ${coreVersion}
fi
git submodule update --init --recursive
)
else
echo "Plugin repository found, using the current state. To ensure the latest plugin + DCC is used, please execute 'git pull && git submodule update' in the plugin repository"
Expand Down Expand Up @@ -218,6 +219,14 @@ else
moveCore
)
fi
echo "-- Performing build preparations --"
if isIos; then
echo "Adjusting symlinks"
(
cd "../$PLUGIN_FOLDER/$IOS_LIBRARY_FOLDER"
ln -sf "../../delta_chat_core/deltachat-ffi/deltachat.h" .
)
fi
echo "-- Building --"
if isAndroid; then
if isRelease; then
Expand All @@ -232,10 +241,4 @@ elif isIos; then
iosDebugBuild
fi
fi
echo "-- Performing additional build steps --"
if isIos; then
echo "Adjusting symlinks"
cd "../$PLUGIN_FOLDER/$IOS_LIBRARY_FOLDER"
ln -sf "../../delta_chat_core/deltachat-ffi/deltachat.h" .
fi
echo "-- Finishing --"
13 changes: 10 additions & 3 deletions tools/deploy.uploadToAppCenter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
set -e
set -o pipefail

PLATFORM=$1
DISTRIBUTION_GROUP="Collaborators"
APK="build/app/outputs/apk/development/debug/app-development-debug.apk"
APP_CENTER_APP="open-xchange/OX-COI-Messenger-Dev"

appcenter distribute release --app "${APP_CENTER_APP}" --file ${APK} --group ${DISTRIBUTION_GROUP} --output json
if [[ ${PLATFORM} == "ios" ]]; then
FILE="build/app/outputs/ios/development/Runner.ipa/OX COI Messenger Dev.ipa"
APP_CENTER_APP="open-xchange/OX-COI-Messenger-Dev-1"
else
FILE="build/app/outputs/apk/development/debug/app-development-debug.apk"
APP_CENTER_APP="open-xchange/OX-COI-Messenger-Dev"
fi

appcenter distribute release --app "${APP_CENTER_APP}" --file "${FILE}" --group ${DISTRIBUTION_GROUP} --output json
1 change: 1 addition & 0 deletions tools/utils
Submodule utils added at f57997

0 comments on commit ae493cf

Please sign in to comment.