diff --git a/.env b/.env index 6d5b7160..f4b1b488 100644 --- a/.env +++ b/.env @@ -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" diff --git a/.env.beta-deploy b/.env.beta-deploy index c62dfe0e..97ab8c80 100644 --- a/.env.beta-deploy +++ b/.env.beta-deploy @@ -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" diff --git a/.env.dev-deploy b/.env.dev-deploy index d3e139e0..deaf7dc9 100644 --- a/.env.dev-deploy +++ b/.env.dev-deploy @@ -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" diff --git a/.env.template.secret-deploy b/.env.template.secret-deploy index 8ed5953c..7544df2e 100644 --- a/.env.template.secret-deploy +++ b/.env.template.secret-deploy @@ -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= diff --git a/.gitignore b/.gitignore index 085117a1..03d50ccf 100644 --- a/.gitignore +++ b/.gitignore @@ -15,5 +15,6 @@ build/ dist/ ci/CHANGELOG.md ci/DESCRIPTION.md +ci/beta-feedback.txt .env.secret* Preview.html diff --git a/ci/copy-api.sh b/ci/copy-api.sh deleted file mode 100755 index a998f91c..00000000 --- a/ci/copy-api.sh +++ /dev/null @@ -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 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index d80facfc..668e5326 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -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 diff --git a/fastlane/Gymfile b/fastlane/Gymfile index 90e62cf2..3d7ef52a 100644 --- a/fastlane/Gymfile +++ b/fastlane/Gymfile @@ -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