Skip to content

Commit 3c2214d

Browse files
committed
try to fix signing
1 parent 279058a commit 3c2214d

2 files changed

Lines changed: 38 additions & 33 deletions

File tree

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: Release MacOS app
66
on:
77
push:
88
branches: [ "main" ]
9-
pull_request:
9+
pull_request: # TODO: Remove
1010
branches: [ "main" ]
1111
concurrency:
1212
group: ${{ github.ref }}

app/fastlane/Fastfile

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,14 @@ platform :mac do
4242
# use a fine grained token with permissions for: Contents, Metadata (maybe also commit statuses and pull requests)
4343
personal_github_access_token = load_secret("FASTLANE_MACH_REPO_GITHUB_ACCESS_TOKEN")
4444
ENV['MATCH_PASSWORD'] = load_secret("MATCH_PASSWORD")
45+
readonly = true
46+
# The fine grained token should have permissions for: Contents, Metadata (maybe also commit statuses and pull requests)
47+
# I could not find how to pass it in the header. It is in the git URL. If it is not set, like when running locally and saving new certificates, we need to use the SSH URL.
48+
git_url = readonly ? "https://#{personal_github_access_token}@github.com/gsabran/command-provisioning-profiles.git" : "git@github.com:gsabran/command-provisioning-profiles.git"
4549
match(
4650
type: 'appstore',
47-
readonly: true,
48-
git_url: "https://#{personal_github_access_token}@github.com/gsabran/command-provisioning-profiles.git"
51+
readonly: readonly,
52+
git_url: git_url
4953
)
5054

5155
sh("../tools/release/configure_xcodeproj_for_release_build.sh")
@@ -69,67 +73,68 @@ platform :mac do
6973

7074
personal_github_access_token = load_secret("FASTLANE_MACH_REPO_GITHUB_ACCESS_TOKEN")
7175
ENV['MATCH_PASSWORD'] = load_secret("MATCH_PASSWORD")
76+
readonly = true
77+
# The fine grained token should have permissions for: Contents, Metadata (maybe also commit statuses and pull requests)
78+
# I could not find how to pass it in the header. It is in the git URL. If it is not set, like when running locally and saving new certificates, we need to use the SSH URL.
79+
git_url = readonly ? "https://#{personal_github_access_token}@github.com/gsabran/command-provisioning-profiles.git" : "git@github.com:gsabran/command-provisioning-profiles.git"
7280
match(
7381
type: 'developer_id',
7482
team_id: 'GP78T2GNXD',
75-
readonly: true,
76-
git_url: "https://#{personal_github_access_token}@github.com/gsabran/command-provisioning-profiles.git"
83+
readonly: readonly,
84+
git_url: git_url
7785
)
7886
match(
7987
type: 'appstore',
80-
readonly: true,
81-
git_url: "https://#{personal_github_access_token}@github.com/gsabran/command-provisioning-profiles.git"
88+
readonly: readonly,
89+
git_url: git_url
8290
)
8391
match(
8492
type: 'development',
85-
readonly: true,
86-
git_url: "https://#{personal_github_access_token}@github.com/gsabran/command-provisioning-profiles.git"
87-
# use this url to write, assuming you have ssh access to git.
88-
# git_url: "git@github.com:gsabran/command-provisioning-profiles.git"
93+
readonly: readonly,
94+
git_url: git_url
8995
)
9096
# Print available signing certificates
91-
sh('security find-identity -v -p codesigning')
97+
sh('security find-identity -v -p codesigning')
9298
# No signing certificate "Mac Development" found: No "Mac Development" signing certificate matching team ID "GP78T2GNXD" with a private key was found.
9399

94100
# Build and archive the app
95101
sh("../tools/release/configure_xcodeproj_for_release_build.sh")
102+
103+
104+
build_path = File.absolute_path("../build")
105+
release_path = "#{build_path}/release/"
106+
app_name = "command"
107+
app_path = "#{release_path}/#{app_name}.app"
96108
build_mac_app(
97109
xcargs: "-allowProvisioningUpdates",
98110
export_method: "developer-id",
99111
export_options: {
100112
method: "developer-id",
101-
signingStyle: "manual",
113+
signingStyle: "automatic",
102114
signingCertificate: "Developer ID Application: Papero Inc (GP78T2GNXD)",
103-
teamID: "GP78T2GNXD"
115+
teamID: "GP78T2GNXD",
116+
# provisioningProfiles: {
117+
# "dev.getcmd.command" => "match DeveloperID dev.getcmd.command macos" # Add this line
118+
# }
104119
},
105120
skip_profile_detection: "true",
106121

107122
project: "./command.xcodeproj",
108123
configuration: "Release",
109-
output_directory: "build/release",
110-
derived_data_path: "build/derived_data",
111-
output_name: "command",
124+
output_directory: release_path,
125+
derived_data_path: "#{build_path}/derived_data",
126+
output_name: app_name,
112127
scheme: "command",
113-
# silent: true,
114-
silent: false,
128+
silent: true,
115129
skip_archive: false,
116-
xcodebuild_formatter: "cat",
130+
xcodebuild_formatter: "xcbeautify",
117131
)
118132

119-
build_path = File.absolute_path("../build")
120-
release_path = "#{build_path}/release/"
121-
app_path = "#{release_path}/command.app"
122-
123133
# Notarize the app
124-
notary_key_id = load_secret("NOTARY_KEY_ID")
125-
notary_key_path = File.absolute_path("./AuthKey_#{notary_key_id}.p8")
126-
notary_secret_p8 = load_secret("NOTARY_P8")
127-
notary_issuer_id = load_secret("NOTARY_ISSUER_ID")
128-
129134
app_store_connect_api_key(
130-
key_id: notary_key_id,
131-
issuer_id: notary_issuer_id,
132-
key_content: notary_secret_p8,
135+
key_id: load_secret("NOTARY_KEY_ID"),
136+
issuer_id: load_secret("NOTARY_ISSUER_ID"),
137+
key_content: load_secret("NOTARY_P8"),
133138
)
134139

135140
notarize(
@@ -141,7 +146,7 @@ platform :mac do
141146

142147
# Create metadata for the new release
143148
zip_path = zip(path: app_path)
144-
sparkle_path = File.absolute_path("../build/derived_data/SourcePackages/artifacts/sparkle/Sparkle")
149+
sparkle_path = "#{build_path}/derived_data/SourcePackages/artifacts/sparkle/Sparkle"
145150
sparkle_output_path = File.absolute_path("./appcast.template.xml")
146151

147152
sparkle_secret_key = load_secret("SPARKLE_SECRET_KEY")

0 commit comments

Comments
 (0)