Skip to content

Commit 44f6ee4

Browse files
authored
chore(ci): add step to detect code signing (#2245)
* chore(ci): add step to detect code signing * fix variable name and add changefile
1 parent 3574a91 commit 44f6ee4

File tree

4 files changed

+27
-4
lines changed

4 files changed

+27
-4
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"cli.rs": patch
3+
---
4+
5+
Added `APPLE_SIGNING_IDENTITY` as supported environment variable for the bundler.

.github/workflows/artifacts-updater.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,16 @@ jobs:
9595
- name: build cli
9696
working-directory: ./tooling/cli.js
9797
run: yarn build
98+
- name: Check whether code signing should be enabled
99+
id: enablecodesigning
100+
env:
101+
ENABLE_CODE_SIGNING: ${{ secrets.APPLE_CERTIFICATE }}
102+
run: |
103+
echo "Enable code signing: ${{ env.ENABLE_CODE_SIGNING != '' }}"
104+
echo "::set-output name=enabled::${{ env.ENABLE_CODE_SIGNING != '' }}"
98105
# run only on tauri-apps/tauri repo (require secrets)
99106
- name: build sample artifacts + code signing (updater)
100-
if: github.repository == 'tauri-apps/tauri'
107+
if: steps.enablecodesigning.outputs.enabled == 'true'
101108
working-directory: ./examples/updater
102109
run: |
103110
yarn install
@@ -112,11 +119,12 @@ jobs:
112119
# Apple code signing testing
113120
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
114121
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
122+
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
115123
# Updater signature is exposed here to make sure it works in PR's
116124
TAURI_PRIVATE_KEY: dW50cnVzdGVkIGNvbW1lbnQ6IHJzaWduIGVuY3J5cHRlZCBzZWNyZXQga2V5ClJXUlRZMEl5YTBGV3JiTy9lRDZVd3NkL0RoQ1htZmExNDd3RmJaNmRMT1ZGVjczWTBKZ0FBQkFBQUFBQUFBQUFBQUlBQUFBQWdMekUzVkE4K0tWQ1hjeGt1Vkx2QnRUR3pzQjVuV0ZpM2czWXNkRm9hVUxrVnB6TUN3K1NheHJMREhQbUVWVFZRK3NIL1VsMDBHNW5ET1EzQno0UStSb21nRW4vZlpTaXIwZFh5ZmRlL1lSN0dKcHdyOUVPclVvdzFhVkxDVnZrbHM2T1o4Tk1NWEU9Cg==
117125
# run on PRs and forks
118126
- name: build sample artifacts (updater)
119-
if: github.repository != 'tauri-apps/tauri'
127+
if: steps.enablecodesigning.outputs.enabled != 'true'
120128
working-directory: ./examples/updater
121129
run: |
122130
yarn install

examples/updater/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"useBootstrapper": false
2929
},
3030
"macOS": {
31-
"signingIdentity": "Developer ID Application: David Lemarier (3KF8V3679C)",
31+
"signingIdentity": null,
3232
"entitlements": "../entitlements.plist",
3333
"frameworks": [],
3434
"minimumSystemVersion": "",

tooling/cli.rs/src/interface/rust.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,16 @@ fn tauri_config_to_bundle_settings(
390390
}
391391
}
392392

393+
let signing_identity = match std::env::var_os("APPLE_SIGNING_IDENTITY") {
394+
Some(signing_identity) => Some(
395+
signing_identity
396+
.to_str()
397+
.expect("failed to convert APPLE_SIGNING_IDENTITY to string")
398+
.to_string(),
399+
),
400+
None => config.macos.signing_identity,
401+
};
402+
393403
Ok(BundleSettings {
394404
identifier: config.identifier,
395405
icon: config.icon,
@@ -424,7 +434,7 @@ fn tauri_config_to_bundle_settings(
424434
license: config.macos.license,
425435
use_bootstrapper: Some(config.macos.use_bootstrapper),
426436
exception_domain: config.macos.exception_domain,
427-
signing_identity: config.macos.signing_identity,
437+
signing_identity,
428438
entitlements: config.macos.entitlements,
429439
},
430440
windows: WindowsSettings {

0 commit comments

Comments
 (0)