ソースを参照

fix(bundler): Prevent CI to failed on macos (#592) (#640)

Read `CI` env variable and if equal to true we set the DMG builder in CI mode.

See https://github.com/create-dmg/create-dmg/blob/master/create-dmg#L183

Signed-off-by: David L <david@lemarier.ca>
david 5 年 前
コミット
bf1d3c1ffc
1 ファイル変更12 行追加0 行削除
  1. 12 0
      cli/tauri-bundler/src/bundle/dmg_bundle.rs

+ 12 - 0
cli/tauri-bundler/src/bundle/dmg_bundle.rs

@@ -4,6 +4,7 @@ use crate::Settings;
 
 use anyhow::Context;
 
+use std::env;
 use std::fs::{self, write};
 use std::path::PathBuf;
 use std::process::{Command, Stdio};
@@ -91,6 +92,17 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
     args.push(license_path);
   }
 
+  // Issue #592 - Building MacOS dmg files on CI
+  // https://github.com/tauri-apps/tauri/issues/592
+  match env::var_os("CI") {
+    Some(value) => {
+      if value == "true" {
+        args.push("--skip-jenkins");
+      }
+    }
+    None => (),
+  }
+
   // execute the bundle script
   let status = Command::new(&bundle_script_path)
     .current_dir(bundle_dir.clone())