Xcode Cloud Support (#234)

* Removed now unnecessary code from alpha builds
* Add nightly build configuration
* Update ruby dependencies
* Stop changing the app name for PRs and Nightly, the icon is sufficient
* Add ITSAppUsesNonExemptEncryption flag as per https://developer.apple.com/documentation/bundleresources/information_property_list/itsappusesnonexemptencryption and https://stackoverflow.com/questions/35841117/missing-compliance-status-in-testflight
* Updated app groups to reflect various environments: production, nightly and PR. Remove keychain access group as they should be inferred from the access groups
This commit is contained in:
Stefan Ceriu 2022-10-24 16:00:17 +03:00 committed by GitHub
parent aa5a2e0ee8
commit 80babf1cd8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 230 additions and 164 deletions

View File

@ -36,7 +36,7 @@ jobs:
# Common setup # Common setup
- name: Brew bundle - name: Brew bundle
run: run:
brew update && brew bundle && brew upgrade swiftformat brew bundle
- name: SwiftFormat - name: SwiftFormat
run: run:
@ -46,13 +46,6 @@ jobs:
run: | run: |
bundle config path vendor/bundle bundle config path vendor/bundle
bundle install --jobs 4 --retry 3 bundle install --jobs 4 --retry 3
- uses: actions/setup-python@v3
with:
python-version: '3.x'
cache: 'pip'
- run: pip install -r requirements.txt
# Import alpha release private signing certificate # Import alpha release private signing certificate
- name: Import signing certificate - name: Import signing certificate
@ -85,7 +78,5 @@ jobs:
![QR code](${{ env.DIAWI_QR_CODE_LINK }}) ![QR code](${{ env.DIAWI_QR_CODE_LINK }})
If you can't scan the QR code you can install the build via this link: ${{ env.DIAWI_FILE_LINK }} If you can't scan the QR code you can install the build via this link: ${{ env.DIAWI_FILE_LINK }}
# Enables to identify and update existing Ad-hoc release message on new commit in the PR
identifier: "GITHUB_COMMENT_ADHOC_RELEASE"
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -2845,7 +2845,6 @@
62E1B7866DF0ED442C39A83B /* Release */ = { 62E1B7866DF0ED442C39A83B /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
APP_GROUP_IDENTIFIER = group.io.element;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = ElementX/SupportingFiles/ElementX.entitlements; CODE_SIGN_ENTITLEMENTS = ElementX/SupportingFiles/ElementX.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
@ -2857,7 +2856,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.4; MARKETING_VERSION = 1.0.4;
PRODUCT_BUNDLE_IDENTIFIER = io.element.elementx; PRODUCT_BUNDLE_IDENTIFIER = "$(BASE_BUNDLE_IDENTIFIER)";
PRODUCT_NAME = ElementX; PRODUCT_NAME = ElementX;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_OBJC_BRIDGING_HEADER = "ElementX/SupportingFiles/ElementX-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "ElementX/SupportingFiles/ElementX-Bridging-Header.h";
@ -2869,7 +2868,6 @@
6897D5BC19A2EA6ABD57DE7E /* Debug */ = { 6897D5BC19A2EA6ABD57DE7E /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
APP_GROUP_IDENTIFIER = group.io.element;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = ElementX/SupportingFiles/ElementX.entitlements; CODE_SIGN_ENTITLEMENTS = ElementX/SupportingFiles/ElementX.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
@ -2881,7 +2879,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.4; MARKETING_VERSION = 1.0.4;
PRODUCT_BUNDLE_IDENTIFIER = io.element.elementx; PRODUCT_BUNDLE_IDENTIFIER = "$(BASE_BUNDLE_IDENTIFIER)";
PRODUCT_NAME = ElementX; PRODUCT_NAME = ElementX;
SDKROOT = iphoneos; SDKROOT = iphoneos;
SWIFT_OBJC_BRIDGING_HEADER = "ElementX/SupportingFiles/ElementX-Bridging-Header.h"; SWIFT_OBJC_BRIDGING_HEADER = "ElementX/SupportingFiles/ElementX-Bridging-Header.h";
@ -2900,7 +2898,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@loader_path/Frameworks", "@loader_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = io.element.elementx.unit.tests; PRODUCT_BUNDLE_IDENTIFIER = "${BASE_BUNDLE_IDENTIFIER}.unit.tests";
PRODUCT_NAME = UnitTests; PRODUCT_NAME = UnitTests;
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -2912,6 +2910,9 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
APP_GROUP_IDENTIFIER = "group.$(BASE_APP_GROUP_IDENTIFIER)";
BASE_APP_GROUP_IDENTIFIER = io.element;
BASE_BUNDLE_IDENTIFIER = io.element.elementx;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
@ -2971,6 +2972,9 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
APP_GROUP_IDENTIFIER = "group.$(BASE_APP_GROUP_IDENTIFIER)";
BASE_APP_GROUP_IDENTIFIER = io.element;
BASE_BUNDLE_IDENTIFIER = io.element.elementx;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
@ -3043,7 +3047,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@loader_path/Frameworks", "@loader_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = io.element.elementx.unit.tests; PRODUCT_BUNDLE_IDENTIFIER = "${BASE_BUNDLE_IDENTIFIER}.unit.tests";
PRODUCT_NAME = UnitTests; PRODUCT_NAME = UnitTests;
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -3061,7 +3065,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@loader_path/Frameworks", "@loader_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = io.element.elementx.ui.tests; PRODUCT_BUNDLE_IDENTIFIER = "${BASE_BUNDLE_IDENTIFIER}.ui.tests";
PRODUCT_NAME = UITests; PRODUCT_NAME = UITests;
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -3079,7 +3083,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@loader_path/Frameworks", "@loader_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = io.element.elementx.ui.tests; PRODUCT_BUNDLE_IDENTIFIER = "${BASE_BUNDLE_IDENTIFIER}.ui.tests";
PRODUCT_NAME = UITests; PRODUCT_NAME = UITests;
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -3097,7 +3101,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@loader_path/Frameworks", "@loader_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = io.element.elementx.integration.tests; PRODUCT_BUNDLE_IDENTIFIER = "${BASE_BUNDLE_IDENTIFIER}.integration.tests";
PRODUCT_NAME = IntegrationTests; PRODUCT_NAME = IntegrationTests;
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@ -3115,7 +3119,7 @@
"@executable_path/Frameworks", "@executable_path/Frameworks",
"@loader_path/Frameworks", "@loader_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = io.element.elementx.integration.tests; PRODUCT_BUNDLE_IDENTIFIER = "${BASE_BUNDLE_IDENTIFIER}.integration.tests";
PRODUCT_NAME = IntegrationTests; PRODUCT_NAME = IntegrationTests;
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";

View File

@ -10,9 +10,5 @@
</array> </array>
<key>com.apple.security.network.client</key> <key>com.apple.security.network.client</key>
<true/> <true/>
<key>keychain-access-groups</key>
<array>
<string>$(AppIdentifierPrefix)io.element.elementx</string>
</array>
</dict> </dict>
</plist> </plist>

View File

@ -20,6 +20,8 @@
<string>$(MARKETING_VERSION)</string> <string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string> <string>$(CURRENT_PROJECT_VERSION)</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UISupportedInterfaceOrientations</key> <key>UISupportedInterfaceOrientations</key>

View File

@ -46,12 +46,12 @@ targets:
UIInterfaceOrientationLandscapeRight UIInterfaceOrientationLandscapeRight
] ]
appGroupIdentifier: $(APP_GROUP_IDENTIFIER) appGroupIdentifier: $(APP_GROUP_IDENTIFIER)
ITSAppUsesNonExemptEncryption: false
settings: settings:
base: base:
PRODUCT_NAME: ElementX PRODUCT_NAME: ElementX
PRODUCT_BUNDLE_IDENTIFIER: io.element.elementx PRODUCT_BUNDLE_IDENTIFIER: $(BASE_BUNDLE_IDENTIFIER)
APP_GROUP_IDENTIFIER: group.io.element
MARKETING_VERSION: 1.0.4 MARKETING_VERSION: 1.0.4
CURRENT_PROJECT_VERSION: 1 CURRENT_PROJECT_VERSION: 1
DEVELOPMENT_TEAM: 7J4U792NQT DEVELOPMENT_TEAM: 7J4U792NQT

View File

@ -3,19 +3,18 @@ GEM
specs: specs:
CFPropertyList (3.0.5) CFPropertyList (3.0.5)
rexml rexml
activesupport (7.0.3.1) activesupport (7.0.4)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2) i18n (>= 1.6, < 2)
minitest (>= 5.1) minitest (>= 5.1)
tzinfo (~> 2.0) tzinfo (~> 2.0)
zeitwerk (~> 2.3) addressable (2.8.1)
addressable (2.8.0) public_suffix (>= 2.0.2, < 6.0)
public_suffix (>= 2.0.2, < 5.0)
artifactory (3.0.15) artifactory (3.0.15)
atomos (0.1.3) atomos (0.1.3)
aws-eventstream (1.2.0) aws-eventstream (1.2.0)
aws-partitions (1.610.0) aws-partitions (1.647.0)
aws-sdk-core (3.131.3) aws-sdk-core (3.161.0)
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.525.0) aws-partitions (~> 1, >= 1.525.0)
aws-sigv4 (~> 1.1) aws-sigv4 (~> 1.1)
@ -27,7 +26,7 @@ GEM
aws-sdk-core (~> 3, >= 3.127.0) aws-sdk-core (~> 3, >= 3.127.0)
aws-sdk-kms (~> 1) aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4) aws-sigv4 (~> 1.4)
aws-sigv4 (1.5.1) aws-sigv4 (1.5.2)
aws-eventstream (~> 1, >= 1.0.2) aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4) babosa (1.0.4)
claide (1.1.0) claide (1.1.0)
@ -42,10 +41,10 @@ GEM
rake (>= 12.0.0, < 14.0.0) rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701) domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0) unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.6) dotenv (2.8.1)
emoji_regex (3.2.3) emoji_regex (3.2.3)
excon (0.92.4) excon (0.93.0)
faraday (1.10.0) faraday (1.10.2)
faraday-em_http (~> 1.0) faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0) faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1) faraday-excon (~> 1.1)
@ -74,7 +73,7 @@ GEM
faraday_middleware (1.2.0) faraday_middleware (1.2.0)
faraday (~> 1.0) faraday (~> 1.0)
fastimage (2.2.6) fastimage (2.2.6)
fastlane (2.208.0) fastlane (2.210.1)
CFPropertyList (>= 2.3, < 4.0.0) CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0) addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0) artifactory (~> 3.0)
@ -116,13 +115,14 @@ GEM
fastlane-plugin-brew (0.1.1) fastlane-plugin-brew (0.1.1)
fastlane-plugin-diawi (2.1.0) fastlane-plugin-diawi (2.1.0)
rest-client (>= 2.0.0) rest-client (>= 2.0.0)
fastlane-plugin-sentry (1.12.2) fastlane-plugin-sentry (1.14.0)
os (~> 1.1, >= 1.1.4)
fastlane-plugin-xcodegen (1.1.0) fastlane-plugin-xcodegen (1.1.0)
fastlane-plugin-brew (~> 0.1.1) fastlane-plugin-brew (~> 0.1.1)
gh_inspector (1.1.3) gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.25.0) google-apis-androidpublisher_v3 (0.29.0)
google-apis-core (>= 0.7, < 2.a) google-apis-core (>= 0.9.0, < 2.a)
google-apis-core (0.7.0) google-apis-core (0.9.1)
addressable (~> 2.5, >= 2.5.1) addressable (~> 2.5, >= 2.5.1)
googleauth (>= 0.16.2, < 2.a) googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a) httpclient (>= 2.8.1, < 3.a)
@ -131,27 +131,27 @@ GEM
retriable (>= 2.0, < 4.a) retriable (>= 2.0, < 4.a)
rexml rexml
webrick webrick
google-apis-iamcredentials_v1 (0.13.0) google-apis-iamcredentials_v1 (0.15.0)
google-apis-core (>= 0.7, < 2.a) google-apis-core (>= 0.9.0, < 2.a)
google-apis-playcustomapp_v1 (0.10.0) google-apis-playcustomapp_v1 (0.11.0)
google-apis-core (>= 0.7, < 2.a) google-apis-core (>= 0.9.0, < 2.a)
google-apis-storage_v1 (0.18.0) google-apis-storage_v1 (0.19.0)
google-apis-core (>= 0.7, < 2.a) google-apis-core (>= 0.9.0, < 2.a)
google-cloud-core (1.6.0) google-cloud-core (1.6.0)
google-cloud-env (~> 1.0) google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0) google-cloud-errors (~> 1.0)
google-cloud-env (1.6.0) google-cloud-env (1.6.0)
faraday (>= 0.17.3, < 3.0) faraday (>= 0.17.3, < 3.0)
google-cloud-errors (1.2.0) google-cloud-errors (1.3.0)
google-cloud-storage (1.37.0) google-cloud-storage (1.43.0)
addressable (~> 2.8) addressable (~> 2.8)
digest-crc (~> 0.4) digest-crc (~> 0.4)
google-apis-iamcredentials_v1 (~> 0.1) google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.1) google-apis-storage_v1 (~> 0.19.0)
google-cloud-core (~> 1.6) google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a) googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0) mini_mime (~> 1.0)
googleauth (1.2.0) googleauth (1.3.0)
faraday (>= 0.17.3, < 3.a) faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0) jwt (>= 1.4, < 3.0)
memoist (~> 0.16) memoist (~> 0.16)
@ -167,7 +167,7 @@ GEM
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
jmespath (1.6.1) jmespath (1.6.1)
json (2.6.2) json (2.6.2)
jwt (2.4.1) jwt (2.5.0)
memoist (0.16.2) memoist (0.16.2)
mime-types (3.4.1) mime-types (3.4.1)
mime-types-data (~> 3.2015) mime-types-data (~> 3.2015)
@ -175,19 +175,19 @@ GEM
mini_magick (4.11.0) mini_magick (4.11.0)
mini_mime (1.1.2) mini_mime (1.1.2)
mini_portile2 (2.8.0) mini_portile2 (2.8.0)
minitest (5.16.2) minitest (5.16.3)
multi_json (1.15.0) multi_json (1.15.0)
multipart-post (2.0.0) multipart-post (2.0.0)
nanaimo (0.3.0) nanaimo (0.3.0)
naturally (2.2.1) naturally (2.2.1)
netrc (0.11.0) netrc (0.11.0)
nokogiri (1.13.8) nokogiri (1.13.9)
mini_portile2 (~> 2.8.0) mini_portile2 (~> 2.8.0)
racc (~> 1.4) racc (~> 1.4)
optparse (0.1.1) optparse (0.1.1)
os (1.1.4) os (1.1.4)
plist (3.6.0) plist (3.6.0)
public_suffix (4.0.7) public_suffix (5.0.0)
racc (1.6.0) racc (1.6.0)
rake (13.0.6) rake (13.0.6)
representable (3.2.0) representable (3.2.0)
@ -250,7 +250,6 @@ GEM
rouge (~> 2.0.7) rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.1) xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7) xcpretty (~> 0.2, >= 0.0.7)
zeitwerk (2.6.0)
PLATFORMS PLATFORMS
ruby ruby

View File

@ -32,7 +32,7 @@ targets:
settings: settings:
base: base:
PRODUCT_NAME: IntegrationTests PRODUCT_NAME: IntegrationTests
PRODUCT_BUNDLE_IDENTIFIER: io.element.elementx.integration.tests PRODUCT_BUNDLE_IDENTIFIER: ${BASE_BUNDLE_IDENTIFIER}.integration.tests
debug: debug:
release: release:

View File

@ -60,7 +60,7 @@ targets:
settings: settings:
base: base:
PRODUCT_NAME: UITests PRODUCT_NAME: UITests
PRODUCT_BUNDLE_IDENTIFIER: io.element.elementx.ui.tests PRODUCT_BUNDLE_IDENTIFIER: ${BASE_BUNDLE_IDENTIFIER}.ui.tests
debug: debug:
release: release:

View File

@ -40,7 +40,7 @@ targets:
settings: settings:
base: base:
PRODUCT_NAME: UnitTests PRODUCT_NAME: UnitTests
PRODUCT_BUNDLE_IDENTIFIER: io.element.elementx.unit.tests PRODUCT_BUNDLE_IDENTIFIER: ${BASE_BUNDLE_IDENTIFIER}.unit.tests
debug: debug:
release: release:

37
ci_scripts/ci_common.sh Executable file
View File

@ -0,0 +1,37 @@
#!/bin/sh
setup_environment () {
# Return on failures
# Fail when expanding unset variables
# Trace each command before executing it
set -eEu
# Move to the project root
cd ..
# Prevent installing dependencies in system directories
echo 'export GEM_HOME=$HOME/.gem' >>~/.zshrc
echo 'export PATH=$GEM_HOME/bin:$PATH' >>~/.zshrc
echo 'export PATH="/usr/local/opt/ruby@2.7/bin:$PATH"' >> ~/.zshrc
export GEM_HOME=$HOME/.gem
export PATH=$GEM_HOME/bin:$PATH
export PATH="/usr/local/opt/ruby@2.7/bin:$PATH"
# Things don't work well on the default ruby version
brew install "ruby@2.7"
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
}
install_brew_dependencies () {
brew install "xcodegen"
brew install "imagemagick"
}
install_python_dependencies () {
pip3 install -r requirements.txt # Install towncrier for generating changelogs
}

11
ci_scripts/ci_post_clone.sh Executable file
View File

@ -0,0 +1,11 @@
#!/bin/sh
source ci_common.sh
if [ "$CI_WORKFLOW" = "Nightly" ]; then
setup_environment
install_brew_dependencies
bundle exec fastlane config_nightly
fi

View File

@ -0,0 +1,15 @@
#!/bin/sh
source ci_common.sh
setup_environment
if [ "$CI_WORKFLOW" = "Release" ]; then
install_python_dependencies
bundle exec fastlane release_to_github
bundle exec fastlane prepare_next_release
fi
# Upload dsyms no matter the workflow
bundle exec fastlane upload_dsyms_to_sentry dsym_path:"$CI_ARCHIVE_PATH/dSYMs"

View File

@ -6,11 +6,8 @@ before_all do
end end
lane :alpha do lane :alpha do
config_xcodegen_alpha() config_xcodegen_alpha()
xcodegen(spec: "project.yml")
provisioning_profile_name = "ElementX PR Ad Hoc" provisioning_profile_name = "ElementX PR Ad Hoc"
bundle_identifier = "io.element.elementx.pr" bundle_identifier = "io.element.elementx.pr"
code_signing_identity = "Apple Distribution: Vector Creations Limited (7J4U792NQT)" code_signing_identity = "Apple Distribution: Vector Creations Limited (7J4U792NQT)"
@ -29,12 +26,6 @@ lane :alpha do
adhoc: true adhoc: true
) )
version = ENV["GITHUB_PR_NUMBER"]
update_app_icon(caption_text: "PR #{version}")
bump_build_number()
build_ios_app( build_ios_app(
scheme: "ElementX", scheme: "ElementX",
clean: true, clean: true,
@ -48,19 +39,6 @@ lane :alpha do
) )
upload_to_diawi() upload_to_diawi()
end
lane :github_release do
build_adhoc()
upload_to_diawi()
release_to_github()
prepare_next_release()
upload_dsyms_to_sentry()
end end
lane :app_store_release do lane :app_store_release do
@ -70,24 +48,7 @@ lane :app_store_release do
prepare_next_release() prepare_next_release()
upload_dsyms_to_sentry() upload_dsyms_to_sentry(dsym_path: './build/ElementX.app.dSYM.zip')
end
lane :build_adhoc do
bump_build_number()
build_ios_app(
scheme: "ElementX",
clean: true,
export_method: "ad-hoc",
output_directory: "build",
export_options: {
provisioningProfiles: {
"io.element.elementx" => "ElementX Ad Hoc",
}
}
)
end end
lane :build_release do lane :build_release do
@ -141,47 +102,41 @@ lane :integration_tests do
) )
end end
private_lane :bump_build_number do lane :config_nightly do
# Increment build number to current date target_file_path = "../project.yml"
build_number = Time.now.strftime("%Y%m%d%H%M")
increment_build_number(build_number: build_number)
end
private_lane :config_xcodegen_alpha do
target_file_path = "../ElementX/SupportingFiles/target.yml"
data = YAML.load_file target_file_path data = YAML.load_file target_file_path
data["targets"]["ElementX"]["settings"]["base"]["PRODUCT_NAME"] = "ElementX PR" data["settings"]["BASE_APP_GROUP_IDENTIFIER"] = "io.element.nightly"
data["targets"]["ElementX"]["settings"]["base"]["PRODUCT_BUNDLE_IDENTIFIER"] = "io.element.elementx.pr" data["settings"]["BASE_BUNDLE_IDENTIFIER"] = "io.element.elementx.nightly"
File.open(target_file_path, 'w') { |f| YAML.dump(data, f) } File.open(target_file_path, 'w') { |f| YAML.dump(data, f) }
xcodegen(spec: "project.yml")
# Automatically done by Xcode Cloud. Cannot override
# https://developer.apple.com/documentation/xcode/setting-the-next-build-number-for-xcode-cloud-builds
# bump_build_number()
release_version = get_version_number()
update_app_icon(caption_text: "Nightly #{release_version}", modulate: "100,20,100")
end end
desc "Upload IPA to Diawi" lane :upload_dsyms_to_sentry do |options|
private_lane :upload_to_diawi do auth_token = ENV["SENTRY_AUTH_TOKEN"]
api_token = ENV["DIAWI_API_TOKEN"] UI.user_error!("Invalid Sentry Auth token.") unless !auth_token.to_s.empty?
UI.user_error!("Invalid Diawi API token.") unless !api_token.to_s.empty?
# Upload to Diawi dsym_path = options[:dsym_path]
diawi( UI.user_error!("Invalid DSYM path.") unless !dsym_path.to_s.empty?
token: api_token,
wall_of_apps: false, sentry_upload_dif(
file: lane_context[SharedValues::IPA_OUTPUT_PATH] auth_token: auth_token,
org_slug: 'element',
project_slug: 'elementx',
url: 'https://sentry.tools.element.io/',
path: dsym_path,
) )
# Get the Diawi link from Diawi action shared value
diawi_link = lane_context[SharedValues::UPLOADED_FILE_LINK_TO_DIAWI]
UI.command_output("Diawi link: " + diawi_link.to_s)
# Generate the Diawi QR code file link
diawi_app_id = URI(diawi_link).path.split('/').last
diawi_qr_code_link = "https://www.diawi.com/qrcode/link/#{diawi_app_id}"
# Set "DIAWI_FILE_LINK" to GitHub environment variables for Github actions
sh("echo DIAWI_FILE_LINK=#{diawi_link} >> $GITHUB_ENV")
sh("echo DIAWI_QR_CODE_LINK=#{diawi_qr_code_link} >> $GITHUB_ENV")
end end
desc "Create GitHub Release" lane :release_to_github do
private_lane :release_to_github do
api_token = ENV["GITHUB_TOKEN"] api_token = ENV["GITHUB_TOKEN"]
UI.user_error!("Invalid GitHub API token.") unless !api_token.to_s.empty? UI.user_error!("Invalid GitHub API token.") unless !api_token.to_s.empty?
@ -216,7 +171,7 @@ private_lane :release_to_github do
end end
private_lane :prepare_next_release do lane :prepare_next_release do
target_file_path = "../ElementX/SupportingFiles/target.yml" target_file_path = "../ElementX/SupportingFiles/target.yml"
xcode_project_file_path = "../ElementX.xcodeproj" xcode_project_file_path = "../ElementX.xcodeproj"
@ -233,6 +188,54 @@ private_lane :prepare_next_release do
sh("git add #{target_file_path} #{xcode_project_file_path}") sh("git add #{target_file_path} #{xcode_project_file_path}")
sh("git commit -m 'Prepare next release'") sh("git commit -m 'Prepare next release'")
sh("git push")
end
private_lane :config_xcodegen_alpha do
target_file_path = "../project.yml"
data = YAML.load_file target_file_path
data["settings"]["BASE_APP_GROUP_IDENTIFIER"] = "io.element.pr"
data["settings"]["BASE_BUNDLE_IDENTIFIER"] = "io.element.elementx.pr"
File.open(target_file_path, 'w') { |f| YAML.dump(data, f) }
xcodegen(spec: "project.yml")
version = ENV["GITHUB_PR_NUMBER"]
update_app_icon(caption_text: "PR #{version}", modulate: "100,100,200")
bump_build_number()
end
private_lane :upload_to_diawi do
api_token = ENV["DIAWI_API_TOKEN"]
UI.user_error!("Invalid Diawi API token.") unless !api_token.to_s.empty?
# Upload to Diawi
diawi(
token: api_token,
wall_of_apps: false,
file: lane_context[SharedValues::IPA_OUTPUT_PATH]
)
# Get the Diawi link from Diawi action shared value
diawi_link = lane_context[SharedValues::UPLOADED_FILE_LINK_TO_DIAWI]
UI.command_output("Diawi link: " + diawi_link.to_s)
# Generate the Diawi QR code file link
diawi_app_id = URI(diawi_link).path.split('/').last
diawi_qr_code_link = "https://www.diawi.com/qrcode/link/#{diawi_app_id}"
# Set "DIAWI_FILE_LINK" to GitHub environment variables for Github actions
sh("echo DIAWI_FILE_LINK=#{diawi_link} >> $GITHUB_ENV")
sh("echo DIAWI_QR_CODE_LINK=#{diawi_qr_code_link} >> $GITHUB_ENV")
end
private_lane :bump_build_number do
# Increment build number to current date
build_number = Time.now.strftime("%Y%m%d%H%M")
increment_build_number(build_number: build_number)
end end
private_lane :export_version_changes do |options| private_lane :export_version_changes do |options|
@ -246,9 +249,12 @@ private_lane :update_app_icon do |options|
caption_text = options[:caption_text] caption_text = options[:caption_text]
UI.user_error!("Invalid caption text.") unless !caption_text.to_s.empty? UI.user_error!("Invalid caption text.") unless !caption_text.to_s.empty?
modulate = options[:modulate]
UI.user_error!("Invalid icon modulate parameters.") unless !modulate.to_s.empty?
Dir.glob("../ElementX/Resources/Assets.xcassets/AppIcon.appiconset/**/*.png") do |file_name| Dir.glob("../ElementX/Resources/Assets.xcassets/AppIcon.appiconset/**/*.png") do |file_name|
# Change the icons color # Change the icons color
sh("convert '#{file_name}' -modulate 100,100,200 '#{file_name}'") sh("convert '#{file_name}' -modulate #{modulate} '#{file_name}'")
caption_width = sh("identify -format %w '#{file_name}'") caption_width = sh("identify -format %w '#{file_name}'")
caption_height = file_name.end_with?("@2x.png") ? 60 : 30 caption_height = file_name.end_with?("@2x.png") ? 60 : 30
@ -259,16 +265,3 @@ private_lane :update_app_icon do |options|
end end
end end
end end
private_lane :upload_dsyms_to_sentry do
auth_token = ENV["SENTRY_AUTH_TOKEN"]
UI.user_error!("Invalid Sentry Auth token.") unless !auth_token.to_s.empty?
sentry_upload_dif(
auth_token: auth_token,
org_slug: 'element',
project_slug: 'elementx',
url: 'https://sentry.tools.element.io/',
path: './build/ElementX.app.dSYM.zip',
)
end

View File

@ -21,14 +21,6 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do
### github_release
```sh
[bundle exec] fastlane github_release
```
### app_store_release ### app_store_release
```sh ```sh
@ -37,14 +29,6 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do
### build_adhoc
```sh
[bundle exec] fastlane build_adhoc
```
### build_release ### build_release
```sh ```sh
@ -77,6 +61,38 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do
### config_nightly
```sh
[bundle exec] fastlane config_nightly
```
### upload_dsyms_to_sentry
```sh
[bundle exec] fastlane upload_dsyms_to_sentry
```
### release_to_github
```sh
[bundle exec] fastlane release_to_github
```
### prepare_next_release
```sh
[bundle exec] fastlane prepare_next_release
```
---- ----
This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.

View File

@ -22,7 +22,9 @@ options:
settings: settings:
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED: YES CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED: YES
ENABLE_BITCODE: NO ENABLE_BITCODE: NO
BASE_APP_GROUP_IDENTIFIER: io.element
APP_GROUP_IDENTIFIER: group.$(BASE_APP_GROUP_IDENTIFIER)
BASE_BUNDLE_IDENTIFIER: io.element.elementx
include: include:
- path: ElementX/SupportingFiles/target.yml - path: ElementX/SupportingFiles/target.yml