Skip to content
This repository was archived by the owner on Mar 20, 2025. It is now read-only.

Commit 0b9596c

Browse files
added Azure DevOps build pipeline (#75)
1 parent 186d719 commit 0b9596c

File tree

4 files changed

+123
-0
lines changed

4 files changed

+123
-0
lines changed

build-system/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Azure Pipelines Build Files
2+
These `.yaml` files are used by Windows Azure DevOps Pipelines to help execute the following types of builds:
3+
4+
- Pull request validation on Linux (Mono / .NET Core)
5+
- Pull request validation on Windows (.NET Framework / .NET Core)
6+
- NuGet releases with automatic release notes posted to a Github Release repository.
7+
8+
**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.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
parameters:
2+
name: ''
3+
vmImage: ''
4+
displayName: ''
5+
scriptFileName: ''
6+
scriptArgs: 'all'
7+
timeoutInMinutes: 120
8+
9+
jobs:
10+
- job: ${{ parameters.name }}
11+
displayName: ${{ parameters.displayName }}
12+
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
13+
pool:
14+
vmImage: ${{ parameters.vmImage }}
15+
steps:
16+
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
17+
clean: false # whether to fetch clean each time
18+
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
19+
persistCredentials: true
20+
# Linux or macOS
21+
- task: Bash@3
22+
displayName: Linux / OSX Build
23+
inputs:
24+
filePath: ${{ parameters.scriptFileName }}
25+
arguments: ${{ parameters.scriptArgs }}
26+
continueOnError: true
27+
condition: in( variables['Agent.OS'], 'Linux', 'Darwin' )
28+
# Windows test is disabled, could not use redis container in Azure Pipelines
29+
# - task: BatchScript@1
30+
# displayName: Windows Build
31+
# inputs:
32+
# filename: ${{ parameters.scriptFileName }}
33+
# arguments: ${{ parameters.scriptArgs }}
34+
# continueOnError: true
35+
# condition: eq( variables['Agent.OS'], 'Windows_NT' )
36+
- task: PublishTestResults@2
37+
inputs:
38+
testRunner: VSTest
39+
testResultsFiles: '**/*.trx' #TestResults folder usually
40+
testRunTitle: ${{ parameters.name }}
41+
mergeTestResults: true
42+
- script: 'echo 1>&2'
43+
failOnStderr: true
44+
displayName: 'If above is partially succeeded, then fail'
45+
condition: eq(variables['Agent.JobStatus'], 'SucceededWithIssues')

build-system/pr-validation.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Pull request validation for Windows against the `dev` and `master` branches
2+
# See https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema for reference
3+
trigger:
4+
branches:
5+
include:
6+
- dev
7+
- master
8+
9+
pr:
10+
autoCancel: true # indicates whether additional pushes to a PR should cancel in-progress runs for the same PR. Defaults to true
11+
branches:
12+
include: [ dev, master ] # branch names which will trigger a build
13+
14+
name: $(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
15+
16+
jobs:
17+
# Windows testing is disabled, Redis linux container can not run in windows docker.
18+
# - template: azure-pipeline.template.yaml
19+
# parameters:
20+
# name: 'windows_pr'
21+
# displayName: 'Windows PR Validation'
22+
# vmImage: 'windows-2019'
23+
# scriptFileName: build.cmd
24+
# scriptArgs: all
25+
26+
- template: azure-pipeline.template.yaml
27+
parameters:
28+
name: 'linux_pr'
29+
displayName: 'Linux PR Validation'
30+
vmImage: 'ubuntu-16.04'
31+
scriptFileName: ./build.sh
32+
scriptArgs: RunTests

build-system/windows-release.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Release task for PbLib projects
2+
# See https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema for reference
3+
4+
pool:
5+
vmImage: vs2017-win2016
6+
demands: Cmd
7+
8+
trigger:
9+
branches:
10+
include:
11+
- refs/tags/*
12+
pr: none
13+
14+
variables:
15+
- group: signingSecrets #create this group with SECRET variables `signingUsername` and `signingPassword`
16+
- group: nugetKeys #create this group with SECRET variables `nugetKey`
17+
- name: githubConnectionName
18+
value: AkkaDotNet_Releases
19+
- name: projectName
20+
value: Akka.Persistence.PostgreSql
21+
- name: githubRepositoryName
22+
value: akkadotnet/Akka.Persistence.PostgreSql
23+
steps:
24+
- task: BatchScript@1
25+
displayName: 'FAKE Build'
26+
inputs:
27+
filename: build.cmd
28+
arguments: 'Nuget SignClientUser=$(signingUsername) SignClientSecret=$(signingPassword) nugetpublishurl=https://www.nuget.org/api/v2/package nugetkey=$(nugetKey)'
29+
30+
- task: GitHubRelease@0
31+
displayName: 'GitHub release (create)'
32+
inputs:
33+
gitHubConnection: $(githubConnectionName)
34+
repositoryName: $(githubRepositoryName)
35+
title: '$(projectName) v$(Build.SourceBranchName)'
36+
releaseNotesFile: 'RELEASE_NOTES.md'
37+
assets: |
38+
bin\nuget\*.nupkg

0 commit comments

Comments
 (0)