Skip to content

Commit 5bc04a2

Browse files
Initial commit
0 parents  commit 5bc04a2

28 files changed

+1353
-0
lines changed
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
parameters:
2+
name: ''
3+
displayName: ''
4+
vmImage: ''
5+
outputDirectory: ''
6+
artifactName: ''
7+
timeoutInMinutes: 120
8+
9+
jobs:
10+
- job: ${{ parameters.name }}
11+
displayName: ${{ parameters.displayName }}
12+
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
13+
14+
pool:
15+
vmImage: ${{ parameters.vmImage }}
16+
17+
steps:
18+
- checkout: self # self represents the repo where the initial Pipelines YAML file was found
19+
clean: false # whether to fetch clean each time
20+
submodules: recursive # set to 'true' for a single level of submodules or 'recursive' to get submodules of submodules
21+
persistCredentials: true
22+
23+
- task: UseDotNet@2
24+
displayName: 'Use .NET'
25+
inputs:
26+
packageType: 'sdk'
27+
useGlobalJson: true
28+
29+
- script: dotnet tool restore
30+
displayName: 'Restore dotnet tools'
31+
32+
- pwsh: |
33+
.\build.ps1
34+
displayName: 'Update Release Notes'
35+
continueOnError: false
36+
37+
- script: dotnet build -c Release
38+
displayName: 'dotnet build'
39+
continueOnError: false
40+
41+
- script: dotnet test -c Release --no-build --logger:trx --collect:"XPlat Code Coverage" --results-directory TestResults --settings coverlet.runsettings
42+
displayName: 'Run tests'
43+
continueOnError: true # Allow continuation even if tests fail
44+
45+
- task: PublishTestResults@2
46+
inputs:
47+
testResultsFormat: VSTest
48+
testResultsFiles: '**/*.trx' #TestResults folder usually
49+
testRunTitle: ${{ parameters.name }}
50+
mergeTestResults: true
51+
failTaskOnFailedTests: false
52+
publishRunAttachments: true
53+
54+
- pwsh: |
55+
$coverageFiles = Get-ChildItem -Path "$(Build.SourcesDirectory)/TestResults" -Filter "*.cobertura.xml" -Recurse
56+
$hasCoverageFiles = $coverageFiles.Count -gt 0
57+
Write-Host "##vso[task.setvariable variable=HasCoverageFiles]$hasCoverageFiles"
58+
displayName: 'Check for Coverage Files'
59+
condition: always()
60+
continueOnError: true
61+
62+
- task: reportgenerator@5
63+
displayName: ReportGenerator
64+
# Only run if coverage files exist
65+
condition: and(always(), eq(variables['HasCoverageFiles'], 'True'))
66+
continueOnError: true
67+
inputs:
68+
reports: '$(Build.SourcesDirectory)/TestResults/**/*.cobertura.xml'
69+
targetdir: '$(Build.SourcesDirectory)/coveragereport'
70+
reporttypes: 'HtmlInline_AzurePipelines;Cobertura;Badges'
71+
assemblyfilters: '-xunit*'
72+
publishCodeCoverageResults: true
73+
74+
- publish: $(Build.SourcesDirectory)/coveragereport
75+
displayName: 'Publish Coverage Report'
76+
# Only run if coverage files exist
77+
condition: and(always(), eq(variables['HasCoverageFiles'], 'True'))
78+
continueOnError: true
79+
artifact: 'CoverageReports-$(Agent.OS)-$(Build.BuildId)'
80+
81+
- script: dotnet pack -c Release --no-build -o $(Build.ArtifactStagingDirectory)/nuget
82+
displayName: 'Create packages'
83+
84+
- task: PublishBuildArtifacts@1
85+
displayName: 'Publish artifacts'
86+
inputs:
87+
PathtoPublish: '$(Build.ArtifactStagingDirectory)/nuget'
88+
ArtifactName: 'nuget'
89+
publishLocation: 'Container'
90+
91+
- script: 'echo 1>&2'
92+
failOnStderr: true
93+
displayName: 'If above is partially succeeded, then fail'
94+
condition: eq(variables['Agent.JobStatus'], 'SucceededWithIssues')

.azure/pr-validation.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
trigger:
2+
branches:
3+
include:
4+
- dev
5+
- master
6+
7+
pr:
8+
autoCancel: true # indicates whether additional pushes to a PR should cancel in-progress runs for the same PR. Defaults to true
9+
branches:
10+
include: [ dev, master ] # branch names which will trigger a build
11+
12+
name: $(SourceBranchName)_$(Year:yyyy).$(Month).$(DayOfMonth)$(Rev:.r)
13+
14+
jobs:
15+
- template: azure-pipeline.template.yaml
16+
parameters:
17+
name: 'windows_pr'
18+
displayName: 'Windows PR Validation'
19+
vmImage: 'windows-latest'
20+
outputDirectory: 'bin/nuget'
21+
artifactName: 'nuget_pack-$(Build.BuildId)'
22+
23+
- template: azure-pipeline.template.yaml
24+
parameters:
25+
name: 'linux_pr'
26+
displayName: 'Linux PR Validation'
27+
vmImage: 'ubuntu-latest'
28+
outputDirectory: 'bin/nuget'
29+
artifactName: 'nuget_pack-$(Build.BuildId)'

.azure/windows-release.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Release task for Akka.Streams.Kafka
2+
# See https://docs.microsoft.com/en-us/azure/devops/pipelines/yaml-schema for reference
3+
4+
trigger:
5+
branches:
6+
include:
7+
- refs/tags/*
8+
pr: none
9+
10+
variables:
11+
- group: nugetKeys
12+
- name: githubConnectionName
13+
value: AkkaDotNet_Releases
14+
- name: projectName
15+
value: Akka.Streams.Kafka
16+
- name: githubRepositoryName
17+
value: akkadotnet/Akka.Streams.Kafka
18+
19+
jobs:
20+
- job: Release
21+
pool:
22+
vmImage: windows-latest
23+
demands: Cmd
24+
steps:
25+
- task: UseDotNet@2
26+
displayName: 'Use .NET SDK from global.json'
27+
inputs:
28+
useGlobalJson: true
29+
30+
- powershell: ./build.ps1
31+
displayName: 'Update Release Notes'
32+
33+
# Pack without version suffix for release
34+
- script: dotnet pack -c Release -o $(Build.ArtifactStagingDirectory)/nuget
35+
displayName: 'Create packages'
36+
37+
- script: dotnet nuget push "$(Build.ArtifactStagingDirectory)\nuget\*.nupkg" --api-key $(nugetKey) --source https://api.nuget.org/v3/index.json --skip-duplicate
38+
displayName: 'Publish to NuGet.org'
39+
40+
- task: GitHubRelease@0
41+
displayName: 'GitHub release (create)'
42+
inputs:
43+
gitHubConnection: $(githubConnectionName)
44+
repositoryName: $(githubRepositoryName)
45+
title: '$(projectName) v$(Build.SourceBranchName)'
46+
releaseNotesFile: 'RELEASE_NOTES.md'
47+
assets: '$(Build.ArtifactStagingDirectory)/nuget/*.nupkg'

.config/dotnet-tools.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"incrementalist.cmd": {
6+
"version": "1.0.0",
7+
"commands": [
8+
"incrementalist"
9+
],
10+
"rollForward": false
11+
},
12+
"docfx": {
13+
"version": "2.78.3",
14+
"commands": [
15+
"docfx"
16+
],
17+
"rollForward": false
18+
}
19+
}
20+
}

.gitattributes

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
*.csv -text
6+
7+
###############################################################################
8+
# Set default behavior for command prompt diff.
9+
#
10+
# This is need for earlier builds of msysgit that does not have it on by
11+
# default for csharp files.
12+
# Note: This is only used by command line
13+
###############################################################################
14+
#*.cs diff=csharp
15+
16+
###############################################################################
17+
# Set the merge driver for project and solution files
18+
#
19+
# Merging from the command prompt will add diff markers to the files if there
20+
# are conflicts (Merging from VS is not affected by the settings below, in VS
21+
# the diff markers are never inserted). Diff markers may cause the following
22+
# file extensions to fail to load in VS. An alternative would be to treat
23+
# these files as binary and thus will always conflict and require user
24+
# intervention with every merge. To do so, just uncomment the entries below
25+
###############################################################################
26+
#*.sln merge=binary
27+
#*.csproj merge=binary
28+
#*.vbproj merge=binary
29+
#*.vcxproj merge=binary
30+
#*.vcproj merge=binary
31+
#*.dbproj merge=binary
32+
#*.fsproj merge=binary
33+
#*.lsproj merge=binary
34+
#*.wixproj merge=binary
35+
#*.modelproj merge=binary
36+
#*.sqlproj merge=binary
37+
#*.wwaproj merge=binary
38+
39+
###############################################################################
40+
# behavior for image files
41+
#
42+
# image files are treated as binary by default.
43+
###############################################################################
44+
#*.jpg binary
45+
#*.png binary
46+
#*.gif binary
47+
48+
###############################################################################
49+
# diff behavior for common document formats
50+
#
51+
# Convert binary document formats to text before diffing them. This feature
52+
# is only available from the command line. Turn it on by uncommenting the
53+
# entries below.
54+
###############################################################################
55+
#*.doc diff=astextplain
56+
#*.DOC diff=astextplain
57+
#*.docx diff=astextplain
58+
#*.DOCX diff=astextplain
59+
#*.dot diff=astextplain
60+
#*.DOT diff=astextplain
61+
#*.pdf diff=astextplain
62+
#*.PDF diff=astextplain
63+
#*.rtf diff=astextplain
64+
#*.RTF diff=astextplain

.github/dependabot.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
8+
- package-ecosystem: "dotnet-sdk"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"
12+
day: "wednesday"
13+
14+
- package-ecosystem: nuget
15+
directory: "/"
16+
schedule:
17+
interval: daily
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: pr_validation
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- dev
8+
- main
9+
pull_request:
10+
branches:
11+
- master
12+
- dev
13+
- main
14+
15+
jobs:
16+
test:
17+
name: Test-${{matrix.os}}
18+
runs-on: ${{matrix.os}}
19+
20+
strategy:
21+
matrix:
22+
os: [ubuntu-latest, windows-latest]
23+
24+
steps:
25+
- name: "Checkout"
26+
uses: actions/[email protected]
27+
with:
28+
lfs: true
29+
fetch-depth: 0
30+
31+
- name: "Install .NET SDK"
32+
uses: actions/[email protected]
33+
with:
34+
global-json-file: "./global.json"
35+
36+
- name: "Restore .NET tools"
37+
run: dotnet tool restore
38+
39+
- name: "Update release notes"
40+
shell: pwsh
41+
run: |
42+
./build.ps1
43+
44+
- name: "dotnet build"
45+
run: dotnet build -c Release
46+
47+
# .NET Framework tests can't run reliably on Linux, so we only do .NET 8
48+
49+
- name: "dotnet test"
50+
shell: bash
51+
run: dotnet test -c Release
52+
53+
- name: "dotnet pack"
54+
run: dotnet pack -c Release -o ./bin/nuget
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Publish NuGet
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish-nuget:
10+
11+
name: publish-nuget
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
os: [ubuntu-latest]
16+
17+
steps:
18+
- name: "Checkout"
19+
uses: actions/[email protected]
20+
with:
21+
lfs: true
22+
fetch-depth: 0
23+
24+
- name: "Install .NET SDK"
25+
uses: actions/[email protected]
26+
with:
27+
global-json-file: "./global.json"
28+
29+
- name: "Restore .NET tools"
30+
run: dotnet tool restore
31+
32+
- name: "Update release notes"
33+
shell: pwsh
34+
run: |
35+
./build.ps1
36+
37+
- name: Create Packages
38+
run: dotnet pack /p:PackageVersion=${{ github.ref_name }} -c Release -o ./output
39+
40+
- name: Push Packages
41+
run: dotnet nuget push "output/*.nupkg" -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
42+
43+
- name: release
44+
uses: actions/create-release@v1
45+
id: create_release
46+
with:
47+
draft: false
48+
prerelease: false
49+
release_name: 'Akka.Hosting ${{ github.ref_name }}'
50+
tag_name: ${{ github.ref }}
51+
body_path: RELEASE_NOTES.md
52+
env:
53+
GITHUB_TOKEN: ${{ github.token }}
54+
55+
- name: Upload Release Asset
56+
uses: AButler/[email protected]
57+
with:
58+
repo-token: ${{ github.token }}
59+
release-tag: ${{ github.ref_name }}
60+
files: 'output/*.nupkg'

0 commit comments

Comments
 (0)