Skip to content

Commit

Permalink
Merge pull request winsw#477 from NextTurn/pipelines
Browse files Browse the repository at this point in the history
Set up CI with Azure Pipelines
  • Loading branch information
oleg-nenashev authored Apr 8, 2020
2 parents 0464355 + 6458656 commit bed7b68
Show file tree
Hide file tree
Showing 4 changed files with 145 additions and 39 deletions.
39 changes: 0 additions & 39 deletions DEVELOPER.md

This file was deleted.

51 changes: 51 additions & 0 deletions eng/build.yml
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)
50 changes: 50 additions & 0 deletions eng/release.yml
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
44 changes: 44 additions & 0 deletions eng/template.yml
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 }}

0 comments on commit bed7b68

Please sign in to comment.