Refactor fastlane scripts

This commit is contained in:
Davide De Rosa 2019-09-29 22:51:02 +02:00
parent 84c13737dd
commit 42f204c136
8 changed files with 80 additions and 81 deletions

17
.env
View File

@ -1,12 +1,9 @@
LC_ALL="en_US.UTF-8"
LANG="en_US.UTF-8"
STAGE_BUILD_PATH="build/$TARGET"
STAGE_ARTIFACTS_PATH="dist/$TARGET"
STAGE_ARCHIVE_NAME="Passepartout"
BUILD_CHANGELOG_PATH="ci/CHANGELOG.md"
BUILD_DESCRIPTION_PATH="ci/DESCRIPTION.md"
APP_NAME="Passepartout"
GYM_SCHEME="Passepartout-iOS"
MATCH_READONLY="true"
IPA_OUTPUT_PATH="$STAGE_ARTIFACTS_PATH/$STAGE_ARCHIVE_NAME.ipa"
BUILD_PATH="build"
DIST_PATH="dist"
# constant (fastlane)
LC_ALL="en_US.UTF-8"
LANG="en_US.UTF-8"

View File

@ -1,3 +1,3 @@
PILOT_IPA=$IPA_OUTPUT_PATH
PILOT_IPA="$DIST_PATH/$TARGET/$APP_NAME.ipa"
PILOT_DISTRIBUTE_EXTERNAL="true"
DEMO_ACCOUNT_REQUIRED="true"

View File

@ -1,7 +1,3 @@
APPCENTER_APP_NAME="Passepartout"
APPCENTER_DISTRIBUTE_IPA=$IPA_OUTPUT_PATH
#FL_HOCKEY_COMMIT_SHA=$(git rev-parse HEAD)
#FL_HOCKEY_COMMIT_SHA=$CI_COMMIT_SHA
#FL_HOCKEY_BUILD_SERVER_URL="$CI_PROJECT_URL/-/jobs/$CI_JOB_ID"
#FL_HOCKEY_REPOSITORY_URL=$CI_PROJECT_URL
#FL_HOCKEY_STRATEGY="replace"
APPCENTER_APP_NAME=$GYM_SCHEME
APPCENTER_DISTRIBUTE_IPA="$DIST_PATH/$TARGET/$APP_NAME.ipa"
APPCENTER_DISTRIBUTE_DESTINATION_TYPE="group"

View File

@ -3,7 +3,7 @@ FASTLANE_USERNAME=
FASTLANE_PASSWORD=
APPCENTER_OWNER_NAME=
APPCENTER_API_TOKEN=
#APPCENTER_DISTRIBUTE_GROUP=
APPCENTER_DISTRIBUTE_DESTINATIONS=
PILOT_GROUPS=
PILOT_USERNAME=
DELIVER_USERNAME=

1
.gitignore vendored
View File

@ -15,5 +15,6 @@ build/
dist/
ci/CHANGELOG.md
ci/DESCRIPTION.md
ci/beta-feedback.txt
.env.secret*
Preview.html

View File

@ -1,5 +0,0 @@
#!/bin/sh
. .env.secret-deploy
SRC=$PROJECT_ROOT/api/v2
DST=$PROJECT_ROOT/passepartout-ios/Passepartout/Resources/Web
rm -rf $DST && cp -pr $SRC $DST

View File

@ -13,57 +13,63 @@
# Uncomment the line if you want fastlane to automatically update itself
# update_fastlane
default_platform(:ios)
build_description_path = "../ci/DESCRIPTION.md" # "../#{ENV["BUILD_DESCRIPTION_PATH"]}"
build_changelog_path = "../ci/CHANGELOG.md" # "../#{ENV["BUILD_CHANGELOG_PATH"]}"
beta_feedback_path = "../ci/beta-feedback.txt"
platform :ios do
desc "Archive a new build"
lane :create_archive do
ensure_git_status_clean
cocoapods
get_build_number
base_build_number = lane_context[SharedValues::BUILD_NUMBER].to_i
increment_build_number(
build_number: base_build_number + number_of_commits
)
match
gym
end
desc "Set build changelog"
lane :set_build_changelog do
lane_context[SharedValues::FL_CHANGELOG] = File.read("../#{ENV["BUILD_CHANGELOG_PATH"]}")
end
desc "Submit a build to App Center"
lane :dev_deploy do
set_build_changelog
appcenter_upload
end
desc "Submit a build to TestFlight"
lane :beta_deploy do
set_build_changelog
pilot(
beta_app_description: File.read("../#{ENV["BUILD_DESCRIPTION_PATH"]}")
)
end
desc "Update App Store metadata"
lane :update_metadata do
deliver(
skip_screenshots: true
)
end
desc "Update App Store screenshots"
lane :update_screenshots do
deliver(
skip_metadata: true
)
end
desc "Update provisioning profiles"
lane :update_provisioning do |options|
match(options)
end
desc "Prepare a new build"
lane :prepare_archive do
ensure_git_status_clean
cocoapods
get_build_number
base_build_number = lane_context[SharedValues::BUILD_NUMBER].to_i
increment_build_number(
build_number: base_build_number + number_of_commits
)
end
desc "Archive a new build"
lane :create_archive do
prepare_archive
match
gym
end
desc "Set build changelog"
lane :set_build_changelog do
lane_context[SharedValues::FL_CHANGELOG] = File.read(build_changelog_path)
end
desc "Submit a build to App Center"
lane :dev_deploy do
set_build_changelog
appcenter_upload
end
desc "Submit a build to TestFlight"
lane :beta_deploy do
set_build_changelog
pilot(
beta_app_description: File.read(build_description_path),
beta_app_feedback_email: File.read(beta_feedback_path)
)
end
desc "Update App Store metadata"
lane :update_metadata do
deliver(
skip_screenshots: true
)
end
desc "Update App Store screenshots"
lane :update_screenshots do
deliver(
skip_metadata: true
)
end
desc "Update provisioning profiles"
lane :update_provisioning do |options|
match(options)
end

View File

@ -10,11 +10,15 @@
# sdk "iphoneos9.0"
derived_data_path ENV["STAGE_BUILD_PATH"]
buildlog_path ENV["STAGE_BUILD_PATH"]
build_path ENV["STAGE_BUILD_PATH"]
output_directory ENV["STAGE_ARTIFACTS_PATH"]
output_name ENV["STAGE_ARCHIVE_NAME"]
build_target = ENV["TARGET"]
stage_build_path = "#{ENV["BUILD_PATH"]}/#{build_target}"
stage_artifacts_path = "#{ENV["DIST_PATH"]}/#{build_target}"
derived_data_path stage_build_path
buildlog_path stage_build_path
build_path stage_build_path
output_directory stage_artifacts_path
output_name ENV["APP_NAME"]
clean true
silent false