@@ -106,9 +106,9 @@ node('rhel8'){
106106node(' rhel8' ){
107107 sh ' npm install -g --force "@vscode/vsce"'
108108 sh ' npm install -g "ovsx"'
109- if (publishToMarketPlace. equals(' true' ) || publishPreRelease. equals(' true' )){
109+ if (publishToMarketPlace. equals(' true' ) || publishToOVSX . equals( ' true ' ) || publishPreRelease. equals(' true' )){
110110
111- if (publishToMarketPlace. equals(' true' )) {
111+ if (publishToMarketPlace. equals(' true' ) || publishToOVSX . equals( ' true ' ) ) {
112112 timeout(time :2 , unit :' DAYS' ) {
113113 input message :' Approve deployment?' , submitter : ' fbricon,rgrunber,azerr,davthomp'
114114 }
@@ -117,22 +117,29 @@ node('rhel8'){
117117 stage " Publish to Marketplaces"
118118 unstash ' vsix'
119119 def vsix = findFiles(glob : ' **.vsix' )
120+ def platformVsixes = findFiles(glob : ' **.vsix' , excludes : vsix[0 ]. path)
121+
120122 // VS Code Marketplace
121- withCredentials([[$class : ' StringBinding' , credentialsId : ' vscode_java_marketplace' , variable : ' TOKEN' ]]) {
122- def platformVsixes = findFiles(glob : ' **.vsix' , excludes : vsix[0 ]. path)
123- for (platformVsix in platformVsixes){
124- sh ' vsce publish -p ${TOKEN}' + " --packagePath ${ platformVsix.path} "
123+ if (publishToMarketPlace. equals(' true' ) || publishPreRelease. equals(' true' )) {
124+ withCredentials([[$class : ' StringBinding' , credentialsId : ' vscode_java_marketplace' , variable : ' TOKEN' ]]) {
125+ for (platformVsix in platformVsixes){
126+ sh ' vsce publish -p ${TOKEN}' + " --packagePath ${ platformVsix.path} "
127+ }
128+ // Cannot combine packagePath & target, so re-generate (generic) package and publish
129+ sh ' vsce publish -p ${TOKEN}' + " ${ env.publishPreReleaseFlag} "
125130 }
126- // Cannot combine packagePath & target, so re-generate (generic) package and publish
127- sh ' vsce publish -p ${TOKEN} --target win32-ia32 win32-arm64 linux-arm64 linux-armhf alpine-x64 alpine-arm64' + " ${ env.publishPreReleaseFlag} "
128131 }
129132
130- if (publishToMarketPlace . equals( ' true ' )) {
131- // Open-VSX Marketplace does not support pre-release
133+ // Open-VSX Marketplace
134+ if (publishToOVSX . equals( ' true ' ) || publishPreRelease . equals( ' true ' )) {
132135 withCredentials([[$class : ' StringBinding' , credentialsId : ' open-vsx-access-token' , variable : ' OVSX_TOKEN' ]]) {
133- sh ' ovsx publish -p ${OVSX_TOKEN}' + " ${ vsix[0].path} "
136+ for (platformVsix in platformVsixes){
137+ sh ' ovsx publish -p ${OVSX_TOKEN}' + " --packagePath ${ platformVsix.path} "
138+ }
139+
140+ sh ' ovsx publish -p ${OVSX_TOKEN}' + " ${ env.publishPreReleaseFlag} "
134141 }
135142 }
136143
137- }// if publishToMarketPlace
144+ }// if any publishing
138145}
0 commit comments