Skip to content

Commit

Permalink
Merge branch 'dev' into fix-issue-66
Browse files Browse the repository at this point in the history
  • Loading branch information
Arkatufus authored Mar 1, 2021
2 parents 4a806f4 + 71c4389 commit eccca00
Show file tree
Hide file tree
Showing 33 changed files with 1,048 additions and 236 deletions.
8 changes: 8 additions & 0 deletions build-system/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Azure Pipelines Build Files
These `.yaml` files are used by Windows Azure DevOps Pipelines to help execute the following types of builds:

- Pull request validation on Linux (Mono / .NET Core)
- Pull request validation on Windows (.NET Framework / .NET Core)
- NuGet releases with automatic release notes posted to a Github Release repository.

**NOTE**: you will need to change some of the pipeline variables inside the `windows-release.yaml` for your specific project and you will also want to create variable groups with your signing and NuGet push information.
63 changes: 63 additions & 0 deletions build-system/azure-pipeline.template.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
parameters:
name: ''
vmImage: ''
displayName: ''
artifactName: 'akkaBuild'
scriptFileName: ''
scriptArgs: 'all'
outputDirectory: ''
timeoutInMinutes: 120

jobs:
- job: ${{ parameters.name }}
displayName: ${{ parameters.displayName }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
pool:
vmImage: ${{ parameters.vmImage }}
steps:
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
clean: false # whether to fetch clean each time
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
persistCredentials: true
- task: UseDotNet@2
displayName: 'Use .NET Core Runtime 3.1.10'
inputs:
packageType: runtime
version: 3.1.10
# Linux or macOS
- task: Bash@3
displayName: Linux / OSX Build
inputs:
filePath: ${{ parameters.scriptFileName }}
arguments: ${{ parameters.scriptArgs }}
continueOnError: true
condition: in( variables['Agent.OS'], 'Linux', 'Darwin' )
# Windows test is disabled, could not use redis container in Azure Pipelines
# - task: BatchScript@1
# displayName: Windows Build
# inputs:
# filename: ${{ parameters.scriptFileName }}
# arguments: ${{ parameters.scriptArgs }}
# continueOnError: true
# condition: eq( variables['Agent.OS'], 'Windows_NT' )
- task: PublishTestResults@2
inputs:
testRunner: VSTest
testResultsFiles: '**/*.trx' #TestResults folder usually
testRunTitle: ${{ parameters.name }}
mergeTestResults: true
- task: CopyFiles@2
displayName: 'Copy Build Output'
inputs:
sourceFolder: ${{ parameters.outputDirectory }}
contents: '**\*'
targetFolder: $(Build.ArtifactStagingDirectory)
continueOnError: boolean # 'true' if future steps should run even if this step fails; defaults to 'false'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)'
artifactName: ${{ parameters.artifactName }}
- script: 'echo 1>&2'
failOnStderr: true
displayName: 'If above is partially succeeded, then fail'
condition: eq(variables['Agent.JobStatus'], 'SucceededWithIssues')
34 changes: 34 additions & 0 deletions build-system/pr-validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Pull request validation for Windows against the `dev` and `master` branches
# See https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema for reference
trigger:
branches:
include:
- dev
- master

pr:
autoCancel: true # indicates whether additional pushes to a PR should cancel in-progress runs for the same PR. Defaults to true
branches:
include: [ dev, master ] # branch names which will trigger a build

name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)

jobs:
# Windows testing is disabled, Redis linux container can not run in windows docker.
# - template: azure-pipeline.template.yaml
# parameters:
# name: 'windows_pr'
# displayName: 'Windows PR Validation'
# vmImage: 'windows-2019'
# scriptFileName: build.cmd
# scriptArgs: all

- template: azure-pipeline.template.yaml
parameters:
name: 'linux_pr'
displayName: 'Linux PR Validation'
vmImage: 'ubuntu-16.04'
scriptFileName: './build.sh'
scriptArgs: RunTestsNetCore
outputDirectory: 'TestResults'
artifactName: 'net_core_tests-$(Build.BuildId)'
43 changes: 43 additions & 0 deletions build-system/windows-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Release task for PbLib projects
# See https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema for reference

pool:
vmImage: vs2017-win2016
demands: Cmd

trigger:
branches:
include:
- refs/tags/*
pr: none

variables:
- group: signingSecrets #create this group with SECRET variables `signingUsername` and `signingPassword`
- group: nugetKeys #create this group with SECRET variables `nugetKey`
- name: githubConnectionName
value: AkkaDotNet_Releases
- name: projectName
value: Akka.Persistence.PostgreSql
- name: githubRepositoryName
value: akkadotnet/Akka.Persistence.PostgreSql
steps:
- task: UseDotNet@2
displayName: 'Use .NET Core Runtime 3.1.10'
inputs:
packageType: runtime
version: 3.1.10
- task: BatchScript@1
displayName: 'FAKE Build'
inputs:
filename: build.cmd
arguments: 'Nuget SignClientUser=$(signingUsername) SignClientSecret=$(signingPassword) nugetpublishurl=https://www.nuget.org/api/v2/package nugetkey=$(nugetKey)'

- task: GitHubRelease@0
displayName: 'GitHub release (create)'
inputs:
gitHubConnection: $(githubConnectionName)
repositoryName: $(githubRepositoryName)
title: '$(projectName) v$(Build.SourceBranchName)'
releaseNotesFile: 'RELEASE_NOTES.md'
assets: |
bin\nuget\*.nupkg
Loading

0 comments on commit eccca00

Please sign in to comment.