Skip to content

Commit

Permalink
Merge pull request #104 from ionite34/tag-build-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ionite34 authored Jun 25, 2023
2 parents f042ce5 + 3b00101 commit 5c4cc85
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,37 @@ node("Windows") {
}

if (env.BRANCH_NAME == 'main') {

stage('Set Version') {
version = VersionNumber projectStartDate: '2023-06-21', versionNumberString: '1.0.${BUILDS_ALL_TIME}.0', versionPrefix: '', worstResultForIncrement: 'SUCCESS'
script {
if (env.TAG_NAME) {
version = env.TAG_NAME.replaceFirst(/^v/, '') + ".0"
} else {
version = VersionNumber projectStartDate: '2023-06-21', versionNumberString: '1.0.${BUILDS_ALL_TIME}.0', versionPrefix: '', worstResultForIncrement: 'SUCCESS'
}
}
}

stage('Publish') {
bat "dotnet publish .\\StabilityMatrix\\StabilityMatrix.csproj -c Release -o out -r win-x64 -p:PublishSingleFile=true -p:Version=${version} --self-contained true"
}

if (env.TAG_NAME) {
stage('Sentry Release') {
bat "pip install sentry-cli"
def sentry_org = "stability-matrix"
def sentry_project = "dotnet"
def sentry_environment = "production"
def sentry_release = "StabilityMatrix@${version}"

bat "sentry-cli releases new -p ${sentry_project} ${sentry_release}"
bat "sentry-cli releases set-commits ${sentry_release} --auto"
bat "sentry-cli releases files ${sentry_release} upload-sourcemaps ./out"
bat "sentry-cli releases finalize ${sentry_release}"
bat "sentry-cli releases deploys ${sentry_release} new -e ${sentry_environment}"
}
}

stage ('Archive Artifacts') {
archiveArtifacts artifacts: 'out/*.exe', followSymlinks: false
}
Expand Down

0 comments on commit 5c4cc85

Please sign in to comment.