Skip to content

Commit

Permalink
Add Azure pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Pretasoc committed Sep 19, 2019
1 parent 5262a0a commit c666ea8
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 40 deletions.
40 changes: 0 additions & 40 deletions appveyor.yml

This file was deleted.

107 changes: 107 additions & 0 deletions azure-pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
pool:
vmImage: "windows-2019"

trigger:
batch: true
branches:
include:
- master
- release/*
- hotfix/*
- feature/*
exclude:
- "**/*-restyled"

pr:
branches:
include:
- master
- release/*
- hotfix/*
- feature/*
exclude:
- "**/*-restyled"

variables:
Release.IsPrerelease: $[and(ne(variables['Build.Reason'], 'PullRequest'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/')))]
Release.Publish: $[and(ne(variables['Build.Reason'], 'PullRequest'), or(startsWith(variables['Build.SourceBranch'], 'refs/heads/release/'), startsWith(variables['Build.SourceBranch'], 'refs/heads/hotfix/'), eq(variables['Build.SourceBranch'], 'refs/heads/master')))]

steps:
- task: GitVersion@5
inputs:
runtime: "core"
configFilePath: "gitversion.yml"
- task: UseDotNet@2
displayName: "Use .Net Core sdk "
inputs:
useGlobalJson: true

- task: DotNetCoreCLI@2
displayName: "dotnet build"

- task: UseDotNet@2
inputs:
packageType: "runtime"
version: "1.1.2"

- task: DotNetCoreCLI@2
displayName: "dotnet test"
inputs:
command: test

- powershell: Invoke-WebRequest -Uri 'https://report.ci/upload.py' -OutFile upload.py

- task: PythonScript@0
displayName: Upload Test Results
continueOnError: true
inputs:
scriptPath: upload.py
arguments: "--include='*.xml' --framework=nunit"

- task: CopyFiles@2
displayName: "Copy Files to: $(build.artifactstagingdirectory)"
inputs:
SourceFolder: "$(system.defaultworkingdirectory)"
Contents: |
**\*.nupkg
**\*.snupkg
TargetFolder: "$(build.artifactstagingdirectory)"
flattenFolders: true
condition: succeededOrFailed()

- task: DotNetCoreCLI@2
displayName: "dotnet push"
condition: ne(variables['Build.Reason'], 'PullRequest')
inputs:
command: push
publishVstsFeed: "0a220c4b-5ab8-47bf-baf0-fdfb139b70c4/faf9ee1b-b648-43cb-9a50-c60ae34d9adf"
includesymbols: true

- task: NuGetToolInstaller@1
condition: and(succeeded(), eq(variables['Release.Publish'], 'True'))
inputs:
versionSpec: ">4.9.0"

- task: NuGetCommand@2
displayName: "Publish to NuGet.org"
condition: and(succeeded(), eq(variables['Release.Publish'], 'True'))
inputs:
command: "push"
packagesToPush: "$(Build.ArtifactStagingDirectory)/**/*.nupkg;"
nuGetFeedType: "external"
publishFeedCredentials: "Nuget (SettingService)"

- task: GitHubRelease@0
displayName: "GitHub release (create)"
condition: and(succeeded(), eq(variables['Release.Publish'], 'True'))
inputs:
gitHubConnection: "phirSOFT.SettingsService"
repositoryName: "$(Build.Repository.Name)"
action: "create"
target: "$(Build.SourceVersion)"
tagSource: "manual"
tag: "$(GitVersion.FullSemVer)"
title: "$(GitVersion.FullSemVer)"
releaseNotesFile: "ReleaseNotes.md"
isPreRelease: $(Release.IsPrerelease)
compareWith: "lastFullRelease"

0 comments on commit c666ea8

Please sign in to comment.