提交代码

This commit is contained in:
zpc 2024-07-09 14:11:27 +08:00
parent 48811946e3
commit 90476c250d
2 changed files with 31 additions and 2 deletions

View File

@ -1,4 +1,4 @@
using CodeRelease.BLL;
using CodeRelease.BLL;
using CodeRelease.Model;
using CodeRelease.Utile;
@ -8,6 +8,8 @@ using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
using System;
namespace CodeRelease.Controllers
@ -80,7 +82,26 @@ namespace CodeRelease.Controllers
return obj;
}
}
else if (!string.IsNullOrEmpty(releaseAction.Release.TargetCommitish))
{
var version = releaseAction.Release.TagName;
var download = giteaWebhookConfig.BrowserDownloadFileUrl + version + "/";
if (!Directory.Exists(download))
{
Directory.CreateDirectory(download);
}
FileDownloader fileDownloader = new FileDownloader();
//giteaWebhookConfig.BrowserDownloadFileUrl.Replace("{version}", version);
var mingling = giteaWebhookConfig.MakeFile
.Replace("{version}", version)
.Replace("{dir_file_path}", download + "/")
.Replace("{target_commitish}", releaseAction.Release.TargetCommitish);
LinuxExecuteCommand linuxExecuteCommand = new LinuxExecuteCommand();
//make public version=0.0.1 dir_file_path=/
var obj = await linuxExecuteCommand.ExecuteCommand(mingling);
return obj;
}
}
}

View File

@ -20,7 +20,7 @@
//make
"MakeFile": "make public version={version} dir_file_path={dir_file_path} -f /disk/CodeRelease/test/makefile",
//
"BrowserDownloadFileUrl": "I:/Gitea/test/disk/aiweb/"
"BrowserDownloadFileUrl": ""
//
},
{
@ -30,6 +30,14 @@
//
"BrowserDownloadFileUrl": "I:/Gitea/test/disk/aiweb/"
//
},
{
"Name": "miaoyu",
//make make public version=0.0.2 target_commitish=dev -f /disk/Public/miaoyu/makefile
"MakeFile": "make public version={version} target_commitish={target_commitish} -f /disk/Public/miaoyu/makefile",
//
"BrowserDownloadFileUrl": ""
//
}
]