Merge pull request #4635 from vector-im/steve/4634_alpha_release

Build tools: Support building Ad Hoc alpha release
This commit is contained in:
SBiOSoftWhare 2021-08-13 18:24:31 +02:00 committed by GitHub
commit 522aeac690
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 486 additions and 58 deletions

88
.github/workflows/release-alpha.yml vendored Normal file
View file

@ -0,0 +1,88 @@
name: Build alpha release
on:
# Triggers the workflow on any pull request
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
# Make the git branch for a PR available to our Fastfile
MX_GIT_BRANCH: ${{ github.event.pull_request.head.ref }}
jobs:
build:
name: Release
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
# Common cache
# Note: GH actions do not support yaml anchor yet. We need to duplicate this for every job
- name: Cache CocoaPods libraries
uses: actions/cache@v2
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: Cache Ruby gems
uses: actions/cache@v2
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
# Make sure we use the latest version of MatrixKit
- name: Reset MatrixKit pod
run: rm -rf Pods/MatrixKit
# Common setup
# Note: GH actions do not support yaml anchor yet. We need to duplicate this for every job
- name: Bundle install
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Use right MatrixKit and MatrixSDK versions
run: bundle exec fastlane point_dependencies_to_related_branches
# Import alpha release private signing certificate
- name: Import signing certificate
uses: apple-actions/import-codesign-certs@v1
with:
p12-file-base64: ${{ secrets.ALPHA_CERTIFICATES_P12 }}
p12-password: ${{ secrets.ALPHA_CERTIFICATES_P12_PASSWORD }}
# Main step
# The Ad-hoc release link will be referenced as 'DIAWI_FILE_LINK'
# and QR link as 'DIAWI_QR_CODE_LINK' when the Diawi upload succeed
- name: Build Ad-hoc release and send it to Diawi
run: bundle exec fastlane alpha
env:
# Automaticaly bypass 2FA upgrade if possible on Apple account.
SPACESHIP_SKIP_2FA_UPGRADE: true
APPLE_ID: ${{ secrets.FASTLANE_USER }}
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
DIAWI_API_TOKEN: ${{ secrets.DIAWI_API_TOKEN }}
- name: Add or update PR comment with Ad-hoc release informations
uses: NejcZdovc/comment-pr@v1
with:
message: |
:iphone: Scan the QR code below to install the build for this PR.
:lock: This build is for internal testing purpose. Only devices listed in the ad-hoc provisioning profile can install Element Alpha.
![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 }}
# Enables to identify and update existing Ad-hoc release message on new commit in the PR
identifier: "GITHUB_COMMENT_ADHOC_RELEASE"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View file

@ -1,7 +1,7 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.2)
CFPropertyList (3.0.3)
activesupport (5.2.4.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
@ -12,22 +12,23 @@ GEM
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.1.0)
aws-partitions (1.393.0)
aws-sdk-core (3.109.2)
aws-eventstream (1.1.1)
aws-partitions (1.487.0)
aws-sdk-core (3.119.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.39.0)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sdk-kms (1.46.0)
aws-sdk-core (~> 3, >= 3.119.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.84.1)
aws-sdk-core (~> 3, >= 3.109.0)
aws-sdk-s3 (1.98.0)
aws-sdk-core (~> 3, >= 3.119.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.2)
aws-sigv4 (1.2.4)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
claide (1.0.3)
@ -70,38 +71,54 @@ GEM
cocoapods-try (1.2.0)
colored (1.2)
colored2 (3.1.2)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
commander (4.6.0)
highline (~> 2.0.0)
concurrent-ruby (1.1.8)
declarative (0.0.20)
declarative-option (0.1.0)
digest-crc (0.6.1)
rake (~> 13.0)
digest-crc (0.6.4)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.7.6)
emoji_regex (3.2.1)
emoji_regex (3.2.2)
escape (0.0.4)
ethon (0.12.0)
ffi (>= 1.3.0)
excon (0.78.0)
faraday (1.1.0)
excon (0.85.0)
faraday (1.7.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
multipart-post (>= 1.2, < 3)
ruby2_keywords
ruby2_keywords (>= 0.0.4)
faraday-cookie_jar (0.0.7)
faraday (>= 0.8.0)
http-cookie (~> 1.0.0)
faraday_middleware (1.0.0)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
faraday_middleware (1.1.0)
faraday (~> 1.0)
fastimage (2.2.0)
fastlane (2.167.0)
fastimage (2.2.5)
fastlane (2.191.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
aws-sdk-s3 (~> 1.0)
babosa (>= 1.0.3, < 2.0.0)
bundler (>= 1.12.0, < 3.0.0)
colored
commander-fastlane (>= 4.4.6, < 5.0.0)
commander (~> 4.6)
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 4.0)
excon (>= 0.71.0, < 1.0.0)
@ -110,18 +127,19 @@ GEM
faraday_middleware (~> 1.0)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-api-client (>= 0.37.0, < 0.39.0)
google-cloud-storage (>= 1.15.0, < 2.0.0)
highline (>= 1.7.2, < 2.0.0)
google-apis-androidpublisher_v3 (~> 0.3)
google-apis-playcustomapp_v1 (~> 0.1)
google-cloud-storage (~> 1.31)
highline (~> 2.0)
json (< 3.0.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (~> 2.0.0)
naturally (~> 2.2)
plist (>= 3.1.0, < 4.0.0)
rubyzip (>= 2.0.0, < 3.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0)
@ -131,76 +149,98 @@ GEM
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-brew (0.1.1)
fastlane-plugin-versioning (0.4.4)
fastlane-plugin-diawi (2.1.0)
rest-client (>= 2.0.0)
fastlane-plugin-versioning (0.5.0)
fastlane-plugin-xcodegen (1.0.0)
fastlane-plugin-brew (~> 0.1.1)
ffi (1.13.1)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
google-api-client (0.38.0)
google-apis-androidpublisher_v3 (0.10.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-core (0.4.1)
addressable (~> 2.5, >= 2.5.1)
googleauth (~> 0.9)
httpclient (>= 2.8.1, < 3.0)
googleauth (>= 0.16.2, < 2.a)
httpclient (>= 2.8.1, < 3.a)
mini_mime (~> 1.0)
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.12)
google-cloud-core (1.5.0)
retriable (>= 2.0, < 4.a)
rexml
webrick
google-apis-iamcredentials_v1 (0.6.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-playcustomapp_v1 (0.5.0)
google-apis-core (>= 0.4, < 2.a)
google-apis-storage_v1 (0.6.0)
google-apis-core (>= 0.4, < 2.a)
google-cloud-core (1.6.0)
google-cloud-env (~> 1.0)
google-cloud-errors (~> 1.0)
google-cloud-env (1.4.0)
google-cloud-env (1.5.0)
faraday (>= 0.17.3, < 2.0)
google-cloud-errors (1.0.1)
google-cloud-storage (1.29.1)
google-cloud-errors (1.1.0)
google-cloud-storage (1.34.1)
addressable (~> 2.5)
digest-crc (~> 0.4)
google-api-client (~> 0.33)
google-cloud-core (~> 1.2)
googleauth (~> 0.9)
google-apis-iamcredentials_v1 (~> 0.1)
google-apis-storage_v1 (~> 0.1)
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (0.14.0)
googleauth (0.17.0)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
multi_json (~> 1.11)
os (>= 0.9, < 2.0)
signet (~> 0.14)
highline (1.7.10)
http-cookie (1.0.3)
highline (2.0.3)
http-accept (1.7.0)
http-cookie (1.0.4)
domain_name (~> 0.5)
httpclient (2.8.3)
i18n (1.8.9)
concurrent-ruby (~> 1.0)
jmespath (1.4.0)
json (2.3.1)
jwt (2.2.2)
json (2.5.1)
jwt (2.2.3)
memoist (0.16.2)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2021.0704)
mini_magick (4.11.0)
mini_mime (1.0.2)
mini_mime (1.1.0)
minitest (5.14.4)
molinillo (0.6.6)
multi_json (1.15.0)
multipart-post (2.0.0)
nanaimo (0.3.0)
nap (1.1.0)
naturally (2.2.0)
naturally (2.2.1)
netrc (0.11.0)
os (1.1.1)
plist (3.5.0)
plist (3.6.0)
public_suffix (4.0.6)
rake (13.0.1)
representable (3.0.4)
rake (13.0.6)
representable (3.1.1)
declarative (< 0.1.0)
declarative-option (< 0.2.0)
trailblazer-option (>= 0.1.1, < 0.2.0)
uber (< 0.2.0)
rest-client (2.1.0)
http-accept (>= 1.7.0, < 2.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 4.0)
netrc (~> 0.8)
retriable (3.1.2)
rexml (3.2.5)
rouge (2.0.7)
ruby-macho (1.4.0)
ruby2_keywords (0.0.2)
rubyzip (2.3.0)
ruby2_keywords (0.0.5)
rubyzip (2.3.2)
security (0.1.3)
signet (0.14.0)
signet (0.15.0)
addressable (~> 2.3)
faraday (>= 0.17.3, < 2.0)
jwt (>= 1.5, < 3.0)
@ -208,11 +248,11 @@ GEM
simctl (1.6.8)
CFPropertyList
naturally
slack-notifier (2.3.2)
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
trailblazer-option (0.1.1)
tty-cursor (0.7.1)
tty-screen (0.8.1)
tty-spinner (0.9.3)
@ -226,19 +266,21 @@ GEM
unf_ext
unf_ext (0.0.7.7)
unicode-display_width (1.7.0)
webrick (1.7.0)
word_wrap (1.0.0)
xcode-install (2.6.7)
claide (>= 0.9.1, < 1.1.0)
fastlane (>= 2.1.0, < 3.0.0)
xcodeproj (1.19.0)
xcodeproj (1.21.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
xcpretty (0.3.0)
rouge (~> 2.0.7)
xcpretty-travis-formatter (1.0.0)
xcpretty-travis-formatter (1.0.1)
xcpretty (~> 0.2, >= 0.0.7)
PLATFORMS
@ -247,9 +289,10 @@ PLATFORMS
DEPENDENCIES
cocoapods (~> 1.10.1)
fastlane
fastlane-plugin-diawi
fastlane-plugin-versioning
fastlane-plugin-xcodegen
xcode-install
BUNDLED WITH
2.2.21
2.2.24

View file

@ -2,4 +2,5 @@
# This script is invoked by xcodegen for running post commands
# Move file header template in project shared data folder
cp IDETemplateMacros.plist Riot.xcodeproj/xcshareddata/

View file

@ -0,0 +1,44 @@
//
// Copyright 2021 Vector Creations Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// App identity
BUNDLE_DISPLAY_NAME = Element Alpha
BASE_BUNDLE_IDENTIFIER = im.vector.app.alpha
APPLICATION_GROUP_IDENTIFIER = group.im.vector.alpha
APPLICATION_SCHEME = element
// Version
MARKETING_VERSION = 1.4.8
CURRENT_PROJECT_VERSION = 1.4.8
// Team
DEVELOPMENT_TEAM = 7J4U792NQT
// Provisioning profiles
RIOT_PROVISIONING_PROFILE_SPECIFIER = "Alpha Vector App Add Hoc"
RIOT_PROVISIONING_PROFILE = a0ea2d4c-600d-4b0c-bd8f-f3c783add4cb
NSE_PROVISIONING_PROFILE_SPECIFIER = "Alpha Vector NSE Ad hoc"
NSE_PROVISIONING_PROFILE = 11b1eb20-fdfe-4242-963d-098b76e157ff
SHARE_EXTENSION_PROVISIONING_PROFILE_SPECIFIER = "Alpha Vector Share Extension Ad hoc"
SHARE_EXTENSION_PROVISIONING_PROFILE = b47f96e0-647b-4274-b2bb-8103b9a97146
SIRI_INTENTS_PROVISIONING_PROFILE_SPECIFIER = "Alpha Vector Siri Intents Ad hoc"
SIRI_INTENTS_PROVISIONING_PROFILE = a9fdb684-a68c-4207-afc2-810f3287b1f5

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 768 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -0,0 +1,116 @@
{
"images" : [
{
"filename" : "AppIcon~iPhone-20@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "AppIcon~iPhone-20@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "20x20"
},
{
"filename" : "AppIcon~iPhone-29@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "AppIcon~iPhone-29@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "29x29"
},
{
"filename" : "AppIcon~iPhone-40@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "AppIcon~iPhone-40@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "40x40"
},
{
"filename" : "AppIcon~iPhone-60@2x.png",
"idiom" : "iphone",
"scale" : "2x",
"size" : "60x60"
},
{
"filename" : "AppIcon~iPhone-60@3x.png",
"idiom" : "iphone",
"scale" : "3x",
"size" : "60x60"
},
{
"filename" : "AppIcon~iPad-20@1x.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "20x20"
},
{
"filename" : "AppIcon~iPad-20@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "20x20"
},
{
"filename" : "AppIcon~iPad-29@1x.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "29x29"
},
{
"filename" : "AppIcon~iPad-29@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "29x29"
},
{
"filename" : "AppIcon~iPad-40@1x.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "40x40"
},
{
"filename" : "AppIcon~iPad-40@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "40x40"
},
{
"filename" : "AppIcon~iPad-76@1x.png",
"idiom" : "ipad",
"scale" : "1x",
"size" : "76x76"
},
{
"filename" : "AppIcon~iPad-76@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "76x76"
},
{
"filename" : "AppIcon~iPad-83.5@2x.png",
"idiom" : "ipad",
"scale" : "2x",
"size" : "83.5x83.5"
},
{
"filename" : "AppIcon~iOS-Marketing-1024@1x.png",
"idiom" : "ios-marketing",
"scale" : "1x",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View file

@ -0,0 +1,53 @@
## Project configuration
PROJECT_PATH=Riot.xcodeproj
SCHEME=Riot
MAIN_TARGET=Riot
SHARE_EXTENSION_TARGET=RiotShareExtension
SIRI_INTENTS_EXTENSION_TARGET=SiriIntents
NSE_TARGET=RiotNSE
MAIN_BUNDLE_ID=im.vector.app.alpha
SHARE_EXTENSION_BUNDLE_ID=im.vector.app.alpha.shareExtension
SIRI_INTENTS_EXTENSION_BUNDLE_ID=im.vector.app.alpha.SiriIntents
NSE_BUNDLE_ID=im.vector.app.alpha.nse
## Build configuration
DERIVED_DATA_PATH=build
IPA_NAME=Riot
ARCHIVE_PATH=out/Riot.xcarchive
BUILD_OUTPUT_DIRECTORY=out
BUILD_LOG_DIRECTORY=build/Logs/Gym/
## Provisioning profiles files
PROVISIONING_PROFILES_PATH=./provisioning_profiles/
MAIN_PROVISIONING_PROFILE_FILENAME=main.mobileprovision
SHARE_EXTENSION_PROVISIONING_PROFILE_FILENAME=share_extension.mobileprovision
SIRI_INTENTS_EXTENSION_PROVISIONING_PROFILE_FILENAME=siri_intents.mobileprovision
NSE_PROVISIONING_PROFILE_FILENAME=nse.mobileprovision
## App Store code signing
APPSTORE_CODESIGNING_IDENTITY="Apple Distribution: Vector Creations Limited (7J4U792NQT)"
APPSTORE_SIGNING_CERTIFICATE="Apple Distribution: Vector Creations Limited (7J4U792NQT)"
APPSTORE_MAIN_PROVISIONING_PROFILE_SPECIFIER="Vector App Store"
APPSTORE_SHARE_EXTENSION_PROVISIONING_PROFILE_SPECIFIER="Vector Share Extension: App Store"
APPSTORE_SIRI_INTENTS_EXTENSION_PROVISIONING_PROFILE_SPECIFIER="Vector Siri Intents: App Store"
APPSTORE_NSE_PROVISIONING_PROFILE_SPECIFIER="Vector NSE: App Store"
## Ad-Hoc code signing
ADHOC_MAIN_PROVISIONING_PROFILE_SPECIFIER="Alpha Vector App Ad hoc"
ADHOC_SHARE_EXTENSION_PROVISIONING_PROFILE_SPECIFIER="Alpha Vector Share Extension Ad hoc"
ADHOC_SIRI_INTENTS_EXTENSION_PROVISIONING_PROFILE_SPECIFIER="Alpha Vector Siri Intents Ad hoc"
ADHOC_NSE_PROVISIONING_PROFILE_SPECIFIER="Alpha Vector NSE Ad hoc"
## Account information
TEAM_ID=7J4U792NQT
# APPLE_ID is set as shell environment variable on the machine running fastlane

30
Variants/setup_app_variant.sh Executable file
View file

@ -0,0 +1,30 @@
#!/bin/bash
# If you want to use an existing build variant or your own one you have to choose or create a folder with your variant name in "Variants" folder.
if [ ! $# -eq 1 ]; then
echo "Usage: ./setup_app_variant.sh [variant folder name]"
exit 1
fi
# Get variant name from user input
VARIANT_NAME=$1
VARIANTS_ROOT_FOLDER="Variants/"
cd ..
# Get the variant root folder
variant_root_folder="${VARIANTS_ROOT_FOLDER}${VARIANT_NAME}/"
project_root_folder="./"
# Check if variant folder exists
if [ ! -d "$variant_root_folder" ]; then
echo "Variant folder: ${variant_root_folder} do not exists"
exit 1
fi
echo "Applying app variant: ${VARIANT_NAME}"
# Merge variant directory into project directory
rsync -a "${variant_root_folder}" "${project_root_folder}"

1
changelog.d/4635.build Normal file
View file

@ -0,0 +1 @@
Support building Ad-hoc alpha release on pull request (#4635).

View file

@ -12,6 +12,7 @@
min_fastlane_version('2.156.0')
fastlane_require "dotenv"
fastlane_require "uri"
default_platform(:ios)
platform :ios do
@ -44,6 +45,44 @@ platform :ios do
build_release(options)
end
desc "Builds an Alpha ipa for pull request branches"
lane :alpha do
UI.user_error!("'DIAWI_API_TOKEN' environment variable should be set to use this lane") unless !ENV["DIAWI_API_TOKEN"].to_s.empty?
# Generate the "Alpha" app variant
setup_app_variant(name: "Alpha")
# Builds an Ad Hoc IPA
adhoc
# Upload to Diawi
upload_to_diawi
end
desc "Upload IPA to Diawi"
lane :upload_to_diawi do
UI.user_error!("'DIAWI_API_TOKEN' environment variable should be set to use this lane") unless !ENV["DIAWI_API_TOKEN"].to_s.empty?
# Upload to Diawi
diawi(
token: ENV["DIAWI_API_TOKEN"],
wall_of_apps: false
)
# 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}"
UI.command_output("Diawi QR code link: " + diawi_qr_code_link.to_s)
# Set "DIAWI_FILE_LINK" to GitHub environment variables for Github actions
if is_ci
sh("echo DIAWI_FILE_LINK=#{diawi_link} >> $GITHUB_ENV")
sh("echo DIAWI_QR_CODE_LINK=#{diawi_qr_code_link} >> $GITHUB_ENV")
end
end
desc "Builds the ipa for the AppStore, then uploads it"
lane :deploy_release do |options|
# build the IPA
@ -79,6 +118,17 @@ platform :ios do
edit_podfile(branch_pattern: mx_git_branch) unless mx_git_branch.to_s.empty?
end
desc "Use an app variant. An app variant overwrite default project configuration or ressource files with custom values"
lane :setup_app_variant do |options|
appVariantScript = "../Variants/setup_app_variant.sh"
# Make sure app variant script can be executed
sh "chmod 775 #{appVariantScript}"
# Run app variant script with variant name
sh(appVariantScript, options[:name])
# Force reloading env variables
Dotenv.overload(".env.default")
end
desc "Build the app for simulator to ensure it compiles"
lane :build do |options|
xcodegen(spec: "project.yml")
@ -148,6 +198,7 @@ platform :ios do
xcargs = xcargs_hash.map { |k, v| "#{k}=#{v.shellescape}" }.join(" ")
# Generate the project
xcodegen(spec: "project.yml")
# Clear derived data

View file

@ -4,3 +4,4 @@
gem 'fastlane-plugin-versioning'
gem 'fastlane-plugin-xcodegen'
gem 'fastlane-plugin-diawi'