From 6b073d7174c01385868af6e236946d3d28482944 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sat, 11 Apr 2020 03:21:55 +0200 Subject: [PATCH] create automatic pack/publish for release branch --- Jenkinsfile | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a9939a6..5e9ddea 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -10,28 +10,39 @@ done''' } } - stage('Pack') { + stage('Pack and Publish') { + when { + branch 'master' + } steps { sh 'find . -type f -name \'*.nupkg\' -delete' sh '''for i in **/MLEM*.csproj; do dotnet pack $i --version-suffix ${BUILD_NUMBER} done''' - } - } - - stage('Publish') { - when { - branch 'master' - } - steps { sh '''for i in **/*.nupkg; do dotnet nuget push -s http://localhost:5000/v3/index.json $i -k $BAGET -n true done''' } } + + stage('Pack and Publish') { + when { + branch 'release' + } + steps { + sh 'find . -type f -name \'*.nupkg\' -delete' + sh '''for i in **/MLEM*.csproj; do + dotnet pack $i +done''' + sh '''for i in **/*.nupkg; do + dotnet nuget push -s https://api.nuget.org/v3/index.json $i -k $NUGET -n true +done''' + } + } } environment { BAGET = credentials('3db850d0-e6b5-43d5-b607-d180f4eab676') + NUGET = credentials('e1bf7f6c-6047-4f7e-b639-15240a8f8351') } }