Skip to content

Commit 608f5ff

Browse files
author
Akos Kitta
committed
Skip the signing if the workflow runs from a fork.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
1 parent 22e02e1 commit 608f5ff

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

.github/workflows/build.yml

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,26 @@ jobs:
5050
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
5151
IS_NIGHTLY: ${{ github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main') }}
5252
IS_RELEASE: ${{ startsWith(github.ref, 'refs/tags/') }}
53+
IS_FORK: ${{ github.actor != 'arduino' }}
5354
run: |
5455
# See: https://www.electron.build/code-signing
55-
if [ "${{ runner.OS }}" = "macOS" ]; then
56-
export CSC_LINK="${{ runner.temp }}/signing_certificate.p12"
57-
# APPLE_SIGNING_CERTIFICATE_P12 secret was produced by following the procedure from:
58-
# https://www.kencochrane.com/2020/08/01/build-and-sign-golang-binaries-for-macos-with-github-actions/#exporting-the-developer-certificate
59-
echo "${{ secrets.APPLE_SIGNING_CERTIFICATE_P12 }}" | base64 --decode > "$CSC_LINK"
60-
61-
export CSC_KEY_PASSWORD="${{ secrets.KEYCHAIN_PASSWORD }}"
62-
63-
elif [ "${{ runner.OS }}" = "Windows" ]; then
64-
export CSC_LINK="${{ runner.temp }}/signing_certificate.pfx"
65-
echo "${{ secrets.WINDOWS_SIGNING_CERTIFICATE_PFX }}" | base64 --decode > "$CSC_LINK"
66-
67-
export CSC_KEY_PASSWORD="${{ secrets.WINDOWS_SIGNING_CERTIFICATE_PASSWORD }}"
56+
if [ $IS_FORK = true ]; then
57+
echo "Skipping the app signing: building from a fork."
58+
else
59+
if [ "${{ runner.OS }}" = "macOS" ]; then
60+
export CSC_LINK="${{ runner.temp }}/signing_certificate.p12"
61+
# APPLE_SIGNING_CERTIFICATE_P12 secret was produced by following the procedure from:
62+
# https://www.kencochrane.com/2020/08/01/build-and-sign-golang-binaries-for-macos-with-github-actions/#exporting-the-developer-certificate
63+
echo "${{ secrets.APPLE_SIGNING_CERTIFICATE_P12 }}" | base64 --decode > "$CSC_LINK"
64+
65+
export CSC_KEY_PASSWORD="${{ secrets.KEYCHAIN_PASSWORD }}"
66+
67+
elif [ "${{ runner.OS }}" = "Windows" ]; then
68+
export CSC_LINK="${{ runner.temp }}/signing_certificate.pfx"
69+
echo "${{ secrets.WINDOWS_SIGNING_CERTIFICATE_PFX }}" | base64 --decode > "$CSC_LINK"
70+
71+
export CSC_KEY_PASSWORD="${{ secrets.WINDOWS_SIGNING_CERTIFICATE_PASSWORD }}"
72+
fi
6873
fi
6974
7075
yarn --cwd ./electron/packager/
@@ -120,7 +125,7 @@ jobs:
120125

121126
publish:
122127
needs: changelog
123-
if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
128+
if: github.actor != 'arduino' && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main'))
124129
runs-on: ubuntu-latest
125130
steps:
126131
- name: Download [GitHub Actions]
@@ -141,7 +146,7 @@ jobs:
141146

142147
release:
143148
needs: changelog
144-
if: startsWith(github.ref, 'refs/tags/')
149+
if: github.actor != 'arduino' && startsWith(github.ref, 'refs/tags/')
145150
runs-on: ubuntu-latest
146151
steps:
147152
- name: Download [GitHub Actions]

electron/build/scripts/notarize.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ const { notarize } = require('electron-notarize');
33

44
exports.default = async function notarizing(context) {
55
if (!isCI) {
6-
console.log('Skipping notarization: not on CI.');
6+
console.log('Skipping the app notarization: not on CI.');
7+
return;
8+
}
9+
if (typeof process.env.IS_FORK === 'true') {
10+
console.log('Skipping the app notarization: building from a fork.');
711
return;
812
}
913
const { electronPlatformName, appOutDir } = context;

0 commit comments

Comments
 (0)