From c666ea8f8525daafc4ef431b3e482348997e15f4 Mon Sep 17 00:00:00 2001 From: Philemon Eichin Date: Thu, 19 Sep 2019 17:43:32 +0200 Subject: [PATCH] Add Azure pipeline --- appveyor.yml | 40 ----------------- azure-pipeline.yml | 107 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 40 deletions(-) delete mode 100644 appveyor.yml create mode 100644 azure-pipeline.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index e9b2057..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,40 +0,0 @@ -skip_non_tags: true -image: Visual Studio 2017 -configuration: Release -skip_commits: - files: - - docs/* - - '**/*.html' - - '**/*.md' - - appveyor.yml -build: - publish_nuget: true - publish_nuget_symbols: true - parallel: true - verbosity: minimal -deploy: -- provider: NuGet - api_key: - secure: 7/Amy0vozNWOuINB5sIjU3ChZc16Oye9bcOeCfuSpy1sYN0j4XhQ1EKS5+UDsANS - on: - branch: master -- provider: GitHub - auth_token: - secure: I0crkaDLJwNba1txPPCrj0pKaFMbzxKHPIZ7hNYP1Wy6yVJ7s3napz/nEv38L/3/ - on: - branch: master -install: - - cinst gitversion.portable - - nuget restore - - ps: gitversion /l console /output buildserver - -assembly_info: - patch: true - file: '**\AssemblyInfo.*' - assembly_version: $(GitVersion_AssemblySemVer) - assembly_file_version: $(GitVersion_AssemblySemVer) - assembly_informational_version: $(GitVersion_FullSemVer) - -on_failure: - - ps: 7z a "WorkingTree.zip" - - ps: Push-AppveyorArtifact WorkingTree.zip \ No newline at end of file diff --git a/azure-pipeline.yml b/azure-pipeline.yml new file mode 100644 index 0000000..a229112 --- /dev/null +++ b/azure-pipeline.yml @@ -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" \ No newline at end of file