From ab04b6da36b2c400d0676893db82c57a84aa9afb Mon Sep 17 00:00:00 2001 From: DeeDeeG Date: Tue, 26 Sep 2023 14:33:29 -0400 Subject: [PATCH] CI: Move to unified macOS binary build step in GitHub Actions Unset the signing-related env vars if not decrypted, so signing will not occur. --- .github/workflows/build.yml | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b106e3dda0..0314f47538 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,8 +79,8 @@ jobs: yarn run build:apm # macOS Signing Stuff - - name: Build Pulsar Binaries (macOS) (Signed) - if: ${{ runner.os == 'macOS' && github.event.pull_request.head.repo.full_name == 'pulsar-edit/pulsar' }} + - name: Build Pulsar Binaries (macOS) + if: ${{ runner.os == 'macOS' }} # PRs generated from forks cannot access GitHub Secrets # So if the PR is a fork, we will still build, but will not sign. env: @@ -94,16 +94,13 @@ jobs: timeout_minutes: 30 max_attempts: 3 retry_on: error - command: yarn dist - - - name: Build Pulsar Binaries (macOS) (Unsigned) - if: ${{ runner.os == 'macOS' && github.event.pull_request.head.repo.full_name != 'pulsar-edit/pulsar' }} - uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd - with: - timeout_minutes: 30 - max_attempts: 3 - retry_on: error - command: yarn dist + command: | + for var in CSC_LINK CSC_KEY_PASSWORD APPLEID APPLEID_PASSWORD TEAM_ID; do + # Fully unset these env vars if have been set as empty (such as when not decrypted for PRs), + # since otherwise they will make electron-builder try to sign and fail if they are set empty. + if [[ -z ${!var} ]]; then unset ${var}; fi + done + yarn dist - name: Build Pulsar Binaries if: ${{ runner.os != 'macOS' }}