diff --git a/Jenkinsfile b/Jenkinsfile index e5a28f47f..3a80d977a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -28,8 +28,8 @@ node('rhel8') { stage('package') { def packageJson = readJSON file: 'package.json' - // We always replace MAJOR.MINOR.PATCH from package.json with MAJOR.MINOR.BUILD - def version = packageJson.version[0..packageJson.version.lastIndexOf('.') - 1] + ".${env.BUILD_NUMBER}" + // We add "-alpha" for pre-releases and add "+BUILD" at the end, i.e. results would be either MAJOR.MINOR.PATCH+BUILD or MAJOR.MINOR.PATCH-alpha+BUILD + def version = packageJson.version + "${ params.publishPreRelease ? '-alpha' : '' }+${env.BUILD_NUMBER}" sh "yarn run vsce package ${ params.publishPreRelease ? '--pre-release' : '' } --no-dependencies --no-git-tag-version --no-update-package-json ${ version }" }