From c68fbe9d96358a77e2ad5dd1b0f7f47838e29bab Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Thu, 7 Dec 2023 14:36:21 +0800 Subject: [PATCH 01/15] Auto sync appxmanifest --- .github/workflows/PublishDistribution.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/PublishDistribution.yml b/.github/workflows/PublishDistribution.yml index e052ffed..f192bd4d 100644 --- a/.github/workflows/PublishDistribution.yml +++ b/.github/workflows/PublishDistribution.yml @@ -18,3 +18,11 @@ jobs: PURGE_URL: ${{ secrets.PURGE_URL }} run: | curl -X PATCH $PURGE_URL + + - name: Sync development appxmanifest + env: + VERSION: ${{ github.ref }} + shell: pwsh + run: | + $ver = ' Version="'+$Env:VERSION+'.0"' + $content = (Get-Content src/Snap.Hutao/Snap.Hutao/Package.development.appxmanifest -Encoding UTF8) -replace ' Version="([0-9\\.]+)"', $ver From 7ef2834b422dba889de00179b9775a01fb98bc9c Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Thu, 7 Dec 2023 19:16:57 +0800 Subject: [PATCH 02/15] Hello cake --- .config/dotnet-tools.json | 12 ++++ azure-pipelines.yml | 96 +++------------------------- build.cake | 128 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 149 insertions(+), 87 deletions(-) create mode 100644 .config/dotnet-tools.json create mode 100644 build.cake diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 00000000..3f287339 --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "cake.tool": { + "version": "4.0.0", + "commands": [ + "dotnet-cake" + ] + } + } +} diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 55f9c894..6d2b3c33 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -30,7 +30,7 @@ pr: - .github/ISSUE_TEMPLATE/*.yml - .github/workflows/*.yml - src/Snap.Hutao/Snap.Hutao/Resource/Localization/*.resx - + pool: name: Default @@ -58,93 +58,10 @@ steps: version: '8.x' includePreviewVersions: true -- task: NuGetToolInstaller@1 - name: 'NuGetToolInstaller' - displayName: 'NuGet Installer' - -- task: NuGetCommand@2 - displayName: NuGet restore - inputs: - command: 'restore' - restoreSolution: '$(solution)' - feedsToUse: 'config' - nugetConfigPath: '$(Build.SourcesDirectory)/NuGet.Config' - -- task: MsixPackaging@1 - displayName: Build binary package - inputs: - outputPath: '$(Build.ArtifactStagingDirectory)/' - solution: '$(solution)' - clean: false - generateBundle: false - buildConfiguration: 'Release' - buildPlatform: 'x64' - updateAppVersion: false - appPackageDistributionMode: 'SideloadOnly' - msbuildLocationMethod: 'location' - msbuildLocation: 'C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Msbuild\Current\Bin\MSBuild.exe' - -- task: MagicChunks@2 - inputs: - sourcePath: '$(Build.SourcesDirectory)\src\Snap.Hutao\Snap.Hutao\bin\x64\Release\net8.0-windows10.0.22621.0\win-x64\AppxManifest.xml' - fileType: 'Xml' - targetPathType: 'source' - transformationType: 'json' - transformations: | - { - "Package/Identity/@Name": "7f0db578-026f-4e0b-a75b-d5d06bb0a74c", - "Package/Identity/@Publisher": "CN=DGP Studio CI", - "Package/Identity/@Version": "$(build_date).$(rev_number)", - "Package/Properties/DisplayName": "胡桃 Alpha", - "Package/Properties/PublisherDisplayName":"DGP Studio CI", - "Package/Applications/Application/uap:VisualElements/@DisplayName": "胡桃 Alpha" - } - - task: CmdLine@2 - displayName: Create resources folder + displayName: dotnet cake inputs: - script: | - mkdir Assets - - mkdir Resource - workingDirectory: '$(Build.SourcesDirectory)\src\Snap.Hutao\Snap.Hutao\bin\x64\Release\net8.0-windows10.0.22621.0\win-x64' - - -- task: CopyFiles@2 - displayName: Copy Assets Folder - inputs: - SourceFolder: '$(Build.SourcesDirectory)\src\Snap.Hutao\Snap.Hutao\Assets' - Contents: '**' - TargetFolder: '$(Build.SourcesDirectory)\src\Snap.Hutao\Snap.Hutao\bin\x64\Release\net8.0-windows10.0.22621.0\win-x64\Assets' - -- task: CopyFiles@2 - displayName: Copy Resource Folder - inputs: - SourceFolder: '$(Build.SourcesDirectory)\src\Snap.Hutao\Snap.Hutao\Resource' - Contents: '**' - TargetFolder: '$(Build.SourcesDirectory)\src\Snap.Hutao\Snap.Hutao\bin\x64\Release\net8.0-windows10.0.22621.0\win-x64\Resource' - -- task: CmdLine@2 - displayName: Build MSIX - inputs: - script: '"C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64\makeappx.exe" pack /d $(Build.SourcesDirectory)\src\Snap.Hutao\Snap.Hutao\bin\x64\Release\net8.0-windows10.0.22621.0\win-x64 /p $(Build.ArtifactStagingDirectory)/Snap.Hutao.Alpha-$(build_date).$(rev_number).msix' - -- task: MsixSigning@1 - name: signMsix - displayName: Sign MSIX package - inputs: - package: '$(Build.ArtifactStagingDirectory)/Snap.Hutao.Alpha-$(build_date).$(rev_number).msix' - certificate: 'DGP_Studio_CI.pfx' - passwordVariable: 'pw' - condition: succeeded() - - -#- task: PublishPipelineArtifact@1 -# displayName: 'Upload Output' -# inputs: -# targetPath: '$(Build.ArtifactStagingDirectory)/' -# artifact: 'Output' -# publishLocation: 'pipeline' + script: dotnet tool restore && dotnet cake --Version=$(build_date).$(rev_number) --pw=$(pw) - task: DownloadSecureFile@1 name: cerFile @@ -152,10 +69,15 @@ steps: inputs: secureFile: 'Snap.Hutao.CI.cer' +- task: DownloadSecureFile@1 + displayName: Download PFX + inputs: + secureFile: 'DGP_Studio_CI.pfx' + - task: GitHubRelease@1 inputs: gitHubConnection: 'github.com_Masterain' - repositoryName: 'DGP-Studio/Snap.Hutao' + repositoryName: 'DGP-Studio/Snap.Hutao.CI.Test' action: 'create' target: '$(Build.SourceVersion)' tagSource: 'userSpecifiedTag' diff --git a/build.cake b/build.cake new file mode 100644 index 00000000..27344afc --- /dev/null +++ b/build.cake @@ -0,0 +1,128 @@ +#tool "nuget:?package=nuget.commandline&version=6.5.0" +var target = Argument("target", "Build"); +var configuration = Argument("configuration", "Release"); + +var version = HasArgument("Version") ? Argument("Version") : throw new Exception("Empty Version"); +var pw = HasArgument("pw") ? Argument("pw") : throw new Exception("Empty pw"); + +var solution = System.IO.Path.Combine(AzurePipelines.Environment.Build.SourcesDirectory.FullPath, "src", "Snap.Hutao", "Snap.Hutao.sln"); +var project = System.IO.Path.Combine(AzurePipelines.Environment.Build.SourcesDirectory.FullPath, "src", "Snap.Hutao", "Snap.Hutao", "Snap.Hutao.csproj"); +var binPath = System.IO.Path.Combine(AzurePipelines.Environment.Build.SourcesDirectory.FullPath, "src", "Snap.Hutao", "Snap.Hutao", "bin", "x64", "Release", "net8.0-windows10.0.22621.0", "win-x64"); +var outputPath = AzurePipelines.Environment.Build.ArtifactStagingDirectory.FullPath; + +Task("Build") + .IsDependentOn("Build binary package") + .IsDependentOn("Copy files") + .IsDependentOn("Build MSIX") + .IsDependentOn("Sign MSIX"); + +Task("NuGet Restore") + .Does(() => +{ + Information("Restoring packages..."); + DotNetRestore(project, new DotNetRestoreSettings + { + Verbosity = DotNetVerbosity.Detailed, + Interactive = false, + ConfigFile = System.IO.Path.Combine(AzurePipelines.Environment.Build.SourcesDirectory.FullPath, "NuGet.Config") + }); +}); + +Task("Generate AppxManifest") + .Does(() => +{ + Information("Generating AppxManifest..."); + + var manifestPath = System.IO.Path.Combine(AzurePipelines.Environment.Build.SourcesDirectory.FullPath, "src", "Snap.Hutao", "Snap.Hutao", "Package.appxmanifest"); + var manifest = System.IO.File.ReadAllText(manifestPath); + + manifest = manifest + .Replace("Snap Hutao", "Snap Hutao Alpha") + .Replace("胡桃", "胡桃 Alpha") + .Replace("DGP Studio", "DGP Studio CI"); + manifest = System.Text.RegularExpressions.Regex.Replace(manifest, " Name=\"([^\"]*)\"", " Name=\"7f0db578-026f-4e0b-a75b-d5d06bb0a74c\""); + manifest = System.Text.RegularExpressions.Regex.Replace(manifest, " Publisher=\"([^\"]*)\"", " Publisher=\"CN=DGP Studio CI\""); + manifest = System.Text.RegularExpressions.Regex.Replace(manifest, " Version=\"([0-9\\.]+)\"", $" Version=\"{version}\""); + + System.IO.File.WriteAllText(manifestPath, manifest); + + Information("Generated."); +}); + +Task("Build binary package") + .IsDependentOn("NuGet Restore") + .IsDependentOn("Generate AppxManifest") + .Does(() => +{ + Information("Building binary package..."); + + var settings = new DotNetBuildSettings + { + Configuration = configuration + }; + + settings.MSBuildSettings = new DotNetMSBuildSettings + { + ArgumentCustomization = args => args.Append("/p:Platform=x64") + .Append("/p:UapAppxPackageBuildMode=SideloadOnly") + .Append("/p:AppxPackageSigningEnabled=false") + .Append("/p:AppxBundle=Never") + .Append("/p:AppxPackageOutput=" + outputPath) + }; + + DotNetBuild(project, settings); +}); + +Task("Copy files") + .IsDependentOn("Build binary package") + .Does(() => +{ + Information("Copying assets..."); + CopyDirectory( + System.IO.Path.Combine(AzurePipelines.Environment.Build.SourcesDirectory.FullPath, "src", "Snap.Hutao", "Snap.Hutao", "Assets"), + System.IO.Path.Combine(binPath, "Assets") + ); + + Information("Copying resource..."); + CopyDirectory( + System.IO.Path.Combine(AzurePipelines.Environment.Build.SourcesDirectory.FullPath, "src", "Snap.Hutao", "Snap.Hutao", "Resource"), + System.IO.Path.Combine(binPath, "Resource") + ); +}); + +Task("Build MSIX") + .IsDependentOn("Build binary package") + .IsDependentOn("Copy files") + .Does(() => +{ + var p = StartProcess( + "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\x64\\makeappx.exe", + new ProcessSettings + { + Arguments = "pack /d " + binPath + " /p " + System.IO.Path.Combine(outputPath, $"Snap.Hutao.Alpha-{version}.msix") + } + ); + if (p != 0) + { + throw new InvalidOperationException("Build failed with exit code " + p); + } +}); + +Task("Sign MSIX") + .IsDependentOn("Build MSIX") + .Does(() => +{ + var p = StartProcess( + "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\x64\\signtool.exe", + new ProcessSettings + { + Arguments = "sign /debug /v /a /fd SHA256 /f " + System.IO.Path.Combine(AzurePipelines.Environment.Agent.HomeDirectory.FullPath, "_work", "_temp", "DGP_Studio_CI.pfx") + " /p " + pw + " " + System.IO.Path.Combine(outputPath, $"Snap.Hutao.Alpha-{version}.msix") + } + ); + if (p != 0) + { + throw new InvalidOperationException("Build failed with exit code " + p); + } +}); + +RunTarget(target); From e090d7e04b0fa1e277901e71e21d7c513072160b Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Thu, 7 Dec 2023 19:18:46 +0800 Subject: [PATCH 03/15] wrong repo --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6d2b3c33..31d95af2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -77,7 +77,7 @@ steps: - task: GitHubRelease@1 inputs: gitHubConnection: 'github.com_Masterain' - repositoryName: 'DGP-Studio/Snap.Hutao.CI.Test' + repositoryName: 'DGP-Studio/Snap.Hutao' action: 'create' target: '$(Build.SourceVersion)' tagSource: 'userSpecifiedTag' From bde51220605d408a0fa81759006e7b03871e1cc2 Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Fri, 8 Dec 2023 10:01:34 +0800 Subject: [PATCH 04/15] change target repo and avoid abs path --- azure-pipelines.yml | 2 +- build.cake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 31d95af2..a4ca8a38 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -77,7 +77,7 @@ steps: - task: GitHubRelease@1 inputs: gitHubConnection: 'github.com_Masterain' - repositoryName: 'DGP-Studio/Snap.Hutao' + repositoryName: 'DGP-Automation/Hutao-Auto-Release' action: 'create' target: '$(Build.SourceVersion)' tagSource: 'userSpecifiedTag' diff --git a/build.cake b/build.cake index 27344afc..31a5f671 100644 --- a/build.cake +++ b/build.cake @@ -96,7 +96,7 @@ Task("Build MSIX") .Does(() => { var p = StartProcess( - "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\x64\\makeappx.exe", + "makeappx.exe", new ProcessSettings { Arguments = "pack /d " + binPath + " /p " + System.IO.Path.Combine(outputPath, $"Snap.Hutao.Alpha-{version}.msix") @@ -113,7 +113,7 @@ Task("Sign MSIX") .Does(() => { var p = StartProcess( - "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.22621.0\\x64\\signtool.exe", + "signtool.exe", new ProcessSettings { Arguments = "sign /debug /v /a /fd SHA256 /f " + System.IO.Path.Combine(AzurePipelines.Environment.Agent.HomeDirectory.FullPath, "_work", "_temp", "DGP_Studio_CI.pfx") + " /p " + pw + " " + System.IO.Path.Combine(outputPath, $"Snap.Hutao.Alpha-{version}.msix") From 1ab1d182af95c74679fa2b3ec82c463137ed3760 Mon Sep 17 00:00:00 2001 From: qhy040404 <45379733+qhy040404@users.noreply.github.com> Date: Fri, 8 Dec 2023 10:30:07 +0800 Subject: [PATCH 05/15] Update PublishDistribution.yml --- .github/workflows/PublishDistribution.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/PublishDistribution.yml b/.github/workflows/PublishDistribution.yml index f192bd4d..e052ffed 100644 --- a/.github/workflows/PublishDistribution.yml +++ b/.github/workflows/PublishDistribution.yml @@ -18,11 +18,3 @@ jobs: PURGE_URL: ${{ secrets.PURGE_URL }} run: | curl -X PATCH $PURGE_URL - - - name: Sync development appxmanifest - env: - VERSION: ${{ github.ref }} - shell: pwsh - run: | - $ver = ' Version="'+$Env:VERSION+'.0"' - $content = (Get-Content src/Snap.Hutao/Snap.Hutao/Package.development.appxmanifest -Encoding UTF8) -replace ' Version="([0-9\\.]+)"', $ver From 50c0fa2061e54ca089d6d7134cea859e2a65cd8f Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Fri, 8 Dec 2023 11:40:28 +0800 Subject: [PATCH 06/15] abstract --- build.cake | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/build.cake b/build.cake index 31a5f671..aa282fe7 100644 --- a/build.cake +++ b/build.cake @@ -5,11 +5,17 @@ var configuration = Argument("configuration", "Release"); var version = HasArgument("Version") ? Argument("Version") : throw new Exception("Empty Version"); var pw = HasArgument("pw") ? Argument("pw") : throw new Exception("Empty pw"); -var solution = System.IO.Path.Combine(AzurePipelines.Environment.Build.SourcesDirectory.FullPath, "src", "Snap.Hutao", "Snap.Hutao.sln"); -var project = System.IO.Path.Combine(AzurePipelines.Environment.Build.SourcesDirectory.FullPath, "src", "Snap.Hutao", "Snap.Hutao", "Snap.Hutao.csproj"); -var binPath = System.IO.Path.Combine(AzurePipelines.Environment.Build.SourcesDirectory.FullPath, "src", "Snap.Hutao", "Snap.Hutao", "bin", "x64", "Release", "net8.0-windows10.0.22621.0", "win-x64"); +// Default Azure Pipelines + +var repoDir = AzurePipelines.Environment.Build.SourcesDirectory.FullPath; var outputPath = AzurePipelines.Environment.Build.ArtifactStagingDirectory.FullPath; +var solution = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao.sln"); +var project = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Snap.Hutao.csproj"); +var binPath = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "bin", "x64", "Release", "net8.0-windows10.0.22621.0", "win-x64"); + +var pfxFile = System.IO.Path.Combine(AzurePipelines.Environment.Agent.HomeDirectory.FullPath, "_work", "_temp", "DGP_Studio_CI.pfx"); + Task("Build") .IsDependentOn("Build binary package") .IsDependentOn("Copy files") @@ -20,11 +26,13 @@ Task("NuGet Restore") .Does(() => { Information("Restoring packages..."); + + var nugetConfig = System.IO.Path.Combine(repoDir, "NuGet.Config"); DotNetRestore(project, new DotNetRestoreSettings { Verbosity = DotNetVerbosity.Detailed, Interactive = false, - ConfigFile = System.IO.Path.Combine(AzurePipelines.Environment.Build.SourcesDirectory.FullPath, "NuGet.Config") + ConfigFile = nugetConfig }); }); @@ -33,18 +41,18 @@ Task("Generate AppxManifest") { Information("Generating AppxManifest..."); - var manifestPath = System.IO.Path.Combine(AzurePipelines.Environment.Build.SourcesDirectory.FullPath, "src", "Snap.Hutao", "Snap.Hutao", "Package.appxmanifest"); - var manifest = System.IO.File.ReadAllText(manifestPath); + var manifest = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Package.appxmanifest"); + var content = System.IO.File.ReadAllText(manifest); - manifest = manifest + content = content .Replace("Snap Hutao", "Snap Hutao Alpha") .Replace("胡桃", "胡桃 Alpha") .Replace("DGP Studio", "DGP Studio CI"); - manifest = System.Text.RegularExpressions.Regex.Replace(manifest, " Name=\"([^\"]*)\"", " Name=\"7f0db578-026f-4e0b-a75b-d5d06bb0a74c\""); - manifest = System.Text.RegularExpressions.Regex.Replace(manifest, " Publisher=\"([^\"]*)\"", " Publisher=\"CN=DGP Studio CI\""); - manifest = System.Text.RegularExpressions.Regex.Replace(manifest, " Version=\"([0-9\\.]+)\"", $" Version=\"{version}\""); + content = System.Text.RegularExpressions.Regex.Replace(content, " Name=\"([^\"]*)\"", " Name=\"7f0db578-026f-4e0b-a75b-d5d06bb0a74c\""); + content = System.Text.RegularExpressions.Regex.Replace(content, " Publisher=\"([^\"]*)\"", " Publisher=\"CN=DGP Studio CI\""); + content = System.Text.RegularExpressions.Regex.Replace(content, " Version=\"([0-9\\.]+)\"", $" Version=\"{version}\""); - System.IO.File.WriteAllText(manifestPath, manifest); + System.IO.File.WriteAllText(manifest, content); Information("Generated."); }); @@ -79,13 +87,13 @@ Task("Copy files") { Information("Copying assets..."); CopyDirectory( - System.IO.Path.Combine(AzurePipelines.Environment.Build.SourcesDirectory.FullPath, "src", "Snap.Hutao", "Snap.Hutao", "Assets"), + System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Assets"), System.IO.Path.Combine(binPath, "Assets") ); Information("Copying resource..."); CopyDirectory( - System.IO.Path.Combine(AzurePipelines.Environment.Build.SourcesDirectory.FullPath, "src", "Snap.Hutao", "Snap.Hutao", "Resource"), + System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Resource"), System.IO.Path.Combine(binPath, "Resource") ); }); @@ -116,7 +124,7 @@ Task("Sign MSIX") "signtool.exe", new ProcessSettings { - Arguments = "sign /debug /v /a /fd SHA256 /f " + System.IO.Path.Combine(AzurePipelines.Environment.Agent.HomeDirectory.FullPath, "_work", "_temp", "DGP_Studio_CI.pfx") + " /p " + pw + " " + System.IO.Path.Combine(outputPath, $"Snap.Hutao.Alpha-{version}.msix") + Arguments = "sign /debug /v /a /fd SHA256 /f " + pfxFile + " /p " + pw + " " + System.IO.Path.Combine(outputPath, $"Snap.Hutao.Alpha-{version}.msix") } ); if (p != 0) From f4d23d617435da583136a2f2b15fcc49694a6757 Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Fri, 8 Dec 2023 16:39:36 +0800 Subject: [PATCH 07/15] better abstract --- azure-pipelines.yml | 15 +++++---------- build.cake | 44 ++++++++++++++++++++++++++++++++++++-------- 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a4ca8a38..1f4b7cdf 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -46,11 +46,6 @@ variables: steps: -- task: GetRevision@1 - displayName: get Pipelines revision number - inputs: - VariableName: 'rev_number' - - task: UseDotNet@2 displayName: Install dotNet inputs: @@ -61,7 +56,7 @@ steps: - task: CmdLine@2 displayName: dotnet cake inputs: - script: dotnet tool restore && dotnet cake --Version=$(build_date).$(rev_number) --pw=$(pw) + script: dotnet tool restore && dotnet cake --pw=$(pw) - task: DownloadSecureFile@1 name: cerFile @@ -81,8 +76,8 @@ steps: action: 'create' target: '$(Build.SourceVersion)' tagSource: 'userSpecifiedTag' - tag: '$(build_date).$(rev_number)' - title: '$(build_date).$(rev_number)' + tag: '$(version)' + title: '$(version)' releaseNotesSource: 'inline' releaseNotesInline: | ## 普通用户请勿下载 @@ -102,12 +97,12 @@ steps: displayName: Upload CI via Rclone condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/main')) inputs: - arguments: 'copy $(Build.ArtifactStagingDirectory)/Snap.Hutao.Alpha-$(build_date).$(rev_number).msix downloadDGPCN:/releases/Alpha/' + arguments: 'copy $(Build.ArtifactStagingDirectory)/Snap.Hutao.Alpha-$(version).msix downloadDGPCN:/releases/Alpha/' configPath: 'C:\agent\_work\_tasks\rclone.conf' - task: rclone@1 displayName: Upload PR CI via Rclone condition: and(succeeded(), eq(variables['Build.Reason'], 'PullRequest')) inputs: - arguments: 'copy $(Build.ArtifactStagingDirectory)/Snap.Hutao.Alpha-$(build_date).$(rev_number).msix downloadDGPCN:/releases/PR/' + arguments: 'copy $(Build.ArtifactStagingDirectory)/Snap.Hutao.Alpha-$(version).msix downloadDGPCN:/releases/PR/' configPath: 'C:\agent\_work\_tasks\rclone.conf' diff --git a/build.cake b/build.cake index aa282fe7..1e9ece3f 100644 --- a/build.cake +++ b/build.cake @@ -1,20 +1,48 @@ #tool "nuget:?package=nuget.commandline&version=6.5.0" +#addin nuget:?package=Cake.Http&version=3.0.2 + var target = Argument("target", "Build"); var configuration = Argument("configuration", "Release"); -var version = HasArgument("Version") ? Argument("Version") : throw new Exception("Empty Version"); +var versionAuth = HasEnvironmentVariable("VERSION_API_TOKEN") ? EnvironmentVariable("VERSION_API_TOKEN") : throw new Exception("Cannot find VERSION_API_TOKEN"); +var version = HttpGet( + "https://internal.snapgenshin.cn/BuildIntergration/RequestNewVersion", + new HttpSettings + { + Headers = new Dictionary + { + { "Authorization", versionAuth } + } + } + ); +Information($"Version: {version}"); + var pw = HasArgument("pw") ? Argument("pw") : throw new Exception("Empty pw"); -// Default Azure Pipelines +// Pre-define -var repoDir = AzurePipelines.Environment.Build.SourcesDirectory.FullPath; -var outputPath = AzurePipelines.Environment.Build.ArtifactStagingDirectory.FullPath; +var repoDir = "repoDir"; +var outputPath = "outputPath"; -var solution = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao.sln"); -var project = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Snap.Hutao.csproj"); -var binPath = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "bin", "x64", "Release", "net8.0-windows10.0.22621.0", "win-x64"); +var solution = "solution"; +var project = "project"; +var binPath = "binPath"; -var pfxFile = System.IO.Path.Combine(AzurePipelines.Environment.Agent.HomeDirectory.FullPath, "_work", "_temp", "DGP_Studio_CI.pfx"); +var pfxFile = "pfxFile"; + +if (AzurePipelines.IsRunningOnAzurePipelines) +{ + AzurePipelines.Commands.SetVariable("version", version); + + repoDir = AzurePipelines.Environment.Build.SourcesDirectory.FullPath; + outputPath = AzurePipelines.Environment.Build.ArtifactStagingDirectory.FullPath; + + solution = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao.sln"); + project = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Snap.Hutao.csproj"); + binPath = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "bin", "x64", "Release", "net8.0-windows10.0.22621.0", "win-x64"); + + pfxFile = System.IO.Path.Combine(AzurePipelines.Environment.Agent.HomeDirectory.FullPath, "_work", "_temp", "DGP_Studio_CI.pfx"); +} Task("Build") .IsDependentOn("Build binary package") From abb559d35ffbcda8ef4fb19d40067d122efe9429 Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Fri, 8 Dec 2023 17:02:40 +0800 Subject: [PATCH 08/15] prepare for veyor --- build.cake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.cake b/build.cake index 1e9ece3f..a8b42f9d 100644 --- a/build.cake +++ b/build.cake @@ -43,6 +43,10 @@ if (AzurePipelines.IsRunningOnAzurePipelines) pfxFile = System.IO.Path.Combine(AzurePipelines.Environment.Agent.HomeDirectory.FullPath, "_work", "_temp", "DGP_Studio_CI.pfx"); } +else if (AppVeyor.IsRunningOnAppVeyor) +{ + throw new NotImplementedException(); +} Task("Build") .IsDependentOn("Build binary package") From f5c3e55b3e1dffb0cf6eeb677e00b2094a66b48a Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Fri, 8 Dec 2023 17:44:26 +0800 Subject: [PATCH 09/15] sign outside --- azure-pipelines.yml | 17 ++++++++++------- build.cake | 22 +--------------------- 2 files changed, 11 insertions(+), 28 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1f4b7cdf..9279feed 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -42,7 +42,6 @@ variables: project: $(Build.SourcesDirectory)/src/Snap.Hutao/Snap.Hutao/Snap.Hutao.csproj' buildPlatform: 'x64' buildConfiguration: 'Release' - build_date: $[ format('{0:yyyy}.{0:M}.{0:d}', pipeline.startTime) ] steps: @@ -56,7 +55,16 @@ steps: - task: CmdLine@2 displayName: dotnet cake inputs: - script: dotnet tool restore && dotnet cake --pw=$(pw) + script: dotnet tool restore && dotnet cake + +- task: MsixSigning@1 + name: signMsix + displayName: Sign MSIX package + inputs: + package: '$(Build.ArtifactStagingDirectory)/Snap.Hutao.Alpha-$(version).msix' + certificate: 'DGP_Studio_CI.pfx' + passwordVariable: 'pw' + condition: succeeded() - task: DownloadSecureFile@1 name: cerFile @@ -64,11 +72,6 @@ steps: inputs: secureFile: 'Snap.Hutao.CI.cer' -- task: DownloadSecureFile@1 - displayName: Download PFX - inputs: - secureFile: 'DGP_Studio_CI.pfx' - - task: GitHubRelease@1 inputs: gitHubConnection: 'github.com_Masterain' diff --git a/build.cake b/build.cake index a8b42f9d..1756ef3c 100644 --- a/build.cake +++ b/build.cake @@ -17,8 +17,6 @@ var version = HttpGet( ); Information($"Version: {version}"); -var pw = HasArgument("pw") ? Argument("pw") : throw new Exception("Empty pw"); - // Pre-define var repoDir = "repoDir"; @@ -51,8 +49,7 @@ else if (AppVeyor.IsRunningOnAppVeyor) Task("Build") .IsDependentOn("Build binary package") .IsDependentOn("Copy files") - .IsDependentOn("Build MSIX") - .IsDependentOn("Sign MSIX"); + .IsDependentOn("Build MSIX"); Task("NuGet Restore") .Does(() => @@ -148,21 +145,4 @@ Task("Build MSIX") } }); -Task("Sign MSIX") - .IsDependentOn("Build MSIX") - .Does(() => -{ - var p = StartProcess( - "signtool.exe", - new ProcessSettings - { - Arguments = "sign /debug /v /a /fd SHA256 /f " + pfxFile + " /p " + pw + " " + System.IO.Path.Combine(outputPath, $"Snap.Hutao.Alpha-{version}.msix") - } - ); - if (p != 0) - { - throw new InvalidOperationException("Build failed with exit code " + p); - } -}); - RunTarget(target); From 4d5115e11ba2b4ad13baa249b5b0db3bafa7d169 Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Sat, 9 Dec 2023 09:51:30 +0800 Subject: [PATCH 10/15] add appveyor --- appveyor.yml | 21 +++++++++++++++ build.cake | 74 ++++++++++++++++++++++++++++++++-------------------- 2 files changed, 67 insertions(+), 28 deletions(-) create mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..e956eef0 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,21 @@ +version: 1.0.{build} +branches: + only: + - "main" +skip_non_tags: true +build_cloud: HUTAO-SERVER +image: Visual Studio 2022 +clone_depth: 3 +clone_folder: D:\appveyor\project\Snap.Hutao.Project +install: +- pwsh: dotnet tool restore +build_script: +- pwsh: dotnet cake +artifacts: +- path: src/output/*.msix + type: file +deploy: +- provider: Webhook + url: https://app.signpath.io/API/v1/7a941fa3-64d8-4c45-bd03-92a02bcd4964/Integrations/AppVeyor?ProjectSlug=Snap.Hutao&SigningPolicySlug=test-signing&ArtifactConfigurationSlug=msix + authorization: + secure: j8srQ5/UYWhI+jlm3Vo3D3QfXoRyQ9hOn3ynJGtwusKui4+uDi4gykdUFYCITZxK+C/fOCAZNJ+YaKSm/OaiXw== diff --git a/build.cake b/build.cake index 1756ef3c..441758c9 100644 --- a/build.cake +++ b/build.cake @@ -4,8 +4,17 @@ var target = Argument("target", "Build"); var configuration = Argument("configuration", "Release"); -var versionAuth = HasEnvironmentVariable("VERSION_API_TOKEN") ? EnvironmentVariable("VERSION_API_TOKEN") : throw new Exception("Cannot find VERSION_API_TOKEN"); -var version = HttpGet( +// Pre-define + +var version = "version"; + +var repoDir = "repoDir"; +var outputPath = "outputPath"; + +if (AzurePipelines.IsRunningOnAzurePipelines) +{ + var versionAuth = HasEnvironmentVariable("VERSION_API_TOKEN") ? EnvironmentVariable("VERSION_API_TOKEN") : throw new Exception("Cannot find VERSION_API_TOKEN"); + version = HttpGet( "https://internal.snapgenshin.cn/BuildIntergration/RequestNewVersion", new HttpSettings { @@ -15,37 +24,27 @@ var version = HttpGet( } } ); -Information($"Version: {version}"); + Information($"Version: {version}"); -// Pre-define - -var repoDir = "repoDir"; -var outputPath = "outputPath"; - -var solution = "solution"; -var project = "project"; -var binPath = "binPath"; - -var pfxFile = "pfxFile"; - -if (AzurePipelines.IsRunningOnAzurePipelines) -{ AzurePipelines.Commands.SetVariable("version", version); repoDir = AzurePipelines.Environment.Build.SourcesDirectory.FullPath; outputPath = AzurePipelines.Environment.Build.ArtifactStagingDirectory.FullPath; - - solution = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao.sln"); - project = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Snap.Hutao.csproj"); - binPath = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "bin", "x64", "Release", "net8.0-windows10.0.22621.0", "win-x64"); - - pfxFile = System.IO.Path.Combine(AzurePipelines.Environment.Agent.HomeDirectory.FullPath, "_work", "_temp", "DGP_Studio_CI.pfx"); } else if (AppVeyor.IsRunningOnAppVeyor) { - throw new NotImplementedException(); + // TODO: AppVeyor version + version = string.Empty; + Information("version"); + + repoDir = AppVeyor.Environment.Build.Folder; + outputPath = System.IO.Path.Combine(repoDir, "src", "output"); } +var solution = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao.sln"); +var project = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Snap.Hutao.csproj"); +var binPath = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "bin", "x64", "Release", "net8.0-windows10.0.22621.0", "win-x64"); + Task("Build") .IsDependentOn("Build binary package") .IsDependentOn("Copy files") @@ -73,13 +72,23 @@ Task("Generate AppxManifest") var manifest = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Package.appxmanifest"); var content = System.IO.File.ReadAllText(manifest); - content = content + if (AzurePipelines.IsRunningOnAzurePipelines) + { + Information("Using CI configuraion"); + content = content .Replace("Snap Hutao", "Snap Hutao Alpha") .Replace("胡桃", "胡桃 Alpha") .Replace("DGP Studio", "DGP Studio CI"); - content = System.Text.RegularExpressions.Regex.Replace(content, " Name=\"([^\"]*)\"", " Name=\"7f0db578-026f-4e0b-a75b-d5d06bb0a74c\""); - content = System.Text.RegularExpressions.Regex.Replace(content, " Publisher=\"([^\"]*)\"", " Publisher=\"CN=DGP Studio CI\""); - content = System.Text.RegularExpressions.Regex.Replace(content, " Version=\"([0-9\\.]+)\"", $" Version=\"{version}\""); + content = System.Text.RegularExpressions.Regex.Replace(content, " Name=\"([^\"]*)\"", " Name=\"7f0db578-026f-4e0b-a75b-d5d06bb0a74c\""); + content = System.Text.RegularExpressions.Regex.Replace(content, " Publisher=\"([^\"]*)\"", " Publisher=\"CN=DGP Studio CI\""); + content = System.Text.RegularExpressions.Regex.Replace(content, " Version=\"([0-9\\.]+)\"", $" Version=\"{version}\""); + } + else if (AppVeyor.IsRunningOnAppVeyor) + { + Information("Using Release configuration"); + // TODO: release subject + content = System.Text.RegularExpressions.Regex.Replace(content, " Publisher=\"([^\"]*)\"", " Publisher=\"CN=Test certificate for 'Snap Hutao [OSS]'\""); + } System.IO.File.WriteAllText(manifest, content); @@ -132,11 +141,20 @@ Task("Build MSIX") .IsDependentOn("Copy files") .Does(() => { + var arguments = "arguments"; + if (AzurePipelines.IsRunningOnAzurePipelines) + { + arguments = "pack /d " + binPath + " /p " + System.IO.Path.Combine(outputPath, $"Snap.Hutao.Alpha-{version}.msix"); + } + else if (AppVeyor.IsRunningOnAppVeyor) + { + arguments = "pack /d " + binPath + " /p " + System.IO.Path.Combine(outputPath, $"Snap.Hutao-{version}.msix"); + } var p = StartProcess( "makeappx.exe", new ProcessSettings { - Arguments = "pack /d " + binPath + " /p " + System.IO.Path.Combine(outputPath, $"Snap.Hutao.Alpha-{version}.msix") + Arguments = arguments } ); if (p != 0) From 5fa6bc03c890b36cb7e5205543c9bc63bfca1684 Mon Sep 17 00:00:00 2001 From: qhy040404 <45379733+qhy040404@users.noreply.github.com> Date: Sat, 9 Dec 2023 10:17:03 +0800 Subject: [PATCH 11/15] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20appveyor.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- appveyor.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index e956eef0..6853f61d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,8 +1,7 @@ version: 1.0.{build} branches: only: - - "main" -skip_non_tags: true + - "release" build_cloud: HUTAO-SERVER image: Visual Studio 2022 clone_depth: 3 From e7e6467ea8b1d2e19eee28e3e7105d7846f69fb3 Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Sat, 9 Dec 2023 11:08:17 +0800 Subject: [PATCH 12/15] release version --- build.cake | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/build.cake b/build.cake index 441758c9..9044cfcb 100644 --- a/build.cake +++ b/build.cake @@ -11,8 +11,28 @@ var version = "version"; var repoDir = "repoDir"; var outputPath = "outputPath"; +string solution +{ + get => System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao.sln"); +} +string project +{ + get => System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Snap.Hutao.csproj"); +} +string binPath +{ + get => System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "bin", "x64", "Release", "net8.0-windows10.0.22621.0", "win-x64"); +} +string manifest +{ + get => System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Package.appxmanifest"); +} + if (AzurePipelines.IsRunningOnAzurePipelines) { + repoDir = AzurePipelines.Environment.Build.SourcesDirectory.FullPath; + outputPath = AzurePipelines.Environment.Build.ArtifactStagingDirectory.FullPath; + var versionAuth = HasEnvironmentVariable("VERSION_API_TOKEN") ? EnvironmentVariable("VERSION_API_TOKEN") : throw new Exception("Cannot find VERSION_API_TOKEN"); version = HttpGet( "https://internal.snapgenshin.cn/BuildIntergration/RequestNewVersion", @@ -27,23 +47,18 @@ if (AzurePipelines.IsRunningOnAzurePipelines) Information($"Version: {version}"); AzurePipelines.Commands.SetVariable("version", version); - - repoDir = AzurePipelines.Environment.Build.SourcesDirectory.FullPath; - outputPath = AzurePipelines.Environment.Build.ArtifactStagingDirectory.FullPath; } else if (AppVeyor.IsRunningOnAppVeyor) { - // TODO: AppVeyor version - version = string.Empty; - Information("version"); - repoDir = AppVeyor.Environment.Build.Folder; outputPath = System.IO.Path.Combine(repoDir, "src", "output"); -} -var solution = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao.sln"); -var project = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Snap.Hutao.csproj"); -var binPath = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "bin", "x64", "Release", "net8.0-windows10.0.22621.0", "win-x64"); + version = XmlPeek(manifest, "appx:Package/appx:Identity/@Version", new XmlPeekSettings + { + Namespaces = new Dictionary { { "appx", "http://schemas.microsoft.com/appx/manifest/foundation/windows10" } } + })[..^2]; + Information($"Version: {version}"); +} Task("Build") .IsDependentOn("Build binary package") @@ -69,7 +84,6 @@ Task("Generate AppxManifest") { Information("Generating AppxManifest..."); - var manifest = System.IO.Path.Combine(repoDir, "src", "Snap.Hutao", "Snap.Hutao", "Package.appxmanifest"); var content = System.IO.File.ReadAllText(manifest); if (AzurePipelines.IsRunningOnAzurePipelines) From d7863ab5e05503cbfe7d32c8e426412f23edd091 Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Sat, 9 Dec 2023 11:12:25 +0800 Subject: [PATCH 13/15] code style --- build.cake | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/build.cake b/build.cake index 9044cfcb..c243e0e2 100644 --- a/build.cake +++ b/build.cake @@ -35,14 +35,14 @@ if (AzurePipelines.IsRunningOnAzurePipelines) var versionAuth = HasEnvironmentVariable("VERSION_API_TOKEN") ? EnvironmentVariable("VERSION_API_TOKEN") : throw new Exception("Cannot find VERSION_API_TOKEN"); version = HttpGet( - "https://internal.snapgenshin.cn/BuildIntergration/RequestNewVersion", - new HttpSettings - { - Headers = new Dictionary - { - { "Authorization", versionAuth } - } - } + "https://internal.snapgenshin.cn/BuildIntergration/RequestNewVersion", + new HttpSettings + { + Headers = new Dictionary + { + { "Authorization", versionAuth } + } + } ); Information($"Version: {version}"); @@ -54,9 +54,9 @@ else if (AppVeyor.IsRunningOnAppVeyor) outputPath = System.IO.Path.Combine(repoDir, "src", "output"); version = XmlPeek(manifest, "appx:Package/appx:Identity/@Version", new XmlPeekSettings - { - Namespaces = new Dictionary { { "appx", "http://schemas.microsoft.com/appx/manifest/foundation/windows10" } } - })[..^2]; + { + Namespaces = new Dictionary { { "appx", "http://schemas.microsoft.com/appx/manifest/foundation/windows10" } } + })[..^2]; Information($"Version: {version}"); } @@ -72,11 +72,11 @@ Task("NuGet Restore") var nugetConfig = System.IO.Path.Combine(repoDir, "NuGet.Config"); DotNetRestore(project, new DotNetRestoreSettings - { - Verbosity = DotNetVerbosity.Detailed, - Interactive = false, - ConfigFile = nugetConfig - }); + { + Verbosity = DotNetVerbosity.Detailed, + Interactive = false, + ConfigFile = nugetConfig + }); }); Task("Generate AppxManifest") @@ -90,9 +90,9 @@ Task("Generate AppxManifest") { Information("Using CI configuraion"); content = content - .Replace("Snap Hutao", "Snap Hutao Alpha") - .Replace("胡桃", "胡桃 Alpha") - .Replace("DGP Studio", "DGP Studio CI"); + .Replace("Snap Hutao", "Snap Hutao Alpha") + .Replace("胡桃", "胡桃 Alpha") + .Replace("DGP Studio", "DGP Studio CI"); content = System.Text.RegularExpressions.Regex.Replace(content, " Name=\"([^\"]*)\"", " Name=\"7f0db578-026f-4e0b-a75b-d5d06bb0a74c\""); content = System.Text.RegularExpressions.Regex.Replace(content, " Publisher=\"([^\"]*)\"", " Publisher=\"CN=DGP Studio CI\""); content = System.Text.RegularExpressions.Regex.Replace(content, " Version=\"([0-9\\.]+)\"", $" Version=\"{version}\""); From 46a90be95cfd27ba8b5de4ec330349612a8e1922 Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Sat, 9 Dec 2023 12:06:21 +0800 Subject: [PATCH 14/15] prepare release --- appveyor.yml | 1 + build.cake | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 6853f61d..fd432319 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,5 +16,6 @@ artifacts: deploy: - provider: Webhook url: https://app.signpath.io/API/v1/7a941fa3-64d8-4c45-bd03-92a02bcd4964/Integrations/AppVeyor?ProjectSlug=Snap.Hutao&SigningPolicySlug=test-signing&ArtifactConfigurationSlug=msix + # url: https://app.signpath.io/API/v1/7a941fa3-64d8-4c45-bd03-92a02bcd4964/Integrations/AppVeyor?ProjectSlug=Snap.Hutao&SigningPolicySlug=release-signing&ArtifactConfigurationSlug=msix authorization: secure: j8srQ5/UYWhI+jlm3Vo3D3QfXoRyQ9hOn3ynJGtwusKui4+uDi4gykdUFYCITZxK+C/fOCAZNJ+YaKSm/OaiXw== diff --git a/build.cake b/build.cake index c243e0e2..789958e9 100644 --- a/build.cake +++ b/build.cake @@ -100,8 +100,9 @@ Task("Generate AppxManifest") else if (AppVeyor.IsRunningOnAppVeyor) { Information("Using Release configuration"); - // TODO: release subject content = System.Text.RegularExpressions.Regex.Replace(content, " Publisher=\"([^\"]*)\"", " Publisher=\"CN=Test certificate for 'Snap Hutao [OSS]'\""); + // release + // content = System.Text.RegularExpressions.Regex.Replace(content, " Publisher=\"([^\"]*)\"", " Publisher=\"CN=SignPath Foundation, O=SignPath Foundation, C=US, S=DE, L=Lewes\""); } System.IO.File.WriteAllText(manifest, content); From 364d0ed0beffcda79df44abb069df758d0033509 Mon Sep 17 00:00:00 2001 From: qhy040404 <45379733+qhy040404@users.noreply.github.com> Date: Sat, 9 Dec 2023 14:28:43 +0800 Subject: [PATCH 15/15] Update azure-pipelines.yml --- azure-pipelines.yml | 47 +++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9279feed..37136b2a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,29 +7,30 @@ # 5. Connect the GitHub in project settings # 6. Run -trigger: - branches: - include: - - main - - develop - paths: - exclude: - - README.md - - azure-pipelines.yml - - .github/ISSUE_TEMPLATE/*.yml - - .github/workflows/*.yml - - src/Snap.Hutao/Snap.Hutao/Resource/Localization/*.resx -pr: - branches: - include: - - main - paths: - exclude: - - README.md - - azure-pipelines.yml - - .github/ISSUE_TEMPLATE/*.yml - - .github/workflows/*.yml - - src/Snap.Hutao/Snap.Hutao/Resource/Localization/*.resx +trigger: none +# trigger: +# branches: +# include: +# - main +# - develop +# paths: +# exclude: +# - README.md +# - azure-pipelines.yml +# - .github/ISSUE_TEMPLATE/*.yml +# - .github/workflows/*.yml +# - src/Snap.Hutao/Snap.Hutao/Resource/Localization/*.resx +# pr: +# branches: +# include: +# - main +# paths: +# exclude: +# - README.md +# - azure-pipelines.yml +# - .github/ISSUE_TEMPLATE/*.yml +# - .github/workflows/*.yml +# - src/Snap.Hutao/Snap.Hutao/Resource/Localization/*.resx pool: