|
12 | 12 | LIBZIM_DL_VERSION: "2023-04-19" |
13 | 13 | MACOSX_DEPLOYMENT_TARGET: "11.0" |
14 | 14 | CIBW_ENVIRONMENT_PASS_LINUX: "LIBZIM_DL_VERSION" |
| 15 | + # APPLE_SIGNING_KEYCHAIN_PATH set in prepare keychain step |
| 16 | + APPLE_SIGNING_KEYCHAIN_PROFILE: "build-profile" |
| 17 | + APPLE_SIGNING_IDENTITY: "${{ secrets.APPLE_SIGNING_IDENTITY }}" |
| 18 | + SIGN_APPLE: "yes" |
15 | 19 |
|
16 | 20 |
|
17 | 21 | jobs: |
|
31 | 35 | with: |
32 | 36 | platforms: all |
33 | 37 |
|
| 38 | + - name: Prepare Apple Keychain for Signing |
| 39 | + if: matrix.os == 'macos-12' |
| 40 | + shell: bash |
| 41 | + run: | |
| 42 | + # store certificate on filesystem |
| 43 | + export CERTIFICATE="$(mktemp -d)/wmch-devid.p12" |
| 44 | + echo "${{ secrets.APPLE_SIGNING_CERTIFICATE }}" | base64 --decode -o $CERTIFICATE |
| 45 | +
|
| 46 | + # create a dedicated keychain |
| 47 | + export APPLE_SIGNING_KEYCHAIN_PATH="$(mktemp -d)/build.keychain" |
| 48 | + echo "APPLE_SIGNING_KEYCHAIN_PATH=${APPLE_SIGNING_KEYCHAIN_PATH}" >> "$GITHUB_ENV" |
| 49 | + security create-keychain -p mysecretpassword ${APPLE_SIGNING_KEYCHAIN_PATH} |
| 50 | + security default-keychain -s ${APPLE_SIGNING_KEYCHAIN_PATH} |
| 51 | + security unlock-keychain -p mysecretpassword ${APPLE_SIGNING_KEYCHAIN_PATH} |
| 52 | +
|
| 53 | + # import certificate into keychain then remove from filesystem |
| 54 | + security import ${CERTIFICATE} -k ${APPLE_SIGNING_KEYCHAIN_PATH} -P "${{ secrets.APPLE_SIGNING_P12_PASSWORD }}" -A |
| 55 | + rm $CERTIFICATE |
| 56 | +
|
| 57 | + # store signing credentials into the keychain |
| 58 | + security set-key-partition-list -S "apple-tool:,apple:" -s -k mysecretpassword ${APPLE_SIGNING_KEYCHAIN_PATH} |
| 59 | + security find-identity -v |
| 60 | + xcrun notarytool store-credentials \ |
| 61 | + --apple-id "${{ secrets.APPLE_SIGNING_ALTOOL_USERNAME }}" \ |
| 62 | + --password "${{ secrets.APPLE_SIGNING_ALTOOL_PASSWORD }}" \ |
| 63 | + --team-id "${{ secrets.APPLE_SIGNING_TEAM }}" \ |
| 64 | + --validate \ |
| 65 | + --keychain ${APPLE_SIGNING_KEYCHAIN_PATH} \ |
| 66 | + ${APPLE_SIGNING_KEYCHAIN_PROFILE} |
| 67 | +
|
34 | 68 | - name: Build wheels |
35 | 69 | |
36 | 70 |
|
| 71 | + - name: Cleanup Apple Keychain |
| 72 | + if: matrix.os == 'macos-12' |
| 73 | + shell: bash |
| 74 | + run: | |
| 75 | + security lock-keychain ${APPLE_SIGNING_KEYCHAIN_PATH} |
| 76 | + security delete-keychain ${APPLE_SIGNING_KEYCHAIN_PATH} |
| 77 | + rm -f ${APPLE_SIGNING_KEYCHAIN_PATH} |
| 78 | +
|
37 | 79 | - uses: actions/upload-artifact@v3 |
38 | 80 | with: |
39 | 81 | path: ./wheelhouse/*.whl |
|
0 commit comments