forked from winsw/winsw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request winsw#477 from NextTurn/pipelines
Set up CI with Azure Pipelines
- Loading branch information
Showing
4 changed files
with
145 additions
and
39 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: $(Major).$(Minor).$(Patch).$(Revision) | ||
|
||
trigger: | ||
- master | ||
|
||
pr: | ||
- master | ||
|
||
variables: | ||
Revision: $[counter(format('{0}.{1}.{2}', variables.Major, variables.Minor, variables.Patch), 1)] | ||
AssemblyVersion: $(Major).$(Minor).$(Patch) | ||
PackageVersion: $(Major).$(Minor).$(Patch).$(Revision) | ||
|
||
jobs: | ||
- template: template.yml | ||
parameters: | ||
strategy: | ||
matrix: | ||
Debug: | ||
BuildConfiguration: Debug | ||
Release: | ||
BuildConfiguration: Release | ||
artifacts: | ||
- displayName: Publish .NET 2.0 | ||
inputs: | ||
Path: artifacts\WinSW.NET2.exe | ||
Name: WinSW.NET2.exe_$(BuildConfiguration) | ||
- displayName: Publish .NET 4.0 | ||
inputs: | ||
Path: artifacts\WinSW.NET4.exe | ||
Name: WinSW.NET4.exe_$(BuildConfiguration) | ||
- displayName: Publish .NET 4.6.1 | ||
inputs: | ||
Path: artifacts\WinSW.NET461.exe | ||
Name: WinSW.NET461.exe_$(BuildConfiguration) | ||
- displayName: Publish .NET Core 3.1 | ||
inputs: | ||
Path: artifacts\WinSW.NETCore31.zip | ||
Name: WinSW.NETCore31.zip_$(BuildConfiguration) | ||
- displayName: Publish .NET Core 3.1 x64 | ||
inputs: | ||
Path: artifacts\WinSW.NETCore31.x64.exe | ||
Name: WinSW.NETCore31.x64.exe_$(BuildConfiguration) | ||
- displayName: Publish .NET Core 3.1 x86 | ||
inputs: | ||
Path: artifacts\WinSW.NETCore31.x86.exe | ||
Name: WinSW.NETCore31.x86.exe_$(BuildConfiguration) | ||
- displayName: Publish Nuget | ||
inputs: | ||
Path: $(Build.ArtifactStagingDirectory)\WinSW.$(PackageVersion).nupkg | ||
Name: WinSW.nupkg_$(BuildConfiguration) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: $(Major).$(Minor).$(Patch).$(Revision) | ||
|
||
trigger: none | ||
|
||
variables: | ||
Revision: $[counter(format('{0}.{1}.{2}', variables.Major, variables.Minor, variables.Patch), 1)] | ||
AssemblyVersion: $(Major).$(Minor).$(Patch) | ||
PackageVersion: $(Major).$(Minor).$(Patch) | ||
BuildConfiguration: Release | ||
|
||
jobs: | ||
- template: template.yml | ||
parameters: | ||
artifacts: | ||
- displayName: Publish .NET 2.0 | ||
inputs: | ||
Path: artifacts\WinSW.NET2.exe | ||
Name: WinSW.NET2.exe | ||
- displayName: Publish .NET 4.0 | ||
inputs: | ||
Path: artifacts\WinSW.NET4.exe | ||
Name: WinSW.NET4.exe | ||
- displayName: Publish .NET 4.6.1 | ||
inputs: | ||
Path: artifacts\WinSW.NET461.exe | ||
Name: WinSW.NET461.exe | ||
- displayName: Publish .NET Core 3.1 | ||
inputs: | ||
Path: artifacts\WinSW.NETCore31.zip | ||
Name: WinSW.NETCore31.zip | ||
- displayName: Publish .NET Core 3.1 x64 | ||
inputs: | ||
Path: artifacts\WinSW.NETCore31.x64.exe | ||
Name: WinSW.NETCore31.x64.exe | ||
- displayName: Publish .NET Core 3.1 x86 | ||
inputs: | ||
Path: artifacts\WinSW.NETCore31.x86.exe | ||
Name: WinSW.NETCore31.x86.exe | ||
- displayName: Publish Nuget | ||
inputs: | ||
Path: $(Build.ArtifactStagingDirectory)\WinSW.$(PackageVersion).nupkg | ||
Name: WinSW.nupkg | ||
- displayName: Publish full sample | ||
inputs: | ||
Path: examples\sample-allOptions.xml | ||
Name: sample-allOptions.xml | ||
- displayName: Publish minimal sample | ||
inputs: | ||
Path: examples\sample-minimal.xml | ||
Name: sample-minimal.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core | ||
|
||
parameters: | ||
- name: strategy | ||
type: object | ||
default: '' | ||
- name: artifacts | ||
type: object | ||
default: [] | ||
|
||
jobs: | ||
- job: Build | ||
pool: | ||
vmImage: windows-latest | ||
${{ if ne(parameters.strategy, '') }}: | ||
strategy: ${{ parameters.strategy }} | ||
steps: | ||
- script: '"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\sn.exe" -k winsw_key.snk' | ||
displayName: Generate key | ||
- script: | | ||
dotnet build -c $(BuildConfiguration) src\winsw.sln -p:Version=$(AssemblyVersion) | ||
dotnet publish -c $(BuildConfiguration) -f netcoreapp3.1 src\Core\ServiceWrapper\winsw.csproj -p:Version=$(AssemblyVersion) | ||
dotnet publish -c $(BuildConfiguration) -f netcoreapp3.1 -r win-x64 src\Core\ServiceWrapper\winsw.csproj -p:PublishSingleFile=true -p:PublishTrimmed=true -p:Version=$(AssemblyVersion) | ||
dotnet publish -c $(BuildConfiguration) -f netcoreapp3.1 -r win-x86 src\Core\ServiceWrapper\winsw.csproj -p:PublishSingleFile=true -p:PublishTrimmed=true -p:Version=$(AssemblyVersion) | ||
displayName: Build | ||
- task: NuGetToolInstaller@1 | ||
displayName: Install Nuget | ||
inputs: | ||
checkLatest: true | ||
- task: NuGetCommand@2 | ||
displayName: Pack | ||
inputs: | ||
command: pack | ||
packagesToPack: WinSW.nuspec | ||
versioningScheme: byEnvVar | ||
versionEnvVar: PackageVersion | ||
- script: dotnet test -c $(BuildConfiguration) --no-build src\Test\winswTests\winswTests.csproj | ||
displayName: Test | ||
- ${{ each artifact in parameters.artifacts }}: | ||
- task: PublishBuildArtifacts@1 | ||
displayName: ${{ artifact.displayName }} | ||
inputs: | ||
PathtoPublish: ${{ artifact.inputs.Path }} | ||
ArtifactName: ${{ artifact.inputs.Name }} |