2022-10-31 12:49:35 +01:00
|
|
|
pipeline {
|
|
|
|
agent any
|
|
|
|
stages {
|
|
|
|
stage('Test') {
|
|
|
|
steps {
|
|
|
|
sh 'dotnet test --collect:"XPlat Code Coverage"'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Pack') {
|
|
|
|
steps {
|
2022-10-31 13:03:45 +01:00
|
|
|
sh 'find . -type f -name "*.nupkg" -delete'
|
2022-10-31 12:49:35 +01:00
|
|
|
sh 'dotnet pack --version-suffix ${BUILD_NUMBER}'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage('Publish') {
|
|
|
|
when {
|
|
|
|
branch 'main'
|
|
|
|
}
|
|
|
|
steps {
|
2022-10-31 13:00:46 +01:00
|
|
|
sh 'dotnet nuget push -s https://nuget.ellpeck.de/v3/index.json **/*.nupkg -k $BAGET -n'
|
2022-10-31 12:49:35 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
nunit testResultsPattern: '**/TestResults.xml'
|
|
|
|
cobertura coberturaReportFile: '**/coverage.cobertura.xml'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
environment {
|
|
|
|
BAGET = credentials('3db850d0-e6b5-43d5-b607-d180f4eab676')
|
|
|
|
}
|
|
|
|
}
|