Skip to content

Commit

Permalink
Prevent errors when installer can't be signed in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
llimeht committed Dec 9, 2024
1 parent 63acd8f commit 00ebdff
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ jobs:

runs-on: ${{ matrix.os }}

env:
# Only sign/notarize if the secrets will be available
SIGN_INSTALLER: ${{ (github.repository == 'SasView/sasview') && 'true' || '' }}

steps:
- name: Configuration of this job
run: |
Expand Down Expand Up @@ -271,7 +275,7 @@ jobs:
tar zcf sasview6.tar.gz sasview
- name: Sign executable and create dmg (OSX)
if: ${{ matrix.installer && startsWith(matrix.os, 'macos') }}
if: ${{ matrix.installer && startsWith(matrix.os, 'macos') && env.SIGN_INSTALLER }}
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE_ISA }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_ISA_PWD }}
Expand All @@ -292,7 +296,7 @@ jobs:
codesign -s "Developer ID Application: The International Scattering Alliance (8CX8K63BQM)" SasView6.dmg
- name: Notarize Release Build (OSX)
if: ${{ matrix.installer && startsWith(matrix.os, 'macos') }}
if: ${{ matrix.installer && startsWith(matrix.os, 'macos') && env.SIGN_INSTALLER }}
uses: lando/notarize-action@v2
with:
product-path: "installers/dist/SasView6.dmg"
Expand All @@ -303,13 +307,13 @@ jobs:
verbose: True

- name: Staple Release Build (OSX)
if: ${{ matrix.installer && startsWith(matrix.os, 'macos') }}
if: ${{ matrix.installer && startsWith(matrix.os, 'macos') && env.SIGN_INSTALLER }}
uses: BoundfoxStudios/action-xcode-staple@v1
with:
product-path: "installers/dist/SasView6.dmg"

- name: Sign binary
if: ${{ matrix.installer && startsWith(matrix.os, 'windows') }}
if: ${{ matrix.installer && startsWith(matrix.os, 'windows') && env.SIGN_INSTALLER }}
uses: lando/code-sign-action@v2
with:
file: installers/dist/setupSasView.exe
Expand Down

0 comments on commit 00ebdff

Please sign in to comment.