mirror of https://github.com/winsw/winsw
parent
3c5884e7b8
commit
885877c12b
|
@ -25,12 +25,6 @@ strategy:
|
|||
Release:
|
||||
BuildConfiguration: Release
|
||||
steps:
|
||||
- task: UseDotNet@2
|
||||
displayName: Install .NET SDK
|
||||
inputs:
|
||||
packageType: sdk
|
||||
version: 6.x
|
||||
includePreviewVersions: true
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: Build
|
||||
inputs:
|
||||
|
@ -38,8 +32,10 @@ steps:
|
|||
projects: src\WinSW.sln
|
||||
arguments: -c $(BuildConfiguration) -p:Version=$(BuildVersion)
|
||||
- script: |
|
||||
dotnet publish src\WinSW\WinSW.csproj -c $(BuildConfiguration) -f net6.0-windows -r win-x64 -p:Version=$(BuildVersion)
|
||||
dotnet publish src\WinSW\WinSW.csproj -c $(BuildConfiguration) -f net6.0-windows -r win-x86 -p:Version=$(BuildVersion)
|
||||
dotnet publish src\WinSW\WinSW.csproj -c $(BuildConfiguration) -f net5.0-windows -r win-x64 -p:Version=$(BuildVersion)
|
||||
dotnet publish src\WinSW\WinSW.csproj -c $(BuildConfiguration) -f net5.0-windows -r win-x86 -p:Version=$(BuildVersion)
|
||||
dotnet publish src\WinSW\WinSW.csproj -c $(BuildConfiguration) -f net5.0-windows -r win-x64 -p:Version=$(BuildVersion) -p:IncludeNativeLibrariesForSelfExtract=true
|
||||
dotnet publish src\WinSW\WinSW.csproj -c $(BuildConfiguration) -f net5.0-windows -r win-x86 -p:Version=$(BuildVersion) -p:IncludeNativeLibrariesForSelfExtract=true
|
||||
displayName: Build
|
||||
- task: DotNetCoreCLI@2
|
||||
displayName: Test
|
||||
|
@ -59,6 +55,14 @@ steps:
|
|||
artifact: WinSW-net461.exe_$(BuildConfiguration)
|
||||
displayName: Publish .NET 4.6.1
|
||||
|
||||
- publish: artifacts\publish\WinSW-x64.zip
|
||||
artifact: WinSW-x64.zip_$(BuildConfiguration)
|
||||
displayName: Publish .NET x64 .zip
|
||||
|
||||
- publish: artifacts\publish\WinSW-x86.zip
|
||||
artifact: WinSW-x86.zip_$(BuildConfiguration)
|
||||
displayName: Publish .NET x86 .zip
|
||||
|
||||
- publish: artifacts\publish\WinSW-x64.exe
|
||||
artifact: WinSW-x64.exe_$(BuildConfiguration)
|
||||
displayName: Publish .NET x64 .exe
|
||||
|
|
|
@ -122,9 +122,7 @@ namespace WinSW
|
|||
/// </exception>
|
||||
public async Task PerformAsync()
|
||||
{
|
||||
#pragma warning disable SYSLIB0014 // Type or member is obsolete
|
||||
var request = WebRequest.Create(this.From);
|
||||
#pragma warning restore SYSLIB0014 // Type or member is obsolete
|
||||
if (!string.IsNullOrEmpty(this.Proxy))
|
||||
{
|
||||
var proxyInformation = new CustomProxyInformation(this.Proxy!);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net461;net6.0-windows</TargetFrameworks>
|
||||
<TargetFrameworks>net461;net5.0-windows</TargetFrameworks>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
|
@ -15,13 +15,13 @@
|
|||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows'">
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0-windows'">
|
||||
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
|
||||
<PackageReference Include="System.Security.AccessControl" Version="5.0.0" />
|
||||
<PackageReference Include="System.ServiceProcess.ServiceController" Version="5.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'net5.0-windows'">
|
||||
<PackageReference Include="System.Memory" Version="4.5.4" />
|
||||
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net461;net6.0-windows</TargetFrameworks>
|
||||
<TargetFrameworks>net461;net5.0-windows</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net471;net6.0-windows</TargetFrameworks>
|
||||
<TargetFrameworks>net471;net5.0-windows</TargetFrameworks>
|
||||
<LangVersion>latest</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
|||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'net5.0-windows'">
|
||||
<PackageReference Include="System.Reflection.Metadata" Version="5.0.0" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
</ItemGroup>
|
||||
|
@ -39,11 +39,11 @@
|
|||
|
||||
<Target Name="Copy" BeforeTargets="AfterBuild">
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0-windows'">
|
||||
<_FilesToCopy Include="$(ArtifactsBinDir)WinSW\$(Configuration)\net6.0-windows\WinSW.runtimeconfig*.json" />
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'net5.0-windows'">
|
||||
<_FilesToCopy Include="$(ArtifactsBinDir)WinSW\$(Configuration)\net5.0-windows\WinSW.runtimeconfig*.json" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'net5.0-windows'">
|
||||
<_FilesToCopy Include="$(ArtifactsBinDir)WinSW\$(Configuration)\net461\System.ValueTuple.dll" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFrameworks>net461;net6.0-windows</TargetFrameworks>
|
||||
<TargetFrameworks>net461;net5.0-windows</TargetFrameworks>
|
||||
<LangVersion>preview</LangVersion>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
|
@ -16,11 +16,11 @@
|
|||
<Copyright>Copyright (c) 2008-2020 Kohsuke Kawaguchi, Sun Microsystems, Inc., CloudBees, Inc., Oleg Nenashev and other contributors</Copyright>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'net6.0-windows' AND '$(RuntimeIdentifier)' != ''">
|
||||
<PropertyGroup Condition="'$(TargetFramework)' == 'net5.0-windows' AND '$(RuntimeIdentifier)' != ''">
|
||||
<PublishSingleFile>true</PublishSingleFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
|
||||
<PropertyGroup Condition="'$(TargetFramework)' != 'net5.0-windows'">
|
||||
<ILMergeVersion>3.0.41</ILMergeVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
|
@ -28,7 +28,7 @@
|
|||
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20303.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'net5.0-windows'">
|
||||
<PackageReference Include="ilmerge" Version="$(ILMergeVersion)" />
|
||||
<Reference Include="System.ServiceProcess" />
|
||||
</ItemGroup>
|
||||
|
@ -38,11 +38,18 @@
|
|||
<ProjectReference Include="..\WinSW.Plugins\WinSW.Plugins.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'net6.0-windows'">
|
||||
<ItemGroup Condition="'$(TargetFramework)' != 'net5.0-windows'">
|
||||
<ProjectReference Include="..\WinSW.Tasks\WinSW.Tasks.csproj" ReferenceOutputAssembly="false" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PublishCoreExe" AfterTargets="Publish" Condition="'$(TargetFramework)' == 'net6.0-windows'">
|
||||
<Target Name="PublishCoreZip" AfterTargets="Publish" Condition="'$(TargetFramework)' == 'net5.0-windows' and '$(IncludeNativeLibrariesForSelfExtract)' != 'true'">
|
||||
|
||||
<MakeDir Directories="$(ArtifactsPublishDir)" />
|
||||
<ZipDirectory SourceDirectory="$(PublishDir)" DestinationFile="$(ArtifactsPublishDir)WinSW-$(PlatformTarget).zip" Overwrite="true" />
|
||||
|
||||
</Target>
|
||||
|
||||
<Target Name="PublishCoreExe" AfterTargets="Publish" Condition="'$(TargetFramework)' == 'net5.0-windows' and '$(IncludeNativeLibrariesForSelfExtract)' == 'true'">
|
||||
|
||||
<MakeDir Directories="$(ArtifactsPublishDir)" />
|
||||
<Copy SourceFiles="$(PublishDir)$(TargetName).exe" DestinationFiles="$(ArtifactsPublishDir)WinSW-$(PlatformTarget).exe" />
|
||||
|
@ -50,7 +57,7 @@
|
|||
</Target>
|
||||
|
||||
<!-- Merge plugins and other DLLs into the executable -->
|
||||
<Target Name="Merge" BeforeTargets="AfterBuild" Condition="'$(TargetFramework)' != 'net6.0-windows'">
|
||||
<Target Name="Merge" BeforeTargets="AfterBuild" Condition="'$(TargetFramework)' != 'net5.0-windows'">
|
||||
|
||||
<PropertyGroup>
|
||||
<InputAssemblies>"$(OutDir)$(TargetFileName)"</InputAssemblies>
|
||||
|
@ -78,7 +85,7 @@
|
|||
</Target>
|
||||
|
||||
<UsingTask TaskName="WinSW.Tasks.Trim" AssemblyFile="$(ArtifactsBinDir)WinSW.Tasks\$(Configuration)\net461\WinSW.Tasks.dll" />
|
||||
<Target Name="Trim" AfterTargets="Merge" Condition="'$(TargetFramework)' != 'net6.0-windows'">
|
||||
<Target Name="Trim" AfterTargets="Merge" Condition="'$(TargetFramework)' != 'net5.0-windows'">
|
||||
<Trim Path="$(ArtifactsPublishDir)WinSW-$(TargetFramework).exe" />
|
||||
</Target>
|
||||
|
||||
|
|
Loading…
Reference in New Issue