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" APP_NAME="Passepartout"
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"
GYM_SCHEME="Passepartout-iOS" GYM_SCHEME="Passepartout-iOS"
MATCH_READONLY="true" 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" PILOT_DISTRIBUTE_EXTERNAL="true"
DEMO_ACCOUNT_REQUIRED="true" DEMO_ACCOUNT_REQUIRED="true"

View File

@ -1,7 +1,3 @@
APPCENTER_APP_NAME="Passepartout" APPCENTER_APP_NAME=$GYM_SCHEME
APPCENTER_DISTRIBUTE_IPA=$IPA_OUTPUT_PATH APPCENTER_DISTRIBUTE_IPA="$DIST_PATH/$TARGET/$APP_NAME.ipa"
#FL_HOCKEY_COMMIT_SHA=$(git rev-parse HEAD) APPCENTER_DISTRIBUTE_DESTINATION_TYPE="group"
#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"

View File

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

1
.gitignore vendored
View File

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

View File

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