Build #61
This file contains 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
name: Build | |
on: | |
push: | |
paths: ["**.swift"] | |
branches: [main] | |
pull_request: | |
paths: ["**.swift"] | |
branches: [main] | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: macos-13 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: swift-actions/setup-swift@v1 | |
- name: Install Apple Developer Application Certificate | |
env: | |
APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE }} | |
APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_PASSWORD }} | |
APPLE_DEVELOPER_CERTIFICATE_AUTHORITY: ${{ secrets.APPLE_DEVELOPER_CERTIFICATE_AUTHORITY }} | |
APPLE_DEVELOPER_KEYCHAIN_PASSWORD: ${{ secrets.APPLE_DEVELOPER_KEYCHAIN_PASSWORD }} | |
run: | | |
CERTIFICATE_PATH="$RUNNER_TEMP/apple-developer-application-certificate.p12" | |
CERTIFICATE_AUTHORITY_PATH="$RUNNER_TEMP/apple-developer-certificate-authority.cer" | |
KEYCHAIN_PATH="$RUNNER_TEMP/apple-developer.keychain-db" | |
echo -n "$APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE" | base64 --decode -i - -o "$CERTIFICATE_PATH" | |
echo -n "$APPLE_DEVELOPER_CERTIFICATE_AUTHORITY" | base64 --decode -i - -o "$CERTIFICATE_AUTHORITY_PATH" | |
security create-keychain -p "$APPLE_DEVELOPER_KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
security set-keychain-settings -lut 21600 "$KEYCHAIN_PATH" | |
security unlock-keychain -p "$APPLE_DEVELOPER_KEYCHAIN_PASSWORD" "$KEYCHAIN_PATH" | |
security import "$CERTIFICATE_PATH" -P "$APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k "$KEYCHAIN_PATH" | |
security import "$CERTIFICATE_AUTHORITY_PATH" -P "$APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_PASSWORD" -A -t cert -f pkcs7 -k "$KEYCHAIN_PATH" | |
security list-keychain -d user -s "$KEYCHAIN_PATH" | |
- name: Archive Low Profile | |
run: xcodebuild -scheme "Low Profile" clean archive -configuration release -archivePath "Low Profile" -quiet | |
- name: Export Low Profile | |
run: xcodebuild -exportArchive -archivePath "Low Profile.xcarchive" -exportPath Export -exportOptionsPlist ExportOptions.plist | |
- name: Print Low Profile version | |
run: defaults read "$GITHUB_WORKSPACE/Export/Low Profile.app/Contents/Info.plist" CFBundleShortVersionString | |
- name: Remove Apple Developer Keychain | |
if: ${{ always() }} | |
run: security delete-keychain $RUNNER_TEMP/apple-developer.keychain-db |