Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[eas] Update configureMacOSCredentials to install provisioning profile #234

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions apps/menu-bar/.eas/build/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,23 @@ build:
name: Export archive menu-bar
working_directory: ../../apps/menu-bar
command: |
yarn export-upload-archive
yarn export-local-archive
- run:
name: Notarize menu-bar
name: codesign menu-bar
working_directory: ../../apps/menu-bar
command: |
codesign --force -s "Developer ID Application: 650 Industries, Inc. (C8D8QTF339)" -v build/Release/Expo\ Orbit.app --deep --strict --options=runtime --timestamp
- run:
name: zip menu-bar export
working_directory: ../../apps/menu-bar
command: |
yarn notarize
zip -r build/Release/ExpoOrbit.zip build/Release/Expo\ Orbit.app
- eas/find_and_upload_build_artifacts
- run:
name: Notarize menu-bar
working_directory: ../../apps/menu-bar
command: |
xcrun notarytool submit "build/Release/ExpoOrbit.zip" --apple-id $APPLE_ID_NOTARIZATION_EMAIL --password $APPLE_ID_NOTARIZATION_PASSWORD --team-id "C8D8QTF339" --wait
functions:
configure_macos_credentials:
name: Configure macOS Credentials
Expand Down

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions apps/menu-bar/.eas/build/configureMacOSCredentials/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ async function configureMacOSCredentials(
KEYCHAIN_NAME,
]);

// Set default keychain to temp keychain
await spawnAsync('security', ['default-keychain', '-s', KEYCHAIN_NAME]);

// List all available identities
let result = await spawnAsync('security', ['find-identity']);
ctx.logger.info(`Identities: ${result.output}`);
Expand All @@ -102,6 +105,19 @@ async function configureMacOSCredentials(

// Set the keychain timeout to infinity
await spawnAsync('security', ['set-keychain-settings', KEYCHAIN_NAME]);

await spawnAsync('mkdir', ['-p', '/Users/expo/Library/MobileDevice/Provisioning Profiles/']);

// install provisioning profile
const fileBuffer = Buffer.from(process.env?.ORBIT_PROVISIONPROFILE_BASE64 ?? '', 'base64');
const filePath = `./${process.env?.ORBIT_PROVISIONPROFILE_UUID}.provisionprofile`;
fs.writeFileSync(filePath, fileBuffer);
console.log('File written successfully:', filePath);

await spawnAsync('cp', [
`./${process.env?.ORBIT_PROVISIONPROFILE_UUID}.provisionprofile`,
`/Users/expo/Library/MobileDevice/Provisioning Profiles/${process.env?.ORBIT_PROVISIONPROFILE_UUID}.provisionprofile`,
]);
} catch (error) {
ctx.logger.error(`ERROR: ${error}`);
throw error;
Expand Down
2 changes: 1 addition & 1 deletion apps/menu-bar/eas.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"credentialsSource": "remote",
"ios": {
"image": "latest",
"applicationArchivePath": "build/Notarized/*.app"
"applicationArchivePath": "build/Release/*.zip"
}
}
},
Expand Down
21 changes: 11 additions & 10 deletions apps/menu-bar/macos/ExportLocalOptions.plist
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>destination</key>
<string>export</string>
<key>method</key>
<string>developer-id</string>
<key>signingCertificate</key>
<string>Developer ID Application</string>
<key>teamID</key>
<string>C8D8QTF339</string>
</dict>
<dict>
<key>method</key>
<string>developer-id</string>
<key>signingCertificate</key>
<string>Developer ID Application</string>
<key>provisioningProfiles</key>
<dict>
<key>dev.expo.orbit</key>
<string>797ac624-d0d9-4d2b-b7ee-9e67fd39f239</string>
</dict>
</dict>
</plist>
Loading