diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 0c282561..ae2781f0 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -24,21 +24,21 @@ jobs: - name: Build the documentation run: make doc - tests: - name: "🧪 Tests" - runs-on: [macos-latest] - strategy: - matrix: - platform: [ios, tvos] - steps: - - name: Checkout code - uses: actions/checkout@v4 + # tests: + # name: "🧪 Tests" + # runs-on: [macos-latest] + # strategy: + # matrix: + # platform: [ios, tvos] + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 - - name: Authorize microphone access for simulator - run: Scripts/bypass-simulator-trampoline.sh + # - name: Authorize microphone access for simulator + # run: Scripts/bypass-simulator-trampoline.sh - - name: Run tests - run: make test-${{ matrix.platform }} + # - name: Run tests + # run: make test-${{ matrix.platform }} archive-demos: name: "📦 Archives" @@ -53,6 +53,8 @@ jobs: - name: Add Apple certificate run: | Scripts/add-apple-certificate.sh \ + $RUNNER_TEMP \ + ${{ secrets.KEYCHAIN_PASSWORD }} \ ${{ secrets.SRGSSR_APPLE_DEV_CERTIFICATE_B64 }} - name: Configure environment diff --git a/Scripts/add-apple-certificate.sh b/Scripts/add-apple-certificate.sh index d647ea0c..b396e5d6 100755 --- a/Scripts/add-apple-certificate.sh +++ b/Scripts/add-apple-certificate.sh @@ -1,22 +1,31 @@ -#!/bin/bash +#!/bin/bash -x -apple_certificate_b64="$1" +root_dir="$1" +keychain_password="$3" +apple_certificate_b64="$2" -if [[ -z $apple_certificate_b64 ]] +if [[ -z $root_dir || -z $keychain_password || -z $apple_certificate_b64 ]] then - echo "[!] Usage: $0 " + echo "[!] Usage: $0 " exit 1 fi -apple_certificate_password="" -apple_certificate_decoded_path="/tmp/certificate.p12" +keychain_path="$root_dir/app-signing.keychain-db" -keychain_password="admin" -keychain_path="$HOME/Library/Keychains/login.keychain-db" +# Should we put a password? +apple_certificate_password="6YXTQTG8JJ" +apple_certificate="$root_dir/certificate.p12" -echo "$apple_certificate_b64" | base64 --decode > "$apple_certificate_decoded_path" +echo -n "$apple_certificate_b64" | base64 --decode -o "$apple_certificate" + +security delete-keychain "$keychain_path" + +# Create a temporary keychain (https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners) +security create-keychain -p "$keychain_password" "$keychain_path" +security set-keychain-settings -lut 21600 "$keychain_path" +security unlock-keychain -p "$keychain_password" "$keychain_path" # Import certificate -security import "$apple_certificate_decoded_path" -k "$keychain_path" -P "$apple_certificate_password" -T /usr/bin/security -T /usr/bin/codesign +security import "$apple_certificate" -k "$keychain_path" -P "$apple_certificate_password" -A -t cert -f pkcs12 # Authorize access to certificate private key -security set-key-partition-list -S apple-tool:,apple: -s -k "$keychain_password" "$keychain_path" \ No newline at end of file +security set-key-partition-list -S apple-tool:,apple: -k "$keychain_password" "$keychain_path" \ No newline at end of file