Skip to content

Commit

Permalink
ci: Update the App Store Connect API key (#185)
Browse files Browse the repository at this point in the history
This change also updates build-tools to address issues with build number
generation.
  • Loading branch information
jbmorley authored Aug 26, 2023
1 parent f27e406 commit cfed42f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
MACOS_DEVELOPER_INSTALLER_CERTIFICATE_BASE64: ${{ secrets.MACOS_DEVELOPER_INSTALLER_CERTIFICATE_BASE64 }}
MACOS_DEVELOPER_INSTALLER_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_DEVELOPER_INSTALLER_CERTIFICATE_PASSWORD }}

APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
APPLE_API_KEY_BASE64: ${{ secrets.APPLE_API_KEY_BASE64 }}
APPLE_API_KEY_ISSUER_ID: ${{ secrets.APPLE_API_KEY_ISSUER_ID }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}

Expand Down
2 changes: 1 addition & 1 deletion scripts/build-tools
Submodule build-tools updated 1 files
+3 −1 build-tools.py
20 changes: 8 additions & 12 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,11 @@ echo "$TEMPORARY_KEYCHAIN_PASSWORD" | build-tools create-keychain "$KEYCHAIN_PAT

function cleanup {

# Cleanup the temporary files and keychain.
# Cleanup the temporary files, keychain and keys.
cd "$ROOT_DIRECTORY"
build-tools delete-keychain "$KEYCHAIN_PATH"
rm -rf "$TEMPORARY_DIRECTORY"

# Clean up any private keys.
if [ -f ~/.appstoreconnect/private_keys ]; then
rm -r ~/.appstoreconnect/private_keys
fi
rm -rf ~/.appstoreconnect/private_keys
}

trap cleanup EXIT
Expand Down Expand Up @@ -162,8 +158,12 @@ xcodebuild \
APP_BASENAME="Symbolic.app"
APP_PATH="$BUILD_DIRECTORY/$APP_BASENAME"
PKG_PATH="$BUILD_DIRECTORY/Symbolic.pkg"
#
# # Validate the macOS build.

# Install the private key.
mkdir -p ~/.appstoreconnect/private_keys/
echo -n "$APPLE_API_KEY_BASE64" | base64 --decode -o ~/".appstoreconnect/private_keys/AuthKey_${APPLE_API_KEY_ID}.p8"

# Validate the macOS build.
xcrun altool --validate-app \
-f "${PKG_PATH}" \
--apiKey "$APPLE_API_KEY_ID" \
Expand All @@ -180,10 +180,6 @@ popd

if $RELEASE ; then

# Install the private key.
mkdir -p ~/.appstoreconnect/private_keys/
echo -n "$APPLE_API_KEY" | base64 --decode -o ~/".appstoreconnect/private_keys/AuthKey_${APPLE_API_KEY_ID}.p8"

changes \
release \
--skip-if-empty \
Expand Down

0 comments on commit cfed42f

Please sign in to comment.