From 4a1631040fcfb683337c4b7ec8c05b6de88a6d93 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Mon, 24 Jan 2022 15:04:30 -0800 Subject: [PATCH 01/12] fastlane setup --- Gemfile | 3 + Gemfile.lock | 218 ++++++++++++++++++++++++++++++++++++++++++++++ fastlane/Appfile | 6 ++ fastlane/Fastfile | 23 +++++ 4 files changed, 250 insertions(+) create mode 100644 Gemfile create mode 100644 Gemfile.lock create mode 100644 fastlane/Appfile create mode 100644 fastlane/Fastfile diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000..7a118b4 --- /dev/null +++ b/Gemfile @@ -0,0 +1,3 @@ +source "https://rubygems.org" + +gem "fastlane" diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..6d9ba03 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,218 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.5) + rexml + addressable (2.8.0) + public_suffix (>= 2.0.2, < 5.0) + artifactory (3.0.15) + atomos (0.1.3) + aws-eventstream (1.2.0) + aws-partitions (1.549.0) + aws-sdk-core (3.125.5) + aws-eventstream (~> 1, >= 1.0.2) + aws-partitions (~> 1, >= 1.525.0) + aws-sigv4 (~> 1.1) + jmespath (~> 1.0) + aws-sdk-kms (1.53.0) + aws-sdk-core (~> 3, >= 3.125.0) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.111.3) + aws-sdk-core (~> 3, >= 3.125.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.4) + aws-sigv4 (1.4.0) + aws-eventstream (~> 1, >= 1.0.2) + babosa (1.0.4) + claide (1.1.0) + colored (1.2) + colored2 (3.1.2) + commander (4.6.0) + highline (~> 2.0.0) + declarative (0.0.20) + digest-crc (0.6.4) + rake (>= 12.0.0, < 14.0.0) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) + dotenv (2.7.6) + emoji_regex (3.2.3) + excon (0.90.0) + faraday (1.9.3) + faraday-em_http (~> 1.0) + faraday-em_synchrony (~> 1.0) + faraday-excon (~> 1.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) + faraday-net_http (~> 1.0) + faraday-net_http_persistent (~> 1.0) + faraday-patron (~> 1.0) + faraday-rack (~> 1.0) + faraday-retry (~> 1.0) + ruby2_keywords (>= 0.0.4) + faraday-cookie_jar (0.0.7) + faraday (>= 0.8.0) + http-cookie (~> 1.0.0) + faraday-em_http (1.0.0) + faraday-em_synchrony (1.0.0) + faraday-excon (1.1.0) + faraday-httpclient (1.0.1) + faraday-multipart (1.0.3) + multipart-post (>= 1.2, < 3) + faraday-net_http (1.0.1) + faraday-net_http_persistent (1.2.0) + faraday-patron (1.0.0) + faraday-rack (1.0.0) + faraday-retry (1.0.3) + faraday_middleware (1.2.0) + faraday (~> 1.0) + fastimage (2.2.6) + fastlane (2.201.1) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.8, < 3.0.0) + artifactory (~> 3.0) + aws-sdk-s3 (~> 1.0) + babosa (>= 1.0.3, < 2.0.0) + bundler (>= 1.12.0, < 3.0.0) + colored + commander (~> 4.6) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (>= 0.1, < 4.0) + excon (>= 0.71.0, < 1.0.0) + faraday (~> 1.0) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 1.0) + fastimage (>= 2.1.0, < 3.0.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-apis-androidpublisher_v3 (~> 0.3) + google-apis-playcustomapp_v1 (~> 0.1) + google-cloud-storage (~> 1.31) + highline (~> 2.0) + json (< 3.0.0) + jwt (>= 2.1.0, < 3) + mini_magick (>= 4.9.4, < 5.0.0) + multipart-post (~> 2.0.0) + naturally (~> 2.2) + optparse (~> 0.1.1) + plist (>= 3.1.0, < 4.0.0) + rubyzip (>= 2.0.0, < 3.0.0) + security (= 0.1.3) + simctl (~> 1.6.3) + terminal-notifier (>= 2.0.0, < 3.0.0) + terminal-table (>= 1.4.5, < 2.0.0) + tty-screen (>= 0.6.3, < 1.0.0) + tty-spinner (>= 0.8.0, < 1.0.0) + word_wrap (~> 1.0.0) + xcodeproj (>= 1.13.0, < 2.0.0) + xcpretty (~> 0.3.0) + xcpretty-travis-formatter (>= 0.0.3) + gh_inspector (1.1.3) + google-apis-androidpublisher_v3 (0.15.0) + google-apis-core (>= 0.4, < 2.a) + google-apis-core (0.4.2) + addressable (~> 2.5, >= 2.5.1) + googleauth (>= 0.16.2, < 2.a) + httpclient (>= 2.8.1, < 3.a) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.a) + rexml + webrick + google-apis-iamcredentials_v1 (0.10.0) + google-apis-core (>= 0.4, < 2.a) + google-apis-playcustomapp_v1 (0.7.0) + google-apis-core (>= 0.4, < 2.a) + google-apis-storage_v1 (0.11.0) + google-apis-core (>= 0.4, < 2.a) + google-cloud-core (1.6.0) + google-cloud-env (~> 1.0) + google-cloud-errors (~> 1.0) + google-cloud-env (1.5.0) + faraday (>= 0.17.3, < 2.0) + google-cloud-errors (1.2.0) + google-cloud-storage (1.36.0) + addressable (~> 2.8) + digest-crc (~> 0.4) + google-apis-iamcredentials_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.1) + google-cloud-core (~> 1.6) + googleauth (>= 0.16.2, < 2.a) + mini_mime (~> 1.0) + googleauth (1.1.0) + faraday (>= 0.17.3, < 2.0) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (>= 0.16, < 2.a) + highline (2.0.3) + http-cookie (1.0.4) + domain_name (~> 0.5) + httpclient (2.8.3) + jmespath (1.5.0) + json (2.6.1) + jwt (2.3.0) + memoist (0.16.2) + mini_magick (4.11.0) + mini_mime (1.1.2) + multi_json (1.15.0) + multipart-post (2.0.0) + nanaimo (0.3.0) + naturally (2.2.1) + optparse (0.1.1) + os (1.1.4) + plist (3.6.0) + public_suffix (4.0.6) + rake (13.0.6) + representable (3.1.1) + declarative (< 0.1.0) + trailblazer-option (>= 0.1.1, < 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rexml (3.2.5) + rouge (2.0.7) + ruby2_keywords (0.0.5) + rubyzip (2.3.2) + security (0.1.3) + signet (0.16.0) + addressable (~> 2.8) + faraday (>= 0.17.3, < 2.0) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.8) + CFPropertyList + naturally + terminal-notifier (2.0.0) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + trailblazer-option (0.1.2) + tty-cursor (0.7.1) + tty-screen (0.8.1) + tty-spinner (0.9.3) + tty-cursor (~> 0.7) + uber (0.1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.8) + unicode-display_width (1.8.0) + webrick (1.7.0) + word_wrap (1.0.0) + xcodeproj (1.21.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.3.0) + rexml (~> 3.2.4) + xcpretty (0.3.0) + rouge (~> 2.0.7) + xcpretty-travis-formatter (1.0.1) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + x86_64-darwin-20 + +DEPENDENCIES + fastlane + +BUNDLED WITH + 2.2.32 diff --git a/fastlane/Appfile b/fastlane/Appfile new file mode 100644 index 0000000..1803063 --- /dev/null +++ b/fastlane/Appfile @@ -0,0 +1,6 @@ +# app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app +# apple_id("[[APPLE_ID]]") # Your Apple email address + + +# For more information about the Appfile, see: +# https://docs.fastlane.tools/advanced/#appfile diff --git a/fastlane/Fastfile b/fastlane/Fastfile new file mode 100644 index 0000000..0f39ea6 --- /dev/null +++ b/fastlane/Fastfile @@ -0,0 +1,23 @@ +# 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 +# + +# Uncomment the line if you want fastlane to automatically update itself +# update_fastlane + +default_platform(:ios) + +platform :ios do + desc "Description of what the lane does" + lane :custom_lane do + # add actions here: https://docs.fastlane.tools/actions + end +end From 53d51df4c57f314ddb18c660a87fbea02657d6ef Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Mon, 24 Jan 2022 15:12:48 -0800 Subject: [PATCH 02/12] customize Fastlane setup output --- fastlane/Appfile | 9 +++------ fastlane/Fastfile | 14 +++++++------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/fastlane/Appfile b/fastlane/Appfile index 1803063..72de007 100644 --- a/fastlane/Appfile +++ b/fastlane/Appfile @@ -1,6 +1,3 @@ -# app_identifier("[[APP_IDENTIFIER]]") # The bundle identifier of your app -# apple_id("[[APPLE_ID]]") # Your Apple email address - - -# For more information about the Appfile, see: -# https://docs.fastlane.tools/advanced/#appfile +app_identifier "edu.mit.scratch.scratch-desktop" # The bundle identifier of your app +apple_id "bot-apple@scratch.mit.edu" # Your Apple email address +team_id "W7AR3WMP87" diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 0f39ea6..2e805ed 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -13,11 +13,11 @@ # Uncomment the line if you want fastlane to automatically update itself # update_fastlane -default_platform(:ios) +default_platform(:mac) -platform :ios do - desc "Description of what the lane does" - lane :custom_lane do - # add actions here: https://docs.fastlane.tools/actions - end -end +#platform :mac do +# desc "Description of what the lane does" +# lane :custom_lane do +# # add actions here: https://docs.fastlane.tools/actions +# end +#end From ef8d47920b9d82e4a900cb7adc52a57be06e2324 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Tue, 25 Jan 2022 09:55:27 -0800 Subject: [PATCH 03/12] add match actions to Fastfile --- .gitignore | 7 +++++++ fastlane/Fastfile | 18 ++++++++++++------ fastlane/README-match.md | 31 +++++++++++++++++++++++++++++++ fastlane/README.md | 40 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+), 6 deletions(-) create mode 100644 fastlane/README-match.md create mode 100644 fastlane/README.md diff --git a/.gitignore b/.gitignore index e248d68..b9e2be3 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,10 @@ npm-* # generated translation files /translations /locale + +# Fastlane +**/fastlane/Matchfile +**/fastlane/report.xml +**/fastlane/Preview.html +**/fastlane/screenshots +**/fastlane/test_output diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 2e805ed..e82ddd6 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -15,9 +15,15 @@ default_platform(:mac) -#platform :mac do -# desc "Description of what the lane does" -# lane :custom_lane do -# # add actions here: https://docs.fastlane.tools/actions -# end -#end +platform :mac do + desc "Use Fastlane Match to install development certificates" + lane :match_dev do + match(type: "development", platform: "macos") + end + + desc "Use Fastlane Match to install distribution certificates" + lane :match_dist do + match(type: "appstore", platform: "macos") + match(type: "developer_id", platform: "macos", additional_cert_types: "developer_id_installer") + end +end diff --git a/fastlane/README-match.md b/fastlane/README-match.md new file mode 100644 index 0000000..848a909 --- /dev/null +++ b/fastlane/README-match.md @@ -0,0 +1,31 @@ +# Fastlane Match setup + +## You might not need to do this! + +If you don't plan to build this application, you don't need Fastlane Match. + +If you don't plan to build this application for macOS, you don't need Fastlane Match. + +If you plan to only run your builds locally for your own debug purposes, you don't need Fastlane Match. + +If you don't have access to a Fastlane Match storage repository or bucket, you don't need Fastlane Match. + +## Initial Configuration + +The `Matchfile` containing settings for Fastlane Match includes private information about our storage, so it's set to be ignored by `git`. + +This means that you'll need to initialize Fastlane Match yourself when you clone this repository in a new place. + +To initialize Fastlane Match: + +1. Enter this repository's base directory (not the `fastlane` subdirectory) +2. Run `fastlane match init` and answer the questions + +...yep, that's it. + +## Obtaining & Updating Certs + +1. If you plan to make and internally share development builds for testing purposes, run: + * `fastlane match_dev` +2. If you plan to make builds for release, run: + * `fastlane match_dist` diff --git a/fastlane/README.md b/fastlane/README.md new file mode 100644 index 0000000..4ed97f4 --- /dev/null +++ b/fastlane/README.md @@ -0,0 +1,40 @@ +fastlane documentation +---- + +# Installation + +Make sure you have the latest version of the Xcode command line tools installed: + +```sh +xcode-select --install +``` + +For _fastlane_ installation instructions, see [Installing _fastlane_](https://docs.fastlane.tools/#installing-fastlane) + +# Available Actions + +## Mac + +### mac match_dev + +```sh +[bundle exec] fastlane mac match_dev +``` + +Use Fastlane Match to install development certificates + +### mac match_dist + +```sh +[bundle exec] fastlane mac match_dist +``` + +Use Fastlane Match to install distribution certificates + +---- + +This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. + +More information about _fastlane_ can be found on [fastlane.tools](https://fastlane.tools). + +The documentation of _fastlane_ can be found on [docs.fastlane.tools](https://docs.fastlane.tools). From 3a95c0c2137ecca044b822fc93d2314fe4230e9d Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Tue, 25 Jan 2022 13:13:53 -0800 Subject: [PATCH 04/12] CircleCI no longer supports Xcode 11.1.0 --- .circleci/config.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6befc9a..3cfa54f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,10 +29,9 @@ aliases: jobs: build_for_macos: macos: - # CircleCI's Xcode 11.1.0 image is the last of their images to be based on macOS 10.14 - # I've had trouble building for earlier versions of macOS on Catalina but it's unclear whether that was due to - # Catalina or the version of Xcode. We should investigate this further. - xcode: 11.1.0 + # CircleCI's Xcode 12.4.0 image is the last of their images to be based on macOS 10.15 + # CircleCI no longer supports Xcode 11+ on macOS 10.14 + xcode: 12.4.0 steps: - checkout - npm_install: @@ -90,9 +89,6 @@ jobs: git -C ~/app-builder checkout b85740334fec875f5dd8dcd22eb1f729599109db make --directory=~/app-builder build ln -sfv ~/app-builder/dist/app-builder_darwin_amd64/app-builder ./node_modules/app-builder-bin/mac/ - - run: - name: Upgrade to Node 14 - command: brew install node@14 - save_cache: name: Save Homebrew cache paths: From c0355803c75ac615b4eaa578a8068ac9be6adf41 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Tue, 25 Jan 2022 13:49:39 -0800 Subject: [PATCH 05/12] use Fastlane Match in CI --- .circleci/config.yml | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3cfa54f..7194fd7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -47,33 +47,8 @@ jobs: name: Import CI context command: | set -e - function decodeToFile () { - if [ -z "$1" ]; then - echo "Missing or invalid filename" - return 1 - fi - if [ -z "$2" ]; then - echo "Missing environment variable contents for file: $1" - return 2 - fi - echo "$2" | base64 --decode > "$1" - } - decodeToFile embedded.provisionprofile "${MAC_PROVISION_PROFILE}" - decodeToFile mas-dev.provisionprofile "${MAC_DEV_PROVISION_PROFILE}" - decodeToFile macos-certs-scratch-foundation.p12.gz "${CSC_MACOS_GZ}" - decodeToFile apple-dev-cert.p12 "${MAC_DEV_CERT}" - gunzip macos-certs-scratch-foundation.p12.gz - security -v create-keychain -p circleci circleci.keychain - security -v default-keychain -s circleci.keychain - security -v import macos-certs-scratch-foundation.p12 -k circleci.keychain -P "${CSC_MACOS_PASSWORD}" -T /usr/bin/codesign -T /usr/bin/productbuild - security -v import apple-dev-cert.p12 -k circleci.keychain -P "${MAC_DEV_CERT_PASSWORD}" -T /usr/bin/codesign -T /usr/bin/productbuild - security -v unlock-keychain -p circleci circleci.keychain - # "set-key-partition-list" prints extensive not-so-useful output and adding "-q" (even multiple times) doesn't suppress it. - # The "grep -v" at the end of this line suppresses all of that so any errors or warnings might be more visible. - security -v set-key-partition-list -S apple-tool:,apple:,codesign: -s -k circleci circleci.keychain | grep -v '^ 0x' - security -v set-keychain-settings -lut 600 circleci.keychain - security -v find-identity circleci.keychain - rm macos-certs-scratch-foundation.p12 apple-dev-cert.p12 + fastlane match_dev + fastlane match_dist - restore_cache: # Caching Homebrew's files (see the save_cache step below) means that Homebrew doesn't have to update as # much. The Homebrew update can take several minutes without this, but with the cache it tends to take less From 19e82b19294fbc9ef4b0081785110c50fc9da7c6 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Tue, 25 Jan 2022 13:52:05 -0800 Subject: [PATCH 06/12] use Fastlane Match in readonly mode on CI --- fastlane/Fastfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index e82ddd6..daa0d47 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -18,12 +18,12 @@ default_platform(:mac) platform :mac do desc "Use Fastlane Match to install development certificates" lane :match_dev do - match(type: "development", platform: "macos") + match(type: "development", platform: "macos", readonly: is_ci) end desc "Use Fastlane Match to install distribution certificates" lane :match_dist do - match(type: "appstore", platform: "macos") - match(type: "developer_id", platform: "macos", additional_cert_types: "developer_id_installer") + match(type: "appstore", platform: "macos", readonly: is_ci) + match(type: "developer_id", platform: "macos", readonly: is_ci, additional_cert_types: "developer_id_installer") end end From b5d99710bc00b7528e221ada605af13b6e266884 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Wed, 26 Jan 2022 10:07:14 -0800 Subject: [PATCH 07/12] add 'add_ssh_keys' step when signing --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7194fd7..550e9cb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -43,6 +43,7 @@ jobs: condition: *should_sign steps: + - add_ssh_keys - run: name: Import CI context command: | From 8e562edc255a8b01ebc63affcbd98a96de6fb03d Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Wed, 26 Jan 2022 11:17:11 -0800 Subject: [PATCH 08/12] use provisionprofiles from Fastlane Match --- electron-builder.yaml | 4 ++-- fastlane/Fastfile | 6 +++--- scripts/electron-builder-wrapper.js | 5 +++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/electron-builder.yaml b/electron-builder.yaml index 1197423..7daa58d 100644 --- a/electron-builder.yaml +++ b/electron-builder.yaml @@ -15,7 +15,7 @@ mac: gatekeeperAssess: true hardenedRuntime: true icon: buildResources/ScratchDesktop.icns - provisioningProfile: embedded.provisionprofile + provisioningProfile: build/AppStore_edu.mit.scratch.scratch-desktop.provisionprofile artifactName: "Scratch ${version}.${ext}" target: - dmg @@ -30,7 +30,7 @@ mas: icon: buildResources/ScratchDesktop.icns masDev: type: development - provisioningProfile: mas-dev.provisionprofile + provisioningProfile: build/Development_edu.mit.scratch.scratch-desktop.provisionprofile win: icon: buildResources/ScratchDesktop.ico target: diff --git a/fastlane/Fastfile b/fastlane/Fastfile index daa0d47..5c7cbaa 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -18,12 +18,12 @@ default_platform(:mac) platform :mac do desc "Use Fastlane Match to install development certificates" lane :match_dev do - match(type: "development", platform: "macos", readonly: is_ci) + match(type: "development", platform: "macos", output_path: "build", readonly: is_ci) end desc "Use Fastlane Match to install distribution certificates" lane :match_dist do - match(type: "appstore", platform: "macos", readonly: is_ci) - match(type: "developer_id", platform: "macos", readonly: is_ci, additional_cert_types: "developer_id_installer") + match(type: "appstore", platform: "macos", output_path: "build", readonly: is_ci) + match(type: "developer_id", platform: "macos", output_path: "build", readonly: is_ci, additional_cert_types: "developer_id_installer") end end diff --git a/scripts/electron-builder-wrapper.js b/scripts/electron-builder-wrapper.js index 9d4f615..303a374 100644 --- a/scripts/electron-builder-wrapper.js +++ b/scripts/electron-builder-wrapper.js @@ -9,6 +9,8 @@ const {spawnSync} = require('child_process'); const fs = require('fs'); +const masDevProfile = 'build/Development_edu.mit.scratch.scratch-desktop.provisionprofile'; + /** * Strip any code signing configuration (CSC) from a set of environment variables. * @param {object} environment - a collection of environment variables which might include code signing configuration. @@ -58,7 +60,7 @@ const runBuilder = function (wrapperConfig, target) { if (target.platform === 'darwin') { allArgs.push(`--c.mac.type=${wrapperConfig.mode === 'dist' ? 'distribution' : 'development'}`); if (target.name === 'mas-dev') { - allArgs.push('--c.mac.provisioningProfile=mas-dev.provisionprofile'); + allArgs.push(`--c.mac.provisioningProfile=${masDevProfile}`); } if (wrapperConfig.doSign) { // really this is "notarize only if we also sign" @@ -95,7 +97,6 @@ const runBuilder = function (wrapperConfig, target) { * same time but doing so limits has unwanted side effects on both macOS and Windows (see function body). */ const calculateTargets = function (wrapperConfig) { - const masDevProfile = 'mas-dev.provisionprofile'; const availableTargets = { macAppStore: { name: 'mas', From 8f094f37f16a6a632f6437c6954c6861cc17c53d Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Wed, 26 Jan 2022 17:42:28 -0800 Subject: [PATCH 09/12] add setup_circle_ci to Fastfile --- fastlane/Fastfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 5c7cbaa..d1f58a0 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -16,6 +16,10 @@ default_platform(:mac) platform :mac do + before_all do + setup_circle_ci + end + desc "Use Fastlane Match to install development certificates" lane :match_dev do match(type: "development", platform: "macos", output_path: "build", readonly: is_ci) From 123e8ed2ca968a64f0dc14d8041a3f195b865a3c Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Wed, 26 Jan 2022 18:47:28 -0800 Subject: [PATCH 10/12] add mac_installer_distribution --- fastlane/Fastfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index d1f58a0..7bb2c42 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -27,7 +27,7 @@ platform :mac do desc "Use Fastlane Match to install distribution certificates" lane :match_dist do - match(type: "appstore", platform: "macos", output_path: "build", readonly: is_ci) + match(type: "appstore", platform: "macos", output_path: "build", readonly: is_ci, additional_cert_types: "mac_installer_distribution") match(type: "developer_id", platform: "macos", output_path: "build", readonly: is_ci, additional_cert_types: "developer_id_installer") end end From cd92252520682884b2534af2235e7971cd641e57 Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Thu, 27 Jan 2022 09:33:48 -0800 Subject: [PATCH 11/12] make a lane specifically for CircleCI --- .circleci/config.yml | 3 +-- fastlane/Fastfile | 11 +++++++---- fastlane/README.md | 8 ++++++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 550e9cb..51f787e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,8 +48,7 @@ jobs: name: Import CI context command: | set -e - fastlane match_dev - fastlane match_dist + fastlane circleci - restore_cache: # Caching Homebrew's files (see the save_cache step below) means that Homebrew doesn't have to update as # much. The Homebrew update can take several minutes without this, but with the cache it tends to take less diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 7bb2c42..b9bb030 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -16,10 +16,6 @@ default_platform(:mac) platform :mac do - before_all do - setup_circle_ci - end - desc "Use Fastlane Match to install development certificates" lane :match_dev do match(type: "development", platform: "macos", output_path: "build", readonly: is_ci) @@ -30,4 +26,11 @@ platform :mac do match(type: "appstore", platform: "macos", output_path: "build", readonly: is_ci, additional_cert_types: "mac_installer_distribution") match(type: "developer_id", platform: "macos", output_path: "build", readonly: is_ci, additional_cert_types: "developer_id_installer") end + + desc "Prepare for a CircleCI signed build" + lane :circleci do + setup_circle_ci + match_dev + match_dist + end end diff --git a/fastlane/README.md b/fastlane/README.md index 4ed97f4..960c06c 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -31,6 +31,14 @@ Use Fastlane Match to install development certificates Use Fastlane Match to install distribution certificates +### mac circleci + +```sh +[bundle exec] fastlane mac circleci +``` + +Prepare for a CircleCI signed build + ---- This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run. From e180d88c13928eb7fcd0fe4444052fe66daf2fee Mon Sep 17 00:00:00 2001 From: Christopher Willis-Ford <7019101+cwillisf@users.noreply.github.com> Date: Thu, 27 Jan 2022 17:19:57 -0800 Subject: [PATCH 12/12] remove Gemfile since we're not using bundler --- Gemfile | 3 - Gemfile.lock | 218 --------------------------------------------------- 2 files changed, 221 deletions(-) delete mode 100644 Gemfile delete mode 100644 Gemfile.lock diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 7a118b4..0000000 --- a/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gem "fastlane" diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 6d9ba03..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,218 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - CFPropertyList (3.0.5) - rexml - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - artifactory (3.0.15) - atomos (0.1.3) - aws-eventstream (1.2.0) - aws-partitions (1.549.0) - aws-sdk-core (3.125.5) - aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.525.0) - aws-sigv4 (~> 1.1) - jmespath (~> 1.0) - aws-sdk-kms (1.53.0) - aws-sdk-core (~> 3, >= 3.125.0) - aws-sigv4 (~> 1.1) - aws-sdk-s3 (1.111.3) - aws-sdk-core (~> 3, >= 3.125.0) - aws-sdk-kms (~> 1) - aws-sigv4 (~> 1.4) - aws-sigv4 (1.4.0) - aws-eventstream (~> 1, >= 1.0.2) - babosa (1.0.4) - claide (1.1.0) - colored (1.2) - colored2 (3.1.2) - commander (4.6.0) - highline (~> 2.0.0) - declarative (0.0.20) - digest-crc (0.6.4) - rake (>= 12.0.0, < 14.0.0) - domain_name (0.5.20190701) - unf (>= 0.0.5, < 1.0.0) - dotenv (2.7.6) - emoji_regex (3.2.3) - excon (0.90.0) - faraday (1.9.3) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-cookie_jar (0.0.7) - faraday (>= 0.8.0) - http-cookie (~> 1.0.0) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) - faraday-multipart (1.0.3) - multipart-post (>= 1.2, < 3) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) - faraday_middleware (1.2.0) - faraday (~> 1.0) - fastimage (2.2.6) - fastlane (2.201.1) - CFPropertyList (>= 2.3, < 4.0.0) - addressable (>= 2.8, < 3.0.0) - artifactory (~> 3.0) - aws-sdk-s3 (~> 1.0) - babosa (>= 1.0.3, < 2.0.0) - bundler (>= 1.12.0, < 3.0.0) - colored - commander (~> 4.6) - dotenv (>= 2.1.1, < 3.0.0) - emoji_regex (>= 0.1, < 4.0) - excon (>= 0.71.0, < 1.0.0) - faraday (~> 1.0) - faraday-cookie_jar (~> 0.0.6) - faraday_middleware (~> 1.0) - fastimage (>= 2.1.0, < 3.0.0) - gh_inspector (>= 1.1.2, < 2.0.0) - google-apis-androidpublisher_v3 (~> 0.3) - google-apis-playcustomapp_v1 (~> 0.1) - google-cloud-storage (~> 1.31) - highline (~> 2.0) - json (< 3.0.0) - jwt (>= 2.1.0, < 3) - mini_magick (>= 4.9.4, < 5.0.0) - multipart-post (~> 2.0.0) - naturally (~> 2.2) - optparse (~> 0.1.1) - plist (>= 3.1.0, < 4.0.0) - rubyzip (>= 2.0.0, < 3.0.0) - security (= 0.1.3) - simctl (~> 1.6.3) - terminal-notifier (>= 2.0.0, < 3.0.0) - terminal-table (>= 1.4.5, < 2.0.0) - tty-screen (>= 0.6.3, < 1.0.0) - tty-spinner (>= 0.8.0, < 1.0.0) - word_wrap (~> 1.0.0) - xcodeproj (>= 1.13.0, < 2.0.0) - xcpretty (~> 0.3.0) - xcpretty-travis-formatter (>= 0.0.3) - gh_inspector (1.1.3) - google-apis-androidpublisher_v3 (0.15.0) - google-apis-core (>= 0.4, < 2.a) - google-apis-core (0.4.2) - addressable (~> 2.5, >= 2.5.1) - googleauth (>= 0.16.2, < 2.a) - httpclient (>= 2.8.1, < 3.a) - mini_mime (~> 1.0) - representable (~> 3.0) - retriable (>= 2.0, < 4.a) - rexml - webrick - google-apis-iamcredentials_v1 (0.10.0) - google-apis-core (>= 0.4, < 2.a) - google-apis-playcustomapp_v1 (0.7.0) - google-apis-core (>= 0.4, < 2.a) - google-apis-storage_v1 (0.11.0) - google-apis-core (>= 0.4, < 2.a) - google-cloud-core (1.6.0) - google-cloud-env (~> 1.0) - google-cloud-errors (~> 1.0) - google-cloud-env (1.5.0) - faraday (>= 0.17.3, < 2.0) - google-cloud-errors (1.2.0) - google-cloud-storage (1.36.0) - addressable (~> 2.8) - digest-crc (~> 0.4) - google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.1) - google-cloud-core (~> 1.6) - googleauth (>= 0.16.2, < 2.a) - mini_mime (~> 1.0) - googleauth (1.1.0) - faraday (>= 0.17.3, < 2.0) - jwt (>= 1.4, < 3.0) - memoist (~> 0.16) - multi_json (~> 1.11) - os (>= 0.9, < 2.0) - signet (>= 0.16, < 2.a) - highline (2.0.3) - http-cookie (1.0.4) - domain_name (~> 0.5) - httpclient (2.8.3) - jmespath (1.5.0) - json (2.6.1) - jwt (2.3.0) - memoist (0.16.2) - mini_magick (4.11.0) - mini_mime (1.1.2) - multi_json (1.15.0) - multipart-post (2.0.0) - nanaimo (0.3.0) - naturally (2.2.1) - optparse (0.1.1) - os (1.1.4) - plist (3.6.0) - public_suffix (4.0.6) - rake (13.0.6) - representable (3.1.1) - declarative (< 0.1.0) - trailblazer-option (>= 0.1.1, < 0.2.0) - uber (< 0.2.0) - retriable (3.1.2) - rexml (3.2.5) - rouge (2.0.7) - ruby2_keywords (0.0.5) - rubyzip (2.3.2) - security (0.1.3) - signet (0.16.0) - addressable (~> 2.8) - faraday (>= 0.17.3, < 2.0) - jwt (>= 1.5, < 3.0) - multi_json (~> 1.10) - simctl (1.6.8) - CFPropertyList - naturally - terminal-notifier (2.0.0) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - trailblazer-option (0.1.2) - tty-cursor (0.7.1) - tty-screen (0.8.1) - tty-spinner (0.9.3) - tty-cursor (~> 0.7) - uber (0.1.0) - unf (0.1.4) - unf_ext - unf_ext (0.0.8) - unicode-display_width (1.8.0) - webrick (1.7.0) - word_wrap (1.0.0) - xcodeproj (1.21.0) - CFPropertyList (>= 2.3.3, < 4.0) - atomos (~> 0.1.3) - claide (>= 1.0.2, < 2.0) - colored2 (~> 3.1) - nanaimo (~> 0.3.0) - rexml (~> 3.2.4) - xcpretty (0.3.0) - rouge (~> 2.0.7) - xcpretty-travis-formatter (1.0.1) - xcpretty (~> 0.2, >= 0.0.7) - -PLATFORMS - x86_64-darwin-20 - -DEPENDENCIES - fastlane - -BUNDLED WITH - 2.2.32