xdripswift/fastlane/Fastfile

246 lines
7.0 KiB
Plaintext
Raw Normal View History

FastLane and GitHub Actions for Mac-free install, for semi-automated TestFlight distributions (#419) * Copy FastLane and GitHub Actions for Mac-free install Copied from FreeAPS-X, not yet adapted to Xdrip4iOS. Originally based on FastLane and GitHub Actions from LoopKit/LoopWorkspace * Adapt Fastfile and workflow file, rename workflow file to build_xdrip.yml * Adapt instructions to Xdrip4iOS * Fastfile: fix scheme (xdrip) * xDrip.xcconfig: MAIN_APP_BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).xdripswift * Add CURRENT_PROJECT_VERSION = $(CURRENT_PROJECT_VERSION) to xDrip and xdrip4iOS Widget targets * testflight.md instructions: Add NFC Tag Reading to xdripswift App ID -and some adjustments to identifier names * Validate repository secrets Copied from https://github.com/LoopKit/LoopWorkspace/pull/36 Validate repository secrets (#36) * Validate repository secrets Adds support for validation of repository secrets. * Validate $FASTLANE_KEY as unencrypted PKCS#8 * Number workflows to guide sequential exection * Add commented-out template for automated builds on push and on schedule (every two months) Users must uncomment (remove "#") from the start of the lines indicated in the workflow to enable automated builds. * testflight.md: Add Validate Secrets instructions, and add numbered workflows. * testflight.md: Add info about TestFlight on a child’s phone * testflight.md: add info about steps to re-use for "Browser Builds" of other apps * Add NFC tag reading capability to TestFlight app from Fastfile Remove step for manual setup of NFC tag reading capability from testflight.md * Always upload artifacts * build_xdrip.yml: remove "secrets" job No need to validate secrets for every build. This can be done by running Validate secrets manually. - remove "with: submodules: recursive" from Checkout action * build_xdrip.yml: Add branch name to run-name * testflight:md: update instructions * Build on macos-13 and Xcode 14.3 macos-13 is still in beta as GitHub Actions runner, but works well. Available Xcode versions are listed here, Xcode 14.2 is currently the default: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode * Remove $(SRCROOT)/ from INFOPLIST_FILE due to build error with Fastlane INFOPLIST_FILE = "$(SRCROOT)/xdrip/Supporting Files/Info.plist" Fastlane error: -Cannot set build number with plist path containing $(SRCROOT) -Please remove $(SRCROOT) in your Xcode target build settings More info: https://github.com/fastlane/fastlane/issues/329 * build_xdrip.yml: correct app name (xDrip4iOS) in workflow name * Sync changes from upstream, and keep repository "alive" The keep alive action allow scheduled runs beyond the 60 day repo inactivity limit for scheduled GitHub Actions * build_xdrip: SYNC_UPSTREAM: 'true' / 'false'
2023-06-02 11:13:42 +02:00
# This file contains the fastlane.tools configuration
# You can find the documentation at https://docs.fastlane.tools
#
# For a list of all available actions, check out
#
# https://docs.fastlane.tools/actions
#
# For a list of all available plugins, check out
#
# https://docs.fastlane.tools/plugins/available-plugins
#
default_platform(:ios)
TEAMID = ENV["TEAMID"]
GH_PAT = ENV["GH_PAT"]
GITHUB_WORKSPACE = ENV["GITHUB_WORKSPACE"]
GITHUB_REPOSITORY_OWNER = ENV["GITHUB_REPOSITORY_OWNER"]
FASTLANE_KEY_ID = ENV["FASTLANE_KEY_ID"]
FASTLANE_ISSUER_ID = ENV["FASTLANE_ISSUER_ID"]
FASTLANE_KEY = ENV["FASTLANE_KEY"]
DEVICE_NAME = ENV["DEVICE_NAME"]
DEVICE_ID = ENV["DEVICE_ID"]
ENV["FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT"] = "120"
platform :ios do
desc "Build Xdrip4iOS"
lane :build_xdrip4ios do
setup_ci if ENV['CI']
update_project_team(
path: "#{GITHUB_WORKSPACE}/xdrip.xcodeproj",
teamid: "#{TEAMID}"
)
api_key = app_store_connect_api_key(
key_id: "#{FASTLANE_KEY_ID}",
issuer_id: "#{FASTLANE_ISSUER_ID}",
key_content: "#{FASTLANE_KEY}"
)
previous_build_number = latest_testflight_build_number(
app_identifier: "com.#{TEAMID}.xdripswift",
api_key: api_key,
)
current_build_number = previous_build_number + 1
increment_build_number(
xcodeproj: "#{GITHUB_WORKSPACE}/xdrip.xcodeproj",
build_number: current_build_number
)
match(
type: "appstore",
git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"),
app_identifier: [
"com.#{TEAMID}.xdripswift",
"com.#{TEAMID}.xdripswift.xDripWidget",
"com.#{TEAMID}.xdripswift.watchkitapp",
"com.#{TEAMID}.xdripswift.watchkitapp.xDripWatchComplication"
FastLane and GitHub Actions for Mac-free install, for semi-automated TestFlight distributions (#419) * Copy FastLane and GitHub Actions for Mac-free install Copied from FreeAPS-X, not yet adapted to Xdrip4iOS. Originally based on FastLane and GitHub Actions from LoopKit/LoopWorkspace * Adapt Fastfile and workflow file, rename workflow file to build_xdrip.yml * Adapt instructions to Xdrip4iOS * Fastfile: fix scheme (xdrip) * xDrip.xcconfig: MAIN_APP_BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).xdripswift * Add CURRENT_PROJECT_VERSION = $(CURRENT_PROJECT_VERSION) to xDrip and xdrip4iOS Widget targets * testflight.md instructions: Add NFC Tag Reading to xdripswift App ID -and some adjustments to identifier names * Validate repository secrets Copied from https://github.com/LoopKit/LoopWorkspace/pull/36 Validate repository secrets (#36) * Validate repository secrets Adds support for validation of repository secrets. * Validate $FASTLANE_KEY as unencrypted PKCS#8 * Number workflows to guide sequential exection * Add commented-out template for automated builds on push and on schedule (every two months) Users must uncomment (remove "#") from the start of the lines indicated in the workflow to enable automated builds. * testflight.md: Add Validate Secrets instructions, and add numbered workflows. * testflight.md: Add info about TestFlight on a child’s phone * testflight.md: add info about steps to re-use for "Browser Builds" of other apps * Add NFC tag reading capability to TestFlight app from Fastfile Remove step for manual setup of NFC tag reading capability from testflight.md * Always upload artifacts * build_xdrip.yml: remove "secrets" job No need to validate secrets for every build. This can be done by running Validate secrets manually. - remove "with: submodules: recursive" from Checkout action * build_xdrip.yml: Add branch name to run-name * testflight:md: update instructions * Build on macos-13 and Xcode 14.3 macos-13 is still in beta as GitHub Actions runner, but works well. Available Xcode versions are listed here, Xcode 14.2 is currently the default: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode * Remove $(SRCROOT)/ from INFOPLIST_FILE due to build error with Fastlane INFOPLIST_FILE = "$(SRCROOT)/xdrip/Supporting Files/Info.plist" Fastlane error: -Cannot set build number with plist path containing $(SRCROOT) -Please remove $(SRCROOT) in your Xcode target build settings More info: https://github.com/fastlane/fastlane/issues/329 * build_xdrip.yml: correct app name (xDrip4iOS) in workflow name * Sync changes from upstream, and keep repository "alive" The keep alive action allow scheduled runs beyond the 60 day repo inactivity limit for scheduled GitHub Actions * build_xdrip: SYNC_UPSTREAM: 'true' / 'false'
2023-06-02 11:13:42 +02:00
]
)
previous_build_number = latest_testflight_build_number(
app_identifier: "com.#{TEAMID}.xdripswift",
api_key: api_key,
)
current_build_number = previous_build_number + 1
increment_build_number(
xcodeproj: "#{GITHUB_WORKSPACE}/xdrip.xcodeproj",
build_number: current_build_number
)
mapping = Actions.lane_context[
SharedValues::MATCH_PROVISIONING_PROFILE_MAPPING
]
update_code_signing_settings(
path: "#{GITHUB_WORKSPACE}/xdrip.xcodeproj",
profile_name: mapping["com.#{TEAMID}.xdripswift"],
code_sign_identity: "iPhone Distribution",
targets: ["xdrip"]
)
update_code_signing_settings(
path: "#{GITHUB_WORKSPACE}/xdrip.xcodeproj",
profile_name: mapping["com.#{TEAMID}.xdripswift.xDripWidget"],
FastLane and GitHub Actions for Mac-free install, for semi-automated TestFlight distributions (#419) * Copy FastLane and GitHub Actions for Mac-free install Copied from FreeAPS-X, not yet adapted to Xdrip4iOS. Originally based on FastLane and GitHub Actions from LoopKit/LoopWorkspace * Adapt Fastfile and workflow file, rename workflow file to build_xdrip.yml * Adapt instructions to Xdrip4iOS * Fastfile: fix scheme (xdrip) * xDrip.xcconfig: MAIN_APP_BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).xdripswift * Add CURRENT_PROJECT_VERSION = $(CURRENT_PROJECT_VERSION) to xDrip and xdrip4iOS Widget targets * testflight.md instructions: Add NFC Tag Reading to xdripswift App ID -and some adjustments to identifier names * Validate repository secrets Copied from https://github.com/LoopKit/LoopWorkspace/pull/36 Validate repository secrets (#36) * Validate repository secrets Adds support for validation of repository secrets. * Validate $FASTLANE_KEY as unencrypted PKCS#8 * Number workflows to guide sequential exection * Add commented-out template for automated builds on push and on schedule (every two months) Users must uncomment (remove "#") from the start of the lines indicated in the workflow to enable automated builds. * testflight.md: Add Validate Secrets instructions, and add numbered workflows. * testflight.md: Add info about TestFlight on a child’s phone * testflight.md: add info about steps to re-use for "Browser Builds" of other apps * Add NFC tag reading capability to TestFlight app from Fastfile Remove step for manual setup of NFC tag reading capability from testflight.md * Always upload artifacts * build_xdrip.yml: remove "secrets" job No need to validate secrets for every build. This can be done by running Validate secrets manually. - remove "with: submodules: recursive" from Checkout action * build_xdrip.yml: Add branch name to run-name * testflight:md: update instructions * Build on macos-13 and Xcode 14.3 macos-13 is still in beta as GitHub Actions runner, but works well. Available Xcode versions are listed here, Xcode 14.2 is currently the default: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode * Remove $(SRCROOT)/ from INFOPLIST_FILE due to build error with Fastlane INFOPLIST_FILE = "$(SRCROOT)/xdrip/Supporting Files/Info.plist" Fastlane error: -Cannot set build number with plist path containing $(SRCROOT) -Please remove $(SRCROOT) in your Xcode target build settings More info: https://github.com/fastlane/fastlane/issues/329 * build_xdrip.yml: correct app name (xDrip4iOS) in workflow name * Sync changes from upstream, and keep repository "alive" The keep alive action allow scheduled runs beyond the 60 day repo inactivity limit for scheduled GitHub Actions * build_xdrip: SYNC_UPSTREAM: 'true' / 'false'
2023-06-02 11:13:42 +02:00
code_sign_identity: "iPhone Distribution",
targets: ["xDrip Widget Extension"]
FastLane and GitHub Actions for Mac-free install, for semi-automated TestFlight distributions (#419) * Copy FastLane and GitHub Actions for Mac-free install Copied from FreeAPS-X, not yet adapted to Xdrip4iOS. Originally based on FastLane and GitHub Actions from LoopKit/LoopWorkspace * Adapt Fastfile and workflow file, rename workflow file to build_xdrip.yml * Adapt instructions to Xdrip4iOS * Fastfile: fix scheme (xdrip) * xDrip.xcconfig: MAIN_APP_BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).xdripswift * Add CURRENT_PROJECT_VERSION = $(CURRENT_PROJECT_VERSION) to xDrip and xdrip4iOS Widget targets * testflight.md instructions: Add NFC Tag Reading to xdripswift App ID -and some adjustments to identifier names * Validate repository secrets Copied from https://github.com/LoopKit/LoopWorkspace/pull/36 Validate repository secrets (#36) * Validate repository secrets Adds support for validation of repository secrets. * Validate $FASTLANE_KEY as unencrypted PKCS#8 * Number workflows to guide sequential exection * Add commented-out template for automated builds on push and on schedule (every two months) Users must uncomment (remove "#") from the start of the lines indicated in the workflow to enable automated builds. * testflight.md: Add Validate Secrets instructions, and add numbered workflows. * testflight.md: Add info about TestFlight on a child’s phone * testflight.md: add info about steps to re-use for "Browser Builds" of other apps * Add NFC tag reading capability to TestFlight app from Fastfile Remove step for manual setup of NFC tag reading capability from testflight.md * Always upload artifacts * build_xdrip.yml: remove "secrets" job No need to validate secrets for every build. This can be done by running Validate secrets manually. - remove "with: submodules: recursive" from Checkout action * build_xdrip.yml: Add branch name to run-name * testflight:md: update instructions * Build on macos-13 and Xcode 14.3 macos-13 is still in beta as GitHub Actions runner, but works well. Available Xcode versions are listed here, Xcode 14.2 is currently the default: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode * Remove $(SRCROOT)/ from INFOPLIST_FILE due to build error with Fastlane INFOPLIST_FILE = "$(SRCROOT)/xdrip/Supporting Files/Info.plist" Fastlane error: -Cannot set build number with plist path containing $(SRCROOT) -Please remove $(SRCROOT) in your Xcode target build settings More info: https://github.com/fastlane/fastlane/issues/329 * build_xdrip.yml: correct app name (xDrip4iOS) in workflow name * Sync changes from upstream, and keep repository "alive" The keep alive action allow scheduled runs beyond the 60 day repo inactivity limit for scheduled GitHub Actions * build_xdrip: SYNC_UPSTREAM: 'true' / 'false'
2023-06-02 11:13:42 +02:00
)
update_code_signing_settings(
path: "#{GITHUB_WORKSPACE}/xdrip.xcodeproj",
profile_name: mapping["com.#{TEAMID}.xdripswift.watchkitapp"],
code_sign_identity: "iPhone Distribution",
targets: ["xDrip Watch App"]
)
update_code_signing_settings(
path: "#{GITHUB_WORKSPACE}/xdrip.xcodeproj",
profile_name: mapping["com.#{TEAMID}.xdripswift.watchkitapp.xDripWatchComplication"],
code_sign_identity: "iPhone Distribution",
targets: ["xDrip Watch Complication Extension"]
FastLane and GitHub Actions for Mac-free install, for semi-automated TestFlight distributions (#419) * Copy FastLane and GitHub Actions for Mac-free install Copied from FreeAPS-X, not yet adapted to Xdrip4iOS. Originally based on FastLane and GitHub Actions from LoopKit/LoopWorkspace * Adapt Fastfile and workflow file, rename workflow file to build_xdrip.yml * Adapt instructions to Xdrip4iOS * Fastfile: fix scheme (xdrip) * xDrip.xcconfig: MAIN_APP_BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).xdripswift * Add CURRENT_PROJECT_VERSION = $(CURRENT_PROJECT_VERSION) to xDrip and xdrip4iOS Widget targets * testflight.md instructions: Add NFC Tag Reading to xdripswift App ID -and some adjustments to identifier names * Validate repository secrets Copied from https://github.com/LoopKit/LoopWorkspace/pull/36 Validate repository secrets (#36) * Validate repository secrets Adds support for validation of repository secrets. * Validate $FASTLANE_KEY as unencrypted PKCS#8 * Number workflows to guide sequential exection * Add commented-out template for automated builds on push and on schedule (every two months) Users must uncomment (remove "#") from the start of the lines indicated in the workflow to enable automated builds. * testflight.md: Add Validate Secrets instructions, and add numbered workflows. * testflight.md: Add info about TestFlight on a child’s phone * testflight.md: add info about steps to re-use for "Browser Builds" of other apps * Add NFC tag reading capability to TestFlight app from Fastfile Remove step for manual setup of NFC tag reading capability from testflight.md * Always upload artifacts * build_xdrip.yml: remove "secrets" job No need to validate secrets for every build. This can be done by running Validate secrets manually. - remove "with: submodules: recursive" from Checkout action * build_xdrip.yml: Add branch name to run-name * testflight:md: update instructions * Build on macos-13 and Xcode 14.3 macos-13 is still in beta as GitHub Actions runner, but works well. Available Xcode versions are listed here, Xcode 14.2 is currently the default: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode * Remove $(SRCROOT)/ from INFOPLIST_FILE due to build error with Fastlane INFOPLIST_FILE = "$(SRCROOT)/xdrip/Supporting Files/Info.plist" Fastlane error: -Cannot set build number with plist path containing $(SRCROOT) -Please remove $(SRCROOT) in your Xcode target build settings More info: https://github.com/fastlane/fastlane/issues/329 * build_xdrip.yml: correct app name (xDrip4iOS) in workflow name * Sync changes from upstream, and keep repository "alive" The keep alive action allow scheduled runs beyond the 60 day repo inactivity limit for scheduled GitHub Actions * build_xdrip: SYNC_UPSTREAM: 'true' / 'false'
2023-06-02 11:13:42 +02:00
)
gym(
export_method: "app-store",
scheme: "xdrip",
output_name: "Xdrip4iOS.ipa",
configuration: "Release",
destination: 'generic/platform=iOS',
buildlog_path: 'buildlog'
)
copy_artifacts(
target_path: "artifacts",
artifacts: ["*.mobileprovision", "*.ipa", "*.dSYM.zip"]
)
end
desc "Push to TestFlight"
lane :release do
api_key = app_store_connect_api_key(
key_id: "#{FASTLANE_KEY_ID}",
issuer_id: "#{FASTLANE_ISSUER_ID}",
key_content: "#{FASTLANE_KEY}"
)
upload_to_testflight(
api_key: api_key,
skip_submission: false,
ipa: "Xdrip4iOS.ipa",
skip_waiting_for_build_processing: true,
)
end
desc "Provision Identifiers and Certificates"
lane :identifiers do
setup_ci if ENV['CI']
ENV["MATCH_READONLY"] = false.to_s
app_store_connect_api_key(
key_id: "#{FASTLANE_KEY_ID}",
issuer_id: "#{FASTLANE_ISSUER_ID}",
key_content: "#{FASTLANE_KEY}"
)
def configure_bundle_id(name, identifier, capabilities)
bundle_id = Spaceship::ConnectAPI::BundleId.find(identifier) || Spaceship::ConnectAPI::BundleId.create(name: name, identifier: identifier)
capabilities.each { |capability|
bundle_id.create_capability(capability)
}
end
configure_bundle_id("xdrip", "com.#{TEAMID}.xdripswift", [
Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS,
Spaceship::ConnectAPI::BundleIdCapability::Type::HEALTHKIT,
Spaceship::ConnectAPI::BundleIdCapability::Type::NFC_TAG_READING
])
configure_bundle_id("xDrip Widget Extension", "com.#{TEAMID}.xdripswift.xDripWidget", [
Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS
])
configure_bundle_id("xDrip Watch App", "com.#{TEAMID}.xdripswift.watchkitapp", [
FastLane and GitHub Actions for Mac-free install, for semi-automated TestFlight distributions (#419) * Copy FastLane and GitHub Actions for Mac-free install Copied from FreeAPS-X, not yet adapted to Xdrip4iOS. Originally based on FastLane and GitHub Actions from LoopKit/LoopWorkspace * Adapt Fastfile and workflow file, rename workflow file to build_xdrip.yml * Adapt instructions to Xdrip4iOS * Fastfile: fix scheme (xdrip) * xDrip.xcconfig: MAIN_APP_BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).xdripswift * Add CURRENT_PROJECT_VERSION = $(CURRENT_PROJECT_VERSION) to xDrip and xdrip4iOS Widget targets * testflight.md instructions: Add NFC Tag Reading to xdripswift App ID -and some adjustments to identifier names * Validate repository secrets Copied from https://github.com/LoopKit/LoopWorkspace/pull/36 Validate repository secrets (#36) * Validate repository secrets Adds support for validation of repository secrets. * Validate $FASTLANE_KEY as unencrypted PKCS#8 * Number workflows to guide sequential exection * Add commented-out template for automated builds on push and on schedule (every two months) Users must uncomment (remove "#") from the start of the lines indicated in the workflow to enable automated builds. * testflight.md: Add Validate Secrets instructions, and add numbered workflows. * testflight.md: Add info about TestFlight on a child’s phone * testflight.md: add info about steps to re-use for "Browser Builds" of other apps * Add NFC tag reading capability to TestFlight app from Fastfile Remove step for manual setup of NFC tag reading capability from testflight.md * Always upload artifacts * build_xdrip.yml: remove "secrets" job No need to validate secrets for every build. This can be done by running Validate secrets manually. - remove "with: submodules: recursive" from Checkout action * build_xdrip.yml: Add branch name to run-name * testflight:md: update instructions * Build on macos-13 and Xcode 14.3 macos-13 is still in beta as GitHub Actions runner, but works well. Available Xcode versions are listed here, Xcode 14.2 is currently the default: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode * Remove $(SRCROOT)/ from INFOPLIST_FILE due to build error with Fastlane INFOPLIST_FILE = "$(SRCROOT)/xdrip/Supporting Files/Info.plist" Fastlane error: -Cannot set build number with plist path containing $(SRCROOT) -Please remove $(SRCROOT) in your Xcode target build settings More info: https://github.com/fastlane/fastlane/issues/329 * build_xdrip.yml: correct app name (xDrip4iOS) in workflow name * Sync changes from upstream, and keep repository "alive" The keep alive action allow scheduled runs beyond the 60 day repo inactivity limit for scheduled GitHub Actions * build_xdrip: SYNC_UPSTREAM: 'true' / 'false'
2023-06-02 11:13:42 +02:00
Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS
])
configure_bundle_id("xDrip Watch Complication Extension", "com.#{TEAMID}.xdripswift.watchkitapp.xDripWatchComplication", [
FastLane and GitHub Actions for Mac-free install, for semi-automated TestFlight distributions (#419) * Copy FastLane and GitHub Actions for Mac-free install Copied from FreeAPS-X, not yet adapted to Xdrip4iOS. Originally based on FastLane and GitHub Actions from LoopKit/LoopWorkspace * Adapt Fastfile and workflow file, rename workflow file to build_xdrip.yml * Adapt instructions to Xdrip4iOS * Fastfile: fix scheme (xdrip) * xDrip.xcconfig: MAIN_APP_BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).xdripswift * Add CURRENT_PROJECT_VERSION = $(CURRENT_PROJECT_VERSION) to xDrip and xdrip4iOS Widget targets * testflight.md instructions: Add NFC Tag Reading to xdripswift App ID -and some adjustments to identifier names * Validate repository secrets Copied from https://github.com/LoopKit/LoopWorkspace/pull/36 Validate repository secrets (#36) * Validate repository secrets Adds support for validation of repository secrets. * Validate $FASTLANE_KEY as unencrypted PKCS#8 * Number workflows to guide sequential exection * Add commented-out template for automated builds on push and on schedule (every two months) Users must uncomment (remove "#") from the start of the lines indicated in the workflow to enable automated builds. * testflight.md: Add Validate Secrets instructions, and add numbered workflows. * testflight.md: Add info about TestFlight on a child’s phone * testflight.md: add info about steps to re-use for "Browser Builds" of other apps * Add NFC tag reading capability to TestFlight app from Fastfile Remove step for manual setup of NFC tag reading capability from testflight.md * Always upload artifacts * build_xdrip.yml: remove "secrets" job No need to validate secrets for every build. This can be done by running Validate secrets manually. - remove "with: submodules: recursive" from Checkout action * build_xdrip.yml: Add branch name to run-name * testflight:md: update instructions * Build on macos-13 and Xcode 14.3 macos-13 is still in beta as GitHub Actions runner, but works well. Available Xcode versions are listed here, Xcode 14.2 is currently the default: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode * Remove $(SRCROOT)/ from INFOPLIST_FILE due to build error with Fastlane INFOPLIST_FILE = "$(SRCROOT)/xdrip/Supporting Files/Info.plist" Fastlane error: -Cannot set build number with plist path containing $(SRCROOT) -Please remove $(SRCROOT) in your Xcode target build settings More info: https://github.com/fastlane/fastlane/issues/329 * build_xdrip.yml: correct app name (xDrip4iOS) in workflow name * Sync changes from upstream, and keep repository "alive" The keep alive action allow scheduled runs beyond the 60 day repo inactivity limit for scheduled GitHub Actions * build_xdrip: SYNC_UPSTREAM: 'true' / 'false'
2023-06-02 11:13:42 +02:00
Spaceship::ConnectAPI::BundleIdCapability::Type::APP_GROUPS
])
end
desc "Provision Certificates"
lane :certs do
setup_ci if ENV['CI']
ENV["MATCH_READONLY"] = false.to_s
app_store_connect_api_key(
key_id: "#{FASTLANE_KEY_ID}",
issuer_id: "#{FASTLANE_ISSUER_ID}",
key_content: "#{FASTLANE_KEY}"
)
match(
type: "appstore",
force: true,
git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"),
app_identifier: [
"com.#{TEAMID}.xdripswift",
"com.#{TEAMID}.xdripswift.xDripWidget",
"com.#{TEAMID}.xdripswift.watchkitapp",
"com.#{TEAMID}.xdripswift.watchkitapp.xDripWatchComplication"
FastLane and GitHub Actions for Mac-free install, for semi-automated TestFlight distributions (#419) * Copy FastLane and GitHub Actions for Mac-free install Copied from FreeAPS-X, not yet adapted to Xdrip4iOS. Originally based on FastLane and GitHub Actions from LoopKit/LoopWorkspace * Adapt Fastfile and workflow file, rename workflow file to build_xdrip.yml * Adapt instructions to Xdrip4iOS * Fastfile: fix scheme (xdrip) * xDrip.xcconfig: MAIN_APP_BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).xdripswift * Add CURRENT_PROJECT_VERSION = $(CURRENT_PROJECT_VERSION) to xDrip and xdrip4iOS Widget targets * testflight.md instructions: Add NFC Tag Reading to xdripswift App ID -and some adjustments to identifier names * Validate repository secrets Copied from https://github.com/LoopKit/LoopWorkspace/pull/36 Validate repository secrets (#36) * Validate repository secrets Adds support for validation of repository secrets. * Validate $FASTLANE_KEY as unencrypted PKCS#8 * Number workflows to guide sequential exection * Add commented-out template for automated builds on push and on schedule (every two months) Users must uncomment (remove "#") from the start of the lines indicated in the workflow to enable automated builds. * testflight.md: Add Validate Secrets instructions, and add numbered workflows. * testflight.md: Add info about TestFlight on a child’s phone * testflight.md: add info about steps to re-use for "Browser Builds" of other apps * Add NFC tag reading capability to TestFlight app from Fastfile Remove step for manual setup of NFC tag reading capability from testflight.md * Always upload artifacts * build_xdrip.yml: remove "secrets" job No need to validate secrets for every build. This can be done by running Validate secrets manually. - remove "with: submodules: recursive" from Checkout action * build_xdrip.yml: Add branch name to run-name * testflight:md: update instructions * Build on macos-13 and Xcode 14.3 macos-13 is still in beta as GitHub Actions runner, but works well. Available Xcode versions are listed here, Xcode 14.2 is currently the default: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode * Remove $(SRCROOT)/ from INFOPLIST_FILE due to build error with Fastlane INFOPLIST_FILE = "$(SRCROOT)/xdrip/Supporting Files/Info.plist" Fastlane error: -Cannot set build number with plist path containing $(SRCROOT) -Please remove $(SRCROOT) in your Xcode target build settings More info: https://github.com/fastlane/fastlane/issues/329 * build_xdrip.yml: correct app name (xDrip4iOS) in workflow name * Sync changes from upstream, and keep repository "alive" The keep alive action allow scheduled runs beyond the 60 day repo inactivity limit for scheduled GitHub Actions * build_xdrip: SYNC_UPSTREAM: 'true' / 'false'
2023-06-02 11:13:42 +02:00
]
)
end
desc "Validate Secrets"
lane :validate_secrets do
setup_ci if ENV['CI']
ENV["MATCH_READONLY"] = true.to_s
app_store_connect_api_key(
key_id: "#{FASTLANE_KEY_ID}",
issuer_id: "#{FASTLANE_ISSUER_ID}",
key_content: "#{FASTLANE_KEY}"
)
def find_bundle_id(identifier)
bundle_id = Spaceship::ConnectAPI::BundleId.find(identifier)
end
find_bundle_id("com.#{TEAMID}.xdripswift")
match(
type: "appstore",
git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}"),
app_identifier: [],
)
FastLane and GitHub Actions for Mac-free install, for semi-automated TestFlight distributions (#419) * Copy FastLane and GitHub Actions for Mac-free install Copied from FreeAPS-X, not yet adapted to Xdrip4iOS. Originally based on FastLane and GitHub Actions from LoopKit/LoopWorkspace * Adapt Fastfile and workflow file, rename workflow file to build_xdrip.yml * Adapt instructions to Xdrip4iOS * Fastfile: fix scheme (xdrip) * xDrip.xcconfig: MAIN_APP_BUNDLE_IDENTIFIER = com.$(DEVELOPMENT_TEAM).xdripswift * Add CURRENT_PROJECT_VERSION = $(CURRENT_PROJECT_VERSION) to xDrip and xdrip4iOS Widget targets * testflight.md instructions: Add NFC Tag Reading to xdripswift App ID -and some adjustments to identifier names * Validate repository secrets Copied from https://github.com/LoopKit/LoopWorkspace/pull/36 Validate repository secrets (#36) * Validate repository secrets Adds support for validation of repository secrets. * Validate $FASTLANE_KEY as unencrypted PKCS#8 * Number workflows to guide sequential exection * Add commented-out template for automated builds on push and on schedule (every two months) Users must uncomment (remove "#") from the start of the lines indicated in the workflow to enable automated builds. * testflight.md: Add Validate Secrets instructions, and add numbered workflows. * testflight.md: Add info about TestFlight on a child’s phone * testflight.md: add info about steps to re-use for "Browser Builds" of other apps * Add NFC tag reading capability to TestFlight app from Fastfile Remove step for manual setup of NFC tag reading capability from testflight.md * Always upload artifacts * build_xdrip.yml: remove "secrets" job No need to validate secrets for every build. This can be done by running Validate secrets manually. - remove "with: submodules: recursive" from Checkout action * build_xdrip.yml: Add branch name to run-name * testflight:md: update instructions * Build on macos-13 and Xcode 14.3 macos-13 is still in beta as GitHub Actions runner, but works well. Available Xcode versions are listed here, Xcode 14.2 is currently the default: https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md#xcode * Remove $(SRCROOT)/ from INFOPLIST_FILE due to build error with Fastlane INFOPLIST_FILE = "$(SRCROOT)/xdrip/Supporting Files/Info.plist" Fastlane error: -Cannot set build number with plist path containing $(SRCROOT) -Please remove $(SRCROOT) in your Xcode target build settings More info: https://github.com/fastlane/fastlane/issues/329 * build_xdrip.yml: correct app name (xDrip4iOS) in workflow name * Sync changes from upstream, and keep repository "alive" The keep alive action allow scheduled runs beyond the 60 day repo inactivity limit for scheduled GitHub Actions * build_xdrip: SYNC_UPSTREAM: 'true' / 'false'
2023-06-02 11:13:42 +02:00
end
desc "Nuke Certs"
lane :nuke_certs do
setup_ci if ENV['CI']
ENV["MATCH_READONLY"] = false.to_s
app_store_connect_api_key(
key_id: "#{FASTLANE_KEY_ID}",
issuer_id: "#{FASTLANE_ISSUER_ID}",
key_content: "#{FASTLANE_KEY}"
)
match_nuke(
type: "appstore",
team_id: "#{TEAMID}",
skip_confirmation: true,
git_basic_authorization: Base64.strict_encode64("#{GITHUB_REPOSITORY_OWNER}:#{GH_PAT}")
)
end
end