Use ASC API key env vars#3401
Open
mokagio wants to merge 2 commits into
Open
Conversation
Remove the encrypted `.configure` API key material and source the App Store Connect private key from `.mobile-secrets` instead. Keep readonly certificate sync independent from App Store Connect credentials so normal packaging can fetch existing signing assets without requiring API key access. --- Generated with the help of Codex, https://chatgpt.com/codex Co-Authored-By: Codex <noreply@openai.com>
mokagio
commented
Jun 26, 2026
mokagio
commented
Jun 26, 2026
Co-authored-by: Gio Lodi <giovanni.lodi42@gmail.com>
Comment on lines
1
to
+16
| const fs = require('fs'); | ||
| const os = require('os'); | ||
| const path = require('path'); | ||
| const dotenv = require('dotenv'); | ||
|
|
||
| function writeAppStoreConnectApiKey() { | ||
| const key = process.env.APP_STORE_CONNECT_API_KEY_KEY; | ||
| const keyPath = path.join( | ||
| os.tmpdir(), | ||
| 'simplenote-app-store-connect-api-key.p8' | ||
| ); | ||
|
|
||
| fs.writeFileSync(keyPath, key.replace(/\\n/g, '\n'), { mode: 0o600 }); | ||
|
|
||
| return keyPath; | ||
| } |
Comment on lines
+62
to
+63
| const appStoreConnectKeyPath = writeAppStoreConnectApiKey(); | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use App Store Connect API key values from environment variables for macOS signing/notarization instead of the encrypted
.configureprivate key file.See https://linear.app/a8c/issue/AINFRA-226
AI-generated details.
Test
ruby -c fastlane/Fastfilenode --check after_sign_hook.jsBUNDLE_PATH=vendor/bundle mise exec ruby@3.2.2 -- ruby -S bundle exec fastlane lanesBUNDLE_PATH=vendor/bundle mise exec ruby@3.2.2 -- ruby -S bundle exec rubocop --only Lint fastlane/Fastfilemise exec node@20.10.0 -- npm ci --legacy-peer-depsmise exec node@20.10.0 -- npx prettier --check after_sign_hook.js .buildkite/pipeline.ymlmise exec node@20.10.0 -- npx eslint after_sign_hook.jsmise exec node@20.10.0 -- npm run lintmise exec node@20.10.0 -- npm testfastlane mac configure_code_signingno longer requires ASC env vars in readonly mode.after_sign_hook.jswrites a temporary.p8file fromAPP_STORE_CONNECT_API_KEY_KEYand passes it to notarization.Release
These changes do not require release notes.