sign outside

This commit is contained in:
qhy040404
2023-12-08 17:44:26 +08:00
parent abb559d35f
commit f5c3e55b3e
2 changed files with 11 additions and 28 deletions

View File

@@ -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'

View File

@@ -17,8 +17,6 @@ var version = HttpGet(
);
Information($"Version: {version}");
var pw = HasArgument("pw") ? Argument<string>("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);