Skip to content

Commit 5c4cc85

Browse files
authored
Merge pull request #104 from ionite34/tag-build-ci
2 parents f042ce5 + 3b00101 commit 5c4cc85

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

Jenkinsfile

+26-1
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,37 @@ node("Windows") {
1616
}
1717

1818
if (env.BRANCH_NAME == 'main') {
19+
1920
stage('Set Version') {
20-
version = VersionNumber projectStartDate: '2023-06-21', versionNumberString: '1.0.${BUILDS_ALL_TIME}.0', versionPrefix: '', worstResultForIncrement: 'SUCCESS'
21+
script {
22+
if (env.TAG_NAME) {
23+
version = env.TAG_NAME.replaceFirst(/^v/, '') + ".0"
24+
} else {
25+
version = VersionNumber projectStartDate: '2023-06-21', versionNumberString: '1.0.${BUILDS_ALL_TIME}.0', versionPrefix: '', worstResultForIncrement: 'SUCCESS'
26+
}
27+
}
2128
}
29+
2230
stage('Publish') {
2331
bat "dotnet publish .\\StabilityMatrix\\StabilityMatrix.csproj -c Release -o out -r win-x64 -p:PublishSingleFile=true -p:Version=${version} --self-contained true"
2432
}
33+
34+
if (env.TAG_NAME) {
35+
stage('Sentry Release') {
36+
bat "pip install sentry-cli"
37+
def sentry_org = "stability-matrix"
38+
def sentry_project = "dotnet"
39+
def sentry_environment = "production"
40+
def sentry_release = "StabilityMatrix@${version}"
41+
42+
bat "sentry-cli releases new -p ${sentry_project} ${sentry_release}"
43+
bat "sentry-cli releases set-commits ${sentry_release} --auto"
44+
bat "sentry-cli releases files ${sentry_release} upload-sourcemaps ./out"
45+
bat "sentry-cli releases finalize ${sentry_release}"
46+
bat "sentry-cli releases deploys ${sentry_release} new -e ${sentry_environment}"
47+
}
48+
}
49+
2550
stage ('Archive Artifacts') {
2651
archiveArtifacts artifacts: 'out/*.exe', followSymlinks: false
2752
}

0 commit comments

Comments
 (0)