Browse Source

Fixed a test & updated Jenkinsfile

pull/55/head
JT 1 year ago
parent
commit
007b3e2d0c
  1. 8
      Jenkinsfile
  2. 2
      StabilityMatrix.Core/Helper/ArchiveHelper.cs
  3. 2
      StabilityMatrix.Core/Models/InstalledPackage.cs

8
Jenkinsfile vendored

@ -20,15 +20,15 @@ node("Windows") {
stage('Set Version') {
script {
if (env.TAG_NAME) {
version = env.TAG_NAME.replaceFirst(/^v/, '') + ".0"
version = env.TAG_NAME.replaceFirst(/^v/, '')
} else {
version = VersionNumber projectStartDate: '2023-06-21', versionNumberString: '1.0.${BUILDS_ALL_TIME}.0', versionPrefix: '', worstResultForIncrement: 'SUCCESS'
version = VersionNumber projectStartDate: '2023-06-21', versionNumberString: '${BUILDS_ALL_TIME}', worstResultForIncrement: 'SUCCESS'
}
}
}
stage('Publish') {
bat "dotnet publish .\\StabilityMatrix\\StabilityMatrix.csproj -c Release -o out -r win-x64 -p:PublishSingleFile=true -p:Version=${version} -p:FileVersion=${version} -p:AssemblyVersion=${version} --self-contained true"
bat "dotnet publish .\\StabilityMatrix.Avalonia\\StabilityMatrix.Avalonia.csproj -c Release -o out -r win-x64 -p:PublishSingleFile=true -p:VersionPrefix=2.0.0 -p:VersionSuffix=${version} -p:IncludeNativeLibrariesForSelfExtract=true"
}
stage ('Archive Artifacts') {
@ -36,7 +36,7 @@ node("Windows") {
}
} else {
stage('Publish') {
bat "dotnet publish .\\StabilityMatrix\\StabilityMatrix.csproj -c Release -o out -r win-x64 -p:PublishSingleFile=true --self-contained true"
bat "dotnet publish .\\StabilityMatrix.Avalonia\\StabilityMatrix.Avalonia.csproj -c Release -o out -r win-x64 -p:PublishSingleFile=true -p:IncludeNativeLibrariesForSelfExtract=true"
}
}
}

2
StabilityMatrix.Core/Helper/ArchiveHelper.cs

@ -137,7 +137,7 @@ public static partial class ArchiveHelper
var process = ProcessRunner.StartProcess(SevenZipPath, args, outputDataReceived: onOutput);
await ProcessRunner.WaitForExitConditionAsync(process);
progress.Report(new ProgressReport(1, "Finished extracting", type: ProgressType.Extract));
progress.Report(new ProgressReport(1f, "Finished extracting", type: ProgressType.Extract));
var output = outputStore.ToString();

2
StabilityMatrix.Core/Models/InstalledPackage.cs

@ -52,7 +52,7 @@ public class InstalledPackage
// Further check if the path is a sub-path of the library
var isSubPath = relativePath != "."
&& relativePath != ".."
&& !relativePath.StartsWith(".." + Environment.NewLine)
&& !relativePath.StartsWith(".." + System.IO.Path.DirectorySeparatorChar)
&& !System.IO.Path.IsPathRooted(relativePath);
return isSubPath ? relativePath : null;
}

Loading…
Cancel
Save