name: Test Local Signing
on:
workflow_dispatch: # Manual trigger
push:
branches: [ozgur/build]
jobs:
test-local-signing:
runs-on: macos
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Create Test Entitlements
run: |
echo "๐ Creating entitlements file..."
cat > LuckyWorld.entitlements << EOF
com.apple.security.cs.allow-jit
com.apple.security.cs.allow-unsigned-executable-memory
com.apple.security.cs.disable-library-validation
com.apple.security.cs.allow-dyld-environment-variables
com.apple.security.device.audio-input
com.apple.security.device.camera
EOF
echo "โ
Created entitlements file"
cat LuckyWorld.entitlements
shell: bash
- name: Create Test App Bundle
run: |
echo "๐ฆ Creating test app bundle..."
# Create test app bundle structure
TEST_APP_DIR="TestApp.app"
mkdir -p "$TEST_APP_DIR/Contents/MacOS"
# Create a simple test executable
echo '#!/bin/bash
echo "Hello from TestApp!"' > "$TEST_APP_DIR/Contents/MacOS/TestApp"
chmod +x "$TEST_APP_DIR/Contents/MacOS/TestApp"
# Create Info.plist
cat > "$TEST_APP_DIR/Contents/Info.plist" << EOF
CFBundleExecutable
TestApp
CFBundleIdentifier
com.luckyworld.testapp
CFBundleName
TestApp
CFBundlePackageType
APPL
CFBundleShortVersionString
1.0
LSMinimumSystemVersion
10.10
EOF
echo "โ
Created test app bundle"
echo "APP_PATH=$TEST_APP_DIR" >> "$GITHUB_ENV"
# Verify app bundle exists
if [ ! -d "$TEST_APP_DIR" ]; then
echo "โ Error: App bundle not found at $TEST_APP_DIR"
exit 1
fi
echo "๐ App bundle contents:"
ls -la "$TEST_APP_DIR"
shell: bash
- name: Install App Store Connect API Key
run: |
mkdir -p private_keys/
echo '${{ secrets.APPLE_NOTARY_API_KEY }}' > private_keys/AuthKey_${{ secrets.APPLE_NOTARY_API_KEY_ID }}.p8
shell: bash
- name: Sign and Notarize App
uses: indygreg/apple-code-sign-action@v1
with:
input_path: TestApp.app
output_path: TestApp.app
notarize: true
staple: true
p12_file: certificate.p12
p12_password: ${{ secrets.MACOS_CERTIFICATE_PWD }}
app_store_connect_api_issuer: ${{ secrets.APPLE_NOTARY_API_ISSUER_ID }}
app_store_connect_api_key: ${{ secrets.APPLE_NOTARY_API_KEY_ID }}
entitlements: LuckyWorld.entitlements
- name: Cleanup
if: always()
run: |
echo "๐งน Cleaning up..."
rm -rf TestApp.app || true
rm -rf private_keys || true
echo "โ
Cleanup complete"
shell: bash