mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
sign outside
This commit is contained in:
@@ -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'
|
||||
|
||||
22
build.cake
22
build.cake
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user