|
24 | 24 | APPLE_CERTIFICATE_PASSWORD: codex-test-password
|
25 | 25 | # SHA-1 fingerprint of the test certificate; codesign accepts this format.
|
26 | 26 | APPLE_CODESIGN_IDENTITY: 4E7E4C6F30634C3C9E308723F109FE7C83C061ED
|
27 |
| - CODESIGN_TEST: true |
28 | 27 |
|
29 | 28 | jobs:
|
30 | 29 | tag-check:
|
@@ -135,31 +134,39 @@ jobs:
|
135 | 134 | exit 1
|
136 | 135 | fi
|
137 | 136 |
|
138 |
| - cert_path="${RUNNER_TEMP}/apple_signing_certificate.p12" |
139 |
| - echo "$APPLE_CERTIFICATE" | base64 -d > "$cert_path" |
| 137 | + # TODO: we will be directly using the p12 from github secrets |
| 138 | + # cert_path="${RUNNER_TEMP}/apple_signing_certificate.p12" |
| 139 | + # echo "$APPLE_CERTIFICATE" | base64 -d > "$cert_path" |
140 | 140 |
|
141 | 141 | keychain_path="${RUNNER_TEMP}/codex-signing.keychain-db"
|
142 | 142 | security create-keychain -p "$KEYCHAIN_PASSWORD" "$keychain_path"
|
143 | 143 | security set-keychain-settings -lut 21600 "$keychain_path"
|
144 | 144 | security unlock-keychain -p "$KEYCHAIN_PASSWORD" "$keychain_path"
|
145 | 145 |
|
146 | 146 | keychain_args=()
|
| 147 | +
|
147 | 148 | while IFS= read -r keychain; do
|
148 | 149 | [[ -n "$keychain" ]] && keychain_args+=("$keychain")
|
149 | 150 | done < <(security list-keychains | sed 's/^[[:space:]]*//;s/[[:space:]]*$//;s/"//g')
|
| 151 | +
|
150 | 152 | if ((${#keychain_args[@]} > 0)); then
|
151 | 153 | security list-keychains -s "$keychain_path" "${keychain_args[@]}"
|
152 | 154 | else
|
153 | 155 | security list-keychains -s "$keychain_path"
|
154 | 156 | fi
|
| 157 | +
|
155 | 158 | security default-keychain -s "$keychain_path"
|
156 | 159 | security import "$cert_path" -k "$keychain_path" -P "$APPLE_CERTIFICATE_PASSWORD" -T /usr/bin/codesign -T /usr/bin/security
|
157 | 160 | security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" "$keychain_path"
|
158 | 161 |
|
159 |
| - echo "::group::Imported signing identities" |
160 |
| - security find-identity -v -p codesigning "$keychain_path" || true |
161 |
| - security find-certificate -a -Z "$keychain_path" || true |
162 |
| - echo "::endgroup::" |
| 162 | + if [[ "${CODESIGN_DEBUG:-}" == "true" ]]; then |
| 163 | + echo "::group::Imported signing identities" |
| 164 | + # TODO: we will need to grab the identity from this and then use it in the next step |
| 165 | + # TODO: WE DEFINITELY NEED TO GET RID OF THOSE |
| 166 | + security find-identity -v -p codesigning "$keychain_path" || true |
| 167 | + security find-certificate -a -Z "$keychain_path" || true |
| 168 | + echo "::endgroup::" |
| 169 | + fi |
163 | 170 |
|
164 | 171 | rm -f "$cert_path"
|
165 | 172 |
|
@@ -187,12 +194,7 @@ jobs:
|
187 | 194 |
|
188 | 195 | for binary in codex codex-responses-api-proxy; do
|
189 | 196 | path="target/${{ matrix.target }}/release/${binary}"
|
190 |
| - if [[ "${CODESIGN_TEST:-}" == "true" ]]; then |
191 |
| - echo "Ad-hoc signing $path (test mode)" |
192 |
| - codesign --force --sign - "$path" |
193 |
| - else |
194 |
| - codesign --force --options runtime --timestamp --sign "$APPLE_CODESIGN_IDENTITY" "${keychain_args[@]}" "$path" |
195 |
| - fi |
| 197 | + codesign --force --options runtime --timestamp --sign "$APPLE_CODESIGN_IDENTITY" "${keychain_args[@]}" "$path" |
196 | 198 | codesign --verify --deep --strict "$path"
|
197 | 199 | done
|
198 | 200 |
|
|
0 commit comments