Skip to content

Commit ad354f6

Browse files
committed
also modify desc
1 parent 8dde46d commit ad354f6

1 file changed

Lines changed: 17 additions & 4 deletions

File tree

src/Uploader/Program.cs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ namespace Uploader
1212
{
1313
static class Program
1414
{
15-
static async Task Main(string host = "", string name = "", string password = "", bool createSnapshot = false)
15+
static async Task Main(string host, string name, string password, bool createSnapshot = false)
1616
{
1717
Log.Logger = new LoggerConfiguration()
1818
.Enrich.FromLogContext()
@@ -45,15 +45,14 @@ static async Task Main(string host = "", string name = "", string password = "",
4545

4646
Console.WriteLine("待上传的文件数目:{0}", files.Count());
4747

48-
49-
5048
IEnumerable<Task> tasks =
5149
[
5250
//UploadToServer(host, name, password, files),
5351
createSnapshot ? UploadSnapshotAssets(client, files): Task.CompletedTask,
5452
UpdateAutobuildAssets(client, files)
5553
];
5654
await Task.WhenAll(tasks);
55+
5756
}
5857

5958

@@ -127,6 +126,20 @@ async static Task UpdateAutobuildAssets(GitHubClient client, IEnumerable<(string
127126
var release = await client.Repository.Release.Get(repoId, "autobuild");
128127
Log.Information("<Autobuild> 获取 autobuild Release");
129128

129+
var timestamp = DateTime.UtcNow.ToString("yyyyMMddHHmmss");
130+
var desc = new ReleaseUpdate()
131+
{
132+
Body = $"""
133+
## 汉化资源包 Autobuild
134+
135+
### 最后更新时间
136+
137+
- {timestamp}
138+
"""
139+
};
140+
await client.Repository.Release.Edit(repoId, release.Id, desc);
141+
Log.Information("<Autobuild> 更新 Release 简介:时间 {0}", timestamp);
142+
130143
var assets = release.Assets;
131144
var lookup = assets.Select(_ => (_.Name, _)).ToDictionary();
132145
foreach (var (name, file) in files)
@@ -136,7 +149,7 @@ async static Task UpdateAutobuildAssets(GitHubClient client, IEnumerable<(string
136149
if (lookup.TryGetValue(name, out ReleaseAsset? asset))
137150
{
138151
await client.Repository.Release.DeleteAsset(repoId, asset.Id);
139-
Log.Information("<Autobuild> 删除旧文件:{0}");
152+
Log.Information("<Autobuild> 删除旧文件:{0}", name);
140153
}
141154
var newAsset = new ReleaseAssetUpload(
142155
name,

0 commit comments

Comments
 (0)