diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index b61b4daec..58fe2ae5a 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,29 +1,26 @@ -# Nodes with values to reuse in the pipeline. -common_params: - # Common plugin settings to use with the `plugins` key. - - &common_plugins - - automattic/a8c-ci-toolkit#3.1.0 - # Common environment values to use with the `env` key. - - &common_env - IMAGE_ID: xcode-15.4 - # This is the default pipeline – it will build and test the app + +env: + IMAGE_ID: $IMAGE_ID + steps: - label: "🔬 Build and Test" command: .buildkite/commands/build-and-test.sh - env: *common_env - plugins: *common_plugins + plugins: [$CI_TOOLKIT_PLUGIN] + agents: + queue: mac - label: ":swift: SwiftLint" command: run_swiftlint --strict - plugins: *common_plugins + plugins: [$CI_TOOLKIT_PLUGIN] notify: - github_commit_status: context: "SwiftLint" agents: - queue: "default" + queue: default - label: "🛠 Verify App Store Target Builds" command: .buildkite/commands/build-and-test-app-store.sh - env: *common_env - plugins: *common_plugins + plugins: [$CI_TOOLKIT_PLUGIN] + agents: + queue: mac diff --git a/.buildkite/release-builds.yml b/.buildkite/release-builds.yml index d50740905..606a249c3 100644 --- a/.buildkite/release-builds.yml +++ b/.buildkite/release-builds.yml @@ -1,16 +1,9 @@ -# Nodes with values to reuse in the pipeline. -common_params: - # Common plugin settings to use with the `plugins` key. - - &common_plugins - - automattic/a8c-ci-toolkit#3.1.0 - # Common environment values to use with the `env` key. - - &common_env - IMAGE_ID: xcode-15.4 - -# This is the default pipeline – it will build and test the app steps: - label: "🛠 App Store Upload" command: .buildkite/commands/build-and-upload-release.sh priority: 1 - env: *common_env - plugins: *common_plugins + plugins: [$CI_TOOLKIT_PLUGIN] + agents: + queue: mac + env: + IMAGE_ID: $IMAGE_ID diff --git a/.buildkite/shared-pipeline-vars b/.buildkite/shared-pipeline-vars new file mode 100755 index 000000000..41b493b39 --- /dev/null +++ b/.buildkite/shared-pipeline-vars @@ -0,0 +1,11 @@ +#!/bin/sh + +# This file is `source`'d before calling `buildkite-agent pipeline upload`, and can be used +# to set up some variables that will be interpolated in the `.yml` pipeline before uploading it. + +# The ~> modifier is not currently used, but we check for it just in case +XCODE_VERSION=$(sed -E -n 's/^(~> )?(.*)/xcode-\2/p' .xcode-version) +CI_TOOLKIT_PLUGIN_VERSION="3.4.2" + +export IMAGE_ID="$XCODE_VERSION" +export CI_TOOLKIT_PLUGIN="automattic/a8c-ci-toolkit#$CI_TOOLKIT_PLUGIN_VERSION" diff --git a/.rubocop.yml b/.rubocop.yml index ad146a0a1..ebb4660e9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -12,6 +12,7 @@ Layout/LineLength: Metrics/BlockLength: Exclude: - fastlane/Fastfile + - fastlane/lanes/*.rb - Rakefile Style/HashSyntax: diff --git a/.xcode-version b/.xcode-version new file mode 100644 index 000000000..232a7fc1a --- /dev/null +++ b/.xcode-version @@ -0,0 +1 @@ +15.4 diff --git a/Gemfile b/Gemfile index d1704395d..a26be8d03 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source 'https://rubygems.org' gem 'cocoapods', '~> 1.14' gem 'danger-dangermattic', '~> 1.0' -gem 'fastlane', '~> 2.219' +gem 'fastlane', '~> 2.222' gem 'fastlane-plugin-appcenter', '~> 1.11' gem 'fastlane-plugin-sentry', '~> 1.14' gem 'fastlane-plugin-wpmreleasetoolkit', '~> 9.2' diff --git a/Gemfile.lock b/Gemfile.lock index 51f3644ac..138450405 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -24,20 +24,20 @@ GEM ast (2.4.2) atomos (0.1.3) aws-eventstream (1.3.0) - aws-partitions (1.940.0) - aws-sdk-core (3.197.0) + aws-partitions (1.958.0) + aws-sdk-core (3.201.3) aws-eventstream (~> 1, >= 1.3.0) aws-partitions (~> 1, >= 1.651.0) aws-sigv4 (~> 1.8) jmespath (~> 1, >= 1.6.1) - aws-sdk-kms (1.83.0) - aws-sdk-core (~> 3, >= 3.197.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.152.0) - aws-sdk-core (~> 3, >= 3.197.0) + aws-sdk-kms (1.88.0) + aws-sdk-core (~> 3, >= 3.201.0) + aws-sigv4 (~> 1.5) + aws-sdk-s3 (1.156.0) + aws-sdk-core (~> 3, >= 3.201.0) aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.8) - aws-sigv4 (1.8.0) + aws-sigv4 (~> 1.5) + aws-sigv4 (1.9.0) aws-eventstream (~> 1, >= 1.0.2) babosa (1.0.4) base64 (0.2.0) @@ -142,7 +142,7 @@ GEM escape (0.0.4) ethon (0.16.0) ffi (>= 1.15.0) - excon (0.110.0) + excon (0.111.0) faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) @@ -174,7 +174,7 @@ GEM faraday_middleware (1.2.0) faraday (~> 1.0) fastimage (2.3.1) - fastlane (2.220.0) + fastlane (2.222.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -294,7 +294,7 @@ GEM kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) language_server-protocol (3.17.0.3) - mini_magick (4.12.0) + mini_magick (4.13.2) mini_mime (1.1.5) mini_portile2 (2.8.7) minitest (5.23.1) @@ -408,7 +408,7 @@ PLATFORMS DEPENDENCIES cocoapods (~> 1.14) danger-dangermattic (~> 1.0) - fastlane (~> 2.219) + fastlane (~> 2.222) fastlane-plugin-appcenter (~> 1.11) fastlane-plugin-sentry (~> 1.14) fastlane-plugin-wpmreleasetoolkit (~> 9.2) diff --git a/Simplenote.xcodeproj/project.pbxproj b/Simplenote.xcodeproj/project.pbxproj index 5d14b9008..7757ef0dd 100644 --- a/Simplenote.xcodeproj/project.pbxproj +++ b/Simplenote.xcodeproj/project.pbxproj @@ -450,7 +450,9 @@ 37F742EA202A382400A47D3A /* AboutViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AboutViewController.swift; sourceTree = ""; }; 39ACEAE8218A03C6C22DC662 /* Pods-Automattic-Simplenote.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Automattic-Simplenote.release.xcconfig"; path = "Target Support Files/Pods-Automattic-Simplenote/Pods-Automattic-Simplenote.release.xcconfig"; sourceTree = ""; }; 3F1FC4212C0EBEF10066B187 /* Simplenote.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = Simplenote.xctestplan; sourceTree = ""; }; - 3F6C39912C33C11100776C37 /* Base.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Base.xcconfig; sourceTree = ""; }; + 3FD478252C5762250071B8B9 /* Project.Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Project.Release.xcconfig; path = config/Project.Release.xcconfig; sourceTree = ""; }; + 3FD478262C5762350071B8B9 /* Project.Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Project.Debug.xcconfig; path = config/Project.Debug.xcconfig; sourceTree = ""; }; + 3FD478272C5762400071B8B9 /* Project.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Project.xcconfig; path = config/Project.xcconfig; sourceTree = ""; }; 466FFF2F17CC10A800399652 /* Simplenote.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Simplenote.app; sourceTree = BUILT_PRODUCTS_DIR; }; 469512CB17CD23100014A2BF /* Simplenote-Info-Hockey.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "Simplenote-Info-Hockey.plist"; sourceTree = ""; }; 46A0BEB8175BFD540050E864 /* Simplenote.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Simplenote.entitlements; sourceTree = SOURCE_ROOT; }; @@ -1134,7 +1136,9 @@ 8C902F8C22D3EE350018D654 /* Version.public.xcconfig */, 8C902F8722D3ED910018D654 /* Simplenote.release.xcconfig */, 8C902F8E22D3EFE60018D654 /* Simplenote.debug.xcconfig */, - 3F6C39912C33C11100776C37 /* Base.xcconfig */, + 3FD478252C5762250071B8B9 /* Project.Release.xcconfig */, + 3FD478262C5762350071B8B9 /* Project.Debug.xcconfig */, + 3FD478272C5762400071B8B9 /* Project.xcconfig */, ); name = config; sourceTree = ""; @@ -2573,7 +2577,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-Beta"; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Simplenote/SimplenoteDebug.entitlements; - CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -2606,8 +2609,8 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.automattic.SimplenoteMac.Development; PRODUCT_NAME = Simplenote; - PROVISIONING_PROFILE = ""; - PROVISIONING_PROFILE_SPECIFIER = "Simplenote Mac - Development"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "Simplenote Mac - Development"; SDKROOT = macosx; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; @@ -2624,7 +2627,6 @@ ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Simplenote.entitlements; - CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; DEAD_CODE_STRIPPING = YES; FRAMEWORK_SEARCH_PATHS = ( @@ -2655,9 +2657,6 @@ ); PRODUCT_BUNDLE_IDENTIFIER = com.automattic.SimplenoteMac; PRODUCT_NAME = Simplenote; - PROVISIONING_PROFILE = ""; - "PROVISIONING_PROFILE[sdk=macosx*]" = ""; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.automattic.SimplenoteMac macos"; SDKROOT = macosx; SWIFT_VERSION = 5.0; WRAPPER_EXTENSION = app; @@ -2667,7 +2666,6 @@ B52D0EC6230DCAD7003F799D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_STYLE = Manual; DEAD_CODE_STRIPPING = YES; MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2677,7 +2675,6 @@ B52D0EC7230DCAD7003F799D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - CODE_SIGN_STYLE = Manual; DEAD_CODE_STRIPPING = YES; MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -2700,12 +2697,9 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = PZYM8XX95Q; - "DEVELOPMENT_TEAM[sdk=macosx*]" = PZYM8XX95Q; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; @@ -2744,12 +2738,9 @@ CLANG_WARN_DOCUMENTATION_COMMENTS = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; DEAD_CODE_STRIPPING = YES; - DEVELOPMENT_TEAM = PZYM8XX95Q; - "DEVELOPMENT_TEAM[sdk=macosx*]" = PZYM8XX95Q; ENABLE_NS_ASSERTIONS = NO; GCC_C_LANGUAGE_STANDARD = gnu11; GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; @@ -2859,7 +2850,6 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.automattic.SimplenoteMac.IntentsExtension; PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = "match AppStore com.automattic.SimplenoteMac.IntentsExtension macos"; SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = APP_EXTENSION; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/config/Project.Debug.xcconfig b/config/Project.Debug.xcconfig new file mode 100644 index 000000000..bb17621fb --- /dev/null +++ b/config/Project.Debug.xcconfig @@ -0,0 +1,3 @@ +#include "Project.xcconfig" + +CODE_SIGN_IDENTITY = Apple Development diff --git a/config/Project.Release.xcconfig b/config/Project.Release.xcconfig new file mode 100644 index 000000000..5759879de --- /dev/null +++ b/config/Project.Release.xcconfig @@ -0,0 +1,6 @@ +#include "Project.xcconfig" + +// Each target using this will interpolate its own computed value for the bundle id +PROVISIONING_PROFILE_SPECIFIER = match AppStore $(PRODUCT_BUNDLE_IDENTIFIER) macos + +CODE_SIGN_IDENTITY = Apple Distribution: Automattic, Inc. (PZYM8XX95Q) diff --git a/Base.xcconfig b/config/Project.xcconfig similarity index 60% rename from Base.xcconfig rename to config/Project.xcconfig index c6e1326f3..ec91f6440 100644 --- a/Base.xcconfig +++ b/config/Project.xcconfig @@ -1,4 +1,2 @@ -#include "Version.public.xcconfig" - -CODE_SIGN_STYLE = Manual DEVELOPMENT_TEAM = PZYM8XX95Q +CODE_SIGN_STYLE = Manual diff --git a/config/Simplenote.debug.xcconfig b/config/Simplenote.debug.xcconfig index f6c364f6f..46ca7e4f7 100644 --- a/config/Simplenote.debug.xcconfig +++ b/config/Simplenote.debug.xcconfig @@ -1,6 +1,5 @@ #include "Base.xcconfig" +#include "Project.Debug.xcconfig" +#include "Version.public.xcconfig" CODE_SIGN_IDENTITY = Apple Development - -// Notice we don't have a PROVISIONING_PROFILE_SPECIFIER defined here because this xcconfig is used at the project-level but that settings need to be target-level. -// Once we'll have target-level xcconfigs, we shall add the setting there diff --git a/config/Simplenote.release.xcconfig b/config/Simplenote.release.xcconfig index aea1d7bf6..68ae2eef9 100644 --- a/config/Simplenote.release.xcconfig +++ b/config/Simplenote.release.xcconfig @@ -1,6 +1,5 @@ #include "Base.xcconfig" +#include "Project.Release.xcconfig" +#include "Version.public.xcconfig" CODE_SIGN_IDENTITY = Apple Distribution - -// Notice we don't have a PROVISIONING_PROFILE_SPECIFIER defined here because this xcconfig is used at the project-level but that settings need to be target-level. -// Once we'll have target-level xcconfigs, we shall add the setting there diff --git a/config/Version.public.xcconfig b/config/Version.public.xcconfig index 1464122ef..5553965b1 100644 --- a/config/Version.public.xcconfig +++ b/config/Version.public.xcconfig @@ -1,9 +1,9 @@ -VERSION_SHORT=2.20 +VERSION_SHORT=2.21 // Public long version. Example: 2.0.0.0. The last 0 means the first build for // version 2.0.0 -VERSION_LONG=2.20.0.4 +VERSION_LONG=2.21.0.0 // This is the value for the CFBundleVersion it should be incremented on every // build that gets distributed -BUILD_NUMBER=11258 +BUILD_NUMBER=11259 diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 67c4c2436..5d780e1f9 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -12,7 +12,7 @@ PROJECT_FOLDER = Pathname.new(File.join(Dir.pwd, '..')).expand_path.to_s WORKSPACE = 'Simplenote.xcworkspace' INTERNAL_SCHEME = 'Simplenote' APP_STORE_SCHEME = 'Simplenote' -BUILD_FOLDER = 'build' +BUILD_FOLDER = File.join(PROJECT_FOLDER, 'build') APP_STORE_BUNDLE_IDENTIFIER = 'com.automattic.SimplenoteMac' APP_STORE_BUNDLE_IDENTIFIER_INTENTS = "#{APP_STORE_BUNDLE_IDENTIFIER}.IntentsExtension".freeze VERSION_FILE_PATH = File.join(PROJECT_FOLDER, 'config', 'Version.Public.xcconfig') @@ -47,6 +47,8 @@ SKIP_CODE_SIGNING_XCARGS = { CODE_SIGNING_REQUIRED: 'NO' }.freeze +import 'lanes/build.rb' + before_all do # Ensure we use the latest version of the Release Toolkit check_for_toolkit_updates unless is_ci || ENV['FASTLANE_SKIP_TOOLKIT_UPDATE_CHECK'] @@ -84,7 +86,14 @@ def build_simplenote(codesign:, archive_path: nil) export_team_id: APPLE_TEAM_ID, xcargs: xcargs, export_options: { - method: 'app-store', + # Using 'app-store' (or 'app-store-connect' if/when https://github.com/fastlane/fastlane/pull/22163 lands) + # results `xcodebuild` failing to export the archive due to provisioning profile mismatches. + # + # Also worth asking: Do we need to export the archive (.app) when what needs to go to App Store Connect is the .pkg file which build_mac_app generates anyway? + # + # Note to self: 'package' will not work as method, xcodebuild will reject it. + # I was hoping it solved the issue of how to build the pkg... + method: 'mac-application', manageAppVersionAndBuildNumber: false } ) @@ -140,7 +149,7 @@ lane :code_freeze do |options| from_branch: DEFAULT_BRANCH, to_branch: "release/#{new_version}" ) - setfrozentag( + set_milestone_frozen_marker( repository: GITHUB_REPO, milestone: new_version ) @@ -375,61 +384,6 @@ lane :upload_app_to_appcenter do |options| end end -############################################################################# -# build_and_upload_app_store -# --------------------------------------------------------------------------- -# This lane builds the app and uploads it to the Mac App Store, optionally -# creating a GitHub release. -# --------------------------------------------------------------------------- -# Usage: -# bundle exec fastlane build_and_upload_app_store [create_github_release:] -# -# Example: -# bundle exec fastlane build_and_upload_app_store -# bundle exec fastlane build_and_upload_app_store create_github_release:true -############################################################################# -lane :build_and_upload_app_store do |options| - configure_apply - sh('rake dependencies:pod:clean') - cocoapods - - setup_ci - - app_store_code_signing - - archive_path = File.join(BUILD_FOLDER, 'Simplenote-Mac.xcarchive') - build_simplenote( - codesign: true, - archive_path: archive_path - ) - - sentry_upload_dsym( - auth_token: get_required_env('SENTRY_AUTH_TOKEN'), - org_slug: 'a8c', - project_slug: 'simplenotemacos', - # At the time of writing, there's no way to explicitly configure the - # dSYM path, but build_mac_app sets it in the environment if successful. - # See `bundle exec fastlane action build_mac_app`. - dsym_path: ENV.fetch('DSYM_OUTPUT_PATH', nil) - ) - - # Do not create the GitHub release unless explicitly requested - if options[:create_github_release] - archive_zip_path = "#{archive_path}.zip" - zip(path: archive_path, output_path: archive_zip_path) - - create_release( - repository: GITHUB_REPO, - version: ios_get_app_version(public_version_xcconfig_file: VERSION_FILE_PATH), - release_notes_file_path: 'Simplenote/Resources/release_notes.txt', - release_assets: [archive_zip_path], - prerelease: options[:prerelease] - ) - end - - upload_to_testflight(api_key: app_store_connect_api_key) -end - ############################################################################# # trigger_release_build # --------------------------------------------------------------------------- @@ -503,7 +457,7 @@ end # Optionally, it can create any new necessary certificates or profiles. # # @option [Boolean] readonly (default: true) Whether to only fetch existing certificates and profiles, without generating new ones. -lane :app_store_code_signing do |options| +lane :app_store_code_signing do |readonly: true| # Fail early if secrets not available via `get_required_env`. # Otherwise, Fastlane will prompt to type them. access_key = get_required_env('MATCH_S3_ACCESS_KEY') @@ -520,7 +474,7 @@ lane :app_store_code_signing do |options| platform: 'macos', # This Mac app also needs a Mac Installer Distribution certificate additional_cert_types: 'mac_installer_distribution', - readonly: options.fetch(:readonly, true), + readonly: readonly, app_identifier: [ APP_STORE_BUNDLE_IDENTIFIER, APP_STORE_BUNDLE_IDENTIFIER_INTENTS diff --git a/fastlane/lanes/build.rb b/fastlane/lanes/build.rb new file mode 100644 index 000000000..4255343f5 --- /dev/null +++ b/fastlane/lanes/build.rb @@ -0,0 +1,52 @@ +# frozen_string_literal: true + +platform :mac do + lane :build_and_upload_app_store do |options| + # configure_apply + # sh('rake dependencies:pod:clean') + # cocoapods + + # setup_ci + + # app_store_code_signing + + archive_path = File.join(BUILD_FOLDER, 'Simplenote-Mac.xcarchive') + build_simplenote( + codesign: true, + archive_path: archive_path + ) + + # sentry_upload_dsym( + # auth_token: get_required_env('SENTRY_AUTH_TOKEN'), + # org_slug: 'a8c', + # project_slug: 'simplenotemacos', + # # At the time of writing, there's no way to explicitly configure the + # # dSYM path, but build_mac_app sets it in the environment if successful. + # # See `bundle exec fastlane action build_mac_app`. + # dsym_path: ENV.fetch('DSYM_OUTPUT_PATH', nil) + # ) + + # # Do not create the GitHub release unless explicitly requested + # if options[:create_github_release] + # archive_zip_path = "#{archive_path}.zip" + # zip(path: archive_path, output_path: archive_zip_path) + + # create_release( + # repository: GITHUB_REPO, + # version: ios_get_app_version(public_version_xcconfig_file: VERSION_FILE_PATH), + # release_notes_file_path: 'Simplenote/Resources/release_notes.txt', + # release_assets: [archive_zip_path], + # prerelease: options[:prerelease] + # ) + # end + + UI.message('Generating pkg via productbuild because gym does not do it for us...') + pkg_path = File.join(BUILD_FOLDER, 'Simplenote.pkg') + sh("productbuild --component '#{File.join(BUILD_FOLDER, 'Simplenote.app')}' '#{pkg_path}'") + + upload_to_testflight( + pkg: pkg_path, + api_key: app_store_connect_api_key + ) + end +end