update: 更新自动构建工具逻辑
parent
8e2229687e
commit
64fedf4856
|
|
@ -32,6 +32,9 @@ namespace Guru.Editor
|
||||||
public string IOSTargetVersion = ""; // IOS SDK 版本设置 ( iOS 发布专用 )
|
public string IOSTargetVersion = ""; // IOS SDK 版本设置 ( iOS 发布专用 )
|
||||||
public string IOSTeamId = ""; // IOS 打包 TeamId ( iOS 使用专用的开发证书后开启 )
|
public string IOSTeamId = ""; // IOS 打包 TeamId ( iOS 使用专用的开发证书后开启 )
|
||||||
public string CompanyName = ""; // 发布厂商的名称
|
public string CompanyName = ""; // 发布厂商的名称
|
||||||
|
//------------ Publish -------------
|
||||||
|
public bool AutoPublish = false;
|
||||||
|
public string PgyerAPIKey = "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,6 +120,10 @@ namespace Guru.Editor
|
||||||
Open(outputDir);
|
Open(outputDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (buildParam.AutoPublish)
|
||||||
|
{
|
||||||
|
GuruPublishHelper.Publish(apkPath, buildParam.PgyerAPIKey); // 直接发布版本
|
||||||
|
}
|
||||||
return apkPath;
|
return apkPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -202,8 +202,12 @@ namespace Guru.Editor
|
||||||
// SelectAndPublish("aab");
|
// SelectAndPublish("aab");
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
public static void SelectAndPublish(string extension = "apk", string apiKey = "")
|
/// 直接发布版本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="appPath"></param>
|
||||||
|
/// <param name="apiKey"></param>
|
||||||
|
public static void Publish(string appPath, string apiKey = "")
|
||||||
{
|
{
|
||||||
string bash_path = EvnCheck();
|
string bash_path = EvnCheck();
|
||||||
if (string.IsNullOrEmpty(bash_path))
|
if (string.IsNullOrEmpty(bash_path))
|
||||||
|
|
@ -211,16 +215,25 @@ namespace Guru.Editor
|
||||||
ShowDialog("找不到 Bash 执行文件", $"Bash文件不存在: {bash_path}!");
|
ShowDialog("找不到 Bash 执行文件", $"Bash文件不存在: {bash_path}!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!File.Exists(appPath))
|
||||||
string file = EditorUtility.OpenFilePanel("选择包体", $"~/Downloads", extension);
|
|
||||||
|
|
||||||
if (!File.Exists(file))
|
|
||||||
{
|
{
|
||||||
ShowDialog("找不到包体文件", $"包体文件不存在: {file}!");
|
ShowDialog("找不到包体文件", $"包体文件不存在: {appPath}!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PgyerAPI.PublishToPgyer(file, apiKey, bash_path, OnResponse);
|
PgyerAPI.PublishToPgyer(appPath, apiKey, bash_path, OnResponse);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 选择文件及发布版本
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="extension"></param>
|
||||||
|
/// <param name="apiKey"></param>
|
||||||
|
public static void SelectAndPublish(string extension = "apk", string apiKey = "")
|
||||||
|
{
|
||||||
|
string file = EditorUtility.OpenFilePanel("选择包体", $"~/Downloads", extension);
|
||||||
|
Publish(file, apiKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue