Browse Source

Reorganize publish and version stages

pull/5/head
Ionite 1 year ago
parent
commit
d941022c9c
No known key found for this signature in database
  1. 14
      Jenkinsfile

14
Jenkinsfile vendored

@ -15,23 +15,19 @@ node("Windows") {
bat "dotnet test StabilityMatrix.Tests" bat "dotnet test StabilityMatrix.Tests"
} }
stage('Set Version') {
if (env.BRANCH_NAME == 'main') { if (env.BRANCH_NAME == 'main') {
stage('Set Version') {
version = VersionNumber projectStartDate: '', versionNumberString: '1.0.${BUILDS_ALL_TIME}.0', versionPrefix: '', worstResultForIncrement: 'SUCCESS' version = VersionNumber projectStartDate: '', versionNumberString: '1.0.${BUILDS_ALL_TIME}.0', versionPrefix: '', worstResultForIncrement: 'SUCCESS'
} }
}
stage('Publish') { stage('Publish') {
if (env.BRANCH_NAME == 'main') {
bat "dotnet publish .\\StabilityMatrix\\StabilityMatrix.csproj -c Release -o out -r win-x64 -p:PublishSingleFile=true -p:Version=${version} --self-contained true" bat "dotnet publish .\\StabilityMatrix\\StabilityMatrix.csproj -c Release -o out -r win-x64 -p:PublishSingleFile=true -p:Version=${version} --self-contained true"
} else {
bat "dotnet publish .\\StabilityMatrix\\StabilityMatrix.csproj -c Release -o out -r win-x64 -p:PublishSingleFile=true --self-contained true"
} }
}
if (env.BRANCH_NAME == "main") {
stage ('Archive Artifacts') { stage ('Archive Artifacts') {
archiveArtifacts artifacts: 'out/*.exe', followSymlinks: false archiveArtifacts artifacts: 'out/*.exe', followSymlinks: false
} }
} else {
stage('Publish') {
bat "dotnet publish .\\StabilityMatrix\\StabilityMatrix.csproj -c Release -o out -r win-x64 -p:PublishSingleFile=true --self-contained true"
}
} }
} }

Loading…
Cancel
Save