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);