Skip to content

Commit

Permalink
Switch to match for certificate management
Browse files Browse the repository at this point in the history
  • Loading branch information
mplorentz committed Dec 15, 2023
1 parent 25be80b commit 94b5766
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/deploy-to-testflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
- name: Checkout
uses: actions/checkout@main
- uses: nomasystems/[email protected]
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ Secrets.SSH_KEY }}
- name: Deploy with fastlane
run: |
bundle install
Expand All @@ -23,3 +27,4 @@ jobs:
APP_STORE_CONNECT_API_KEY_CONTENT: ${{Secrets. APP_STORE_CONNECT_API_KEY_CONTENT}}
APP_STORE_CONNECT_ISSUER_ID: ${{Secrets. APP_STORE_CONNECT_ISSUER_ID}}
APP_STORE_CONNECT_API_KEY_ID: ${{Secrets. APP_STORE_CONNECT_API_KEY_ID}}
MATCH_PASSWORD: ${{ Secrets.MATCH_PASSWORD }}
23 changes: 13 additions & 10 deletions Nos.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1963,7 +1963,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 101;
CURRENT_PROJECT_VERSION = 111;
DEVELOPMENT_TEAM = GZCZBKH7MY;
GCC_OPTIMIZATION_LEVEL = s;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -1984,7 +1984,7 @@
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 101;
CURRENT_PROJECT_VERSION = 111;
DEVELOPMENT_TEAM = GZCZBKH7MY;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
Expand Down Expand Up @@ -2131,7 +2131,7 @@
CODE_SIGN_IDENTITY = "-";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 101;
CURRENT_PROJECT_VERSION = 111;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Nos/Views/Preview Content\"";
DEVELOPMENT_TEAM = GZCZBKH7MY;
Expand Down Expand Up @@ -2181,11 +2181,12 @@
CODE_SIGN_ENTITLEMENTS = Nos/Nos.entitlements;
CODE_SIGN_IDENTITY = "-";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 101;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 111;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Nos/Views/Preview Content\"";
DEVELOPMENT_TEAM = GZCZBKH7MY;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = GZCZBKH7MY;
ENABLE_HARDENED_RUNTIME = YES;
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
Expand All @@ -2210,6 +2211,8 @@
MARKETING_VERSION = 0.1;
PRODUCT_BUNDLE_IDENTIFIER = com.verse.Nos;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore com.verse.Nos";
SDKROOT = auto;
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
SUPPORTS_MACCATALYST = NO;
Expand All @@ -2225,7 +2228,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 101;
CURRENT_PROJECT_VERSION = 111;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = GZCZBKH7MY;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -2251,7 +2254,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 101;
CURRENT_PROJECT_VERSION = 111;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = GZCZBKH7MY;
GENERATE_INFOPLIST_FILE = YES;
Expand All @@ -2275,7 +2278,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 101;
CURRENT_PROJECT_VERSION = 111;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = GZCZBKH7MY;
GCC_OPTIMIZATION_LEVEL = 0;
Expand All @@ -2300,7 +2303,7 @@
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 101;
CURRENT_PROJECT_VERSION = 111;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_TEAM = GZCZBKH7MY;
GENERATE_INFOPLIST_FILE = YES;
Expand Down
33 changes: 29 additions & 4 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@
default_platform(:ios)

platform :ios do
asc_key_content = ENV["APP_STORE_CONNECT_API_KEY_CONTENT"]
asc_issuer_id = ENV["APP_STORE_CONNECT_ISSUER_ID"]
asc_key_id = ENV["APP_STORE_CONNECT_API_KEY_ID"]
GIT_AUTHORIZATION = ENV["GIT_AUTHORIZATION"]
TEMP_KEYCHAIN_USER = ENV["TEMP_KEYCHAIN_USER"]
TEMP_KEYCHAIN_PASSWORD = ENV["TEMP_KEYCHAIN_PASSWORD"]

desc "Push a new beta build to TestFlight"
lane :beta do
#xcodes # ensure correct version of xcode is installed and selected
asc_key_content = ENV["APP_STORE_CONNECT_API_KEY_CONTENT"]
asc_issuer_id = ENV["APP_STORE_CONNECT_ISSUER_ID"]
asc_key_id = ENV["APP_STORE_CONNECT_API_KEY_ID"]
app_store_connect_api_key(
key_id: asc_key_id,
issuer_id: asc_issuer_id,
key_content: asc_key_content
)
match(type: "appstore")
increment_build_number(xcodeproj: "Nos.xcodeproj")
version_number = get_version_number(
xcodeproj: "Nos.xcodeproj",
Expand All @@ -36,7 +41,7 @@ platform :ios do
gym(
scheme: "Nos",
clean: true,
xcargs: "-skipPackagePluginValidation -allowProvisioningUpdates"
xcargs: "-skipPackagePluginValidation"
)
changelog = read_changelog
upload_to_testflight(changelog: changelog)
Expand All @@ -57,6 +62,26 @@ platform :ios do
open: "https://appstoreconnect.apple.com/apps/1670125746/testflight/ios"
)
end

desc "Refresh certificates in the match repo"
lane :certs do
app_store_connect_api_key(
key_id: asc_key_id,
issuer_id: asc_issuer_id,
key_content: asc_key_content
)
match(type: "appstore")
end

desc "Clean App Store Connect of certificates"
lane :nuke_certs do
app_store_connect_api_key(
key_id: asc_key_id,
issuer_id: asc_issuer_id,
key_content: asc_key_content
)
match_nuke(type: "appstore")
end
end

# Dynamically define 3 lanes:
Expand Down
16 changes: 16 additions & 0 deletions fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,22 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do

Push a new beta build to TestFlight

### ios certs

```sh
[bundle exec] fastlane ios certs
```

Refresh certificates in the match repo

### ios nuke_certs

```sh
[bundle exec] fastlane ios nuke_certs
```

Clean App Store Connect of certificates

----

This README.md is auto-generated and will be re-generated every time [_fastlane_](https://fastlane.tools) is run.
Expand Down

0 comments on commit 94b5766

Please sign in to comment.