From d79f7786e7298d779b940807017d202ce615c24e Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 26 Nov 2024 13:14:24 +0100 Subject: [PATCH 1/5] just testing to see what happens without --skip-jenkins in github ci --- crates/tauri-bundler/src/bundle/macos/dmg/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs b/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs index de525e2966bf..f9b69d3c8cdf 100644 --- a/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs +++ b/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs @@ -175,7 +175,7 @@ pub fn bundle_project(settings: &Settings, bundles: &[Bundle]) -> crate::Result< // Issue #592 - Building MacOS dmg files on CI // https://github.com/tauri-apps/tauri/issues/592 if let Some(value) = env::var_os("CI") { - if value == "true" { + if value == "true" && !env::var_os("GITHUB_RUN_ID").unwrap_or_default().is_empty() { bundle_dmg_cmd.arg("--skip-jenkins"); } } From 1affb291f2ad2b1c811cfce3d6ec6af95cbceb92 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 26 Nov 2024 16:10:33 +0100 Subject: [PATCH 2/5] confused emoji --- crates/tauri-bundler/src/bundle/macos/dmg/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs b/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs index f9b69d3c8cdf..65bcaea04ad6 100644 --- a/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs +++ b/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs @@ -176,7 +176,10 @@ pub fn bundle_project(settings: &Settings, bundles: &[Bundle]) -> crate::Result< // https://github.com/tauri-apps/tauri/issues/592 if let Some(value) = env::var_os("CI") { if value == "true" && !env::var_os("GITHUB_RUN_ID").unwrap_or_default().is_empty() { + eprintln!("CI: TRUE"); bundle_dmg_cmd.arg("--skip-jenkins"); + } else { + eprintln!("CI: FALSE"); } } From a5169067dea11c7f7c51d4739ae12ab25ab0280f Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 26 Nov 2024 16:47:43 +0100 Subject: [PATCH 3/5] x --- .../tauri-bundler/src/bundle/macos/dmg/mod.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs b/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs index 65bcaea04ad6..6b703f56c28e 100644 --- a/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs +++ b/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs @@ -174,13 +174,18 @@ pub fn bundle_project(settings: &Settings, bundles: &[Bundle]) -> crate::Result< // Issue #592 - Building MacOS dmg files on CI // https://github.com/tauri-apps/tauri/issues/592 - if let Some(value) = env::var_os("CI") { - if value == "true" && !env::var_os("GITHUB_RUN_ID").unwrap_or_default().is_empty() { - eprintln!("CI: TRUE"); - bundle_dmg_cmd.arg("--skip-jenkins"); - } else { - eprintln!("CI: FALSE"); + if !env::var_os("TAURI_BUNDLER_DMG_IGNORE_CI").unwrap_or_default() != "true" { + eprintln!("IGNORE_CI TRUE"); + if let Some(value) = env::var_os("CI") { + if value == "true" { + eprintln!("CI: TRUE"); + bundle_dmg_cmd.arg("--skip-jenkins"); + } else { + eprintln!("CI: FALSE"); + } } + } else { + eprintln!("IGNORE_CI FALSE"); } log::info!(action = "Running"; "bundle_dmg.sh"); From 4e76300d33506029780279ae1c4bd034b92ab2d9 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 26 Nov 2024 17:01:17 +0100 Subject: [PATCH 4/5] oops --- crates/tauri-bundler/src/bundle/macos/dmg/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs b/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs index 6b703f56c28e..a42361714693 100644 --- a/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs +++ b/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs @@ -174,7 +174,7 @@ pub fn bundle_project(settings: &Settings, bundles: &[Bundle]) -> crate::Result< // Issue #592 - Building MacOS dmg files on CI // https://github.com/tauri-apps/tauri/issues/592 - if !env::var_os("TAURI_BUNDLER_DMG_IGNORE_CI").unwrap_or_default() != "true" { + if env::var_os("TAURI_BUNDLER_DMG_IGNORE_CI").unwrap_or_default() != "true" { eprintln!("IGNORE_CI TRUE"); if let Some(value) = env::var_os("CI") { if value == "true" { From 88008fe14cb9f87d2abe5ca364fea9a35fe103fd Mon Sep 17 00:00:00 2001 From: FabianLars Date: Tue, 26 Nov 2024 17:31:16 +0100 Subject: [PATCH 5/5] cleanup --- .changes/bundler-skip-ci.md | 5 +++++ crates/tauri-bundler/src/bundle/macos/dmg/mod.rs | 5 ----- crates/tauri-cli/ENVIRONMENT_VARIABLES.md | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 .changes/bundler-skip-ci.md diff --git a/.changes/bundler-skip-ci.md b/.changes/bundler-skip-ci.md new file mode 100644 index 000000000000..66ad0f001898 --- /dev/null +++ b/.changes/bundler-skip-ci.md @@ -0,0 +1,5 @@ +--- +tauri-bundler: 'patch:enhance' +--- + +The bundler now reads the `TAURI_BUNDLER_DMG_IGNORE_CI` env var to decide whether to check for `CI: true` when building DMG files. diff --git a/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs b/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs index a42361714693..7df50a055276 100644 --- a/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs +++ b/crates/tauri-bundler/src/bundle/macos/dmg/mod.rs @@ -175,17 +175,12 @@ pub fn bundle_project(settings: &Settings, bundles: &[Bundle]) -> crate::Result< // Issue #592 - Building MacOS dmg files on CI // https://github.com/tauri-apps/tauri/issues/592 if env::var_os("TAURI_BUNDLER_DMG_IGNORE_CI").unwrap_or_default() != "true" { - eprintln!("IGNORE_CI TRUE"); if let Some(value) = env::var_os("CI") { if value == "true" { - eprintln!("CI: TRUE"); bundle_dmg_cmd.arg("--skip-jenkins"); } else { - eprintln!("CI: FALSE"); } } - } else { - eprintln!("IGNORE_CI FALSE"); } log::info!(action = "Running"; "bundle_dmg.sh"); diff --git a/crates/tauri-cli/ENVIRONMENT_VARIABLES.md b/crates/tauri-cli/ENVIRONMENT_VARIABLES.md index ed40ed865fd2..40173018f235 100644 --- a/crates/tauri-cli/ENVIRONMENT_VARIABLES.md +++ b/crates/tauri-cli/ENVIRONMENT_VARIABLES.md @@ -17,6 +17,7 @@ These environment variables are inputs to the CLI which may have an equivalent C - `TAURI_BUNDLER_WIX_FIPS_COMPLIANT` — Specify the bundler's WiX `FipsCompliant` option. - `TAURI_BUNDLER_TOOLS_GITHUB_MIRROR` - Specify a GitHub mirror to download files and tools used by tauri bundler. - `TAURI_BUNDLER_TOOLS_GITHUB_MIRROR_TEMPLATE` - Specify a GitHub mirror template to download files and tools used by tauri bundler, for example: `https://mirror.example.com///releases/download//`. +- `TAURI_BUNDLER_DMG_IGNORE_CI` - Disable the check for `CI: true` in the `.dmg` bundler. - `TAURI_SKIP_SIDECAR_SIGNATURE_CHECK` - Skip signing sidecars. - `TAURI_SIGNING_PRIVATE_KEY` — Private key used to sign your app bundles, can be either a string or a path to the file. - `TAURI_SIGNING_PRIVATE_KEY_PASSWORD` — The signing private key password, see `TAURI_SIGNING_PRIVATE_KEY`.