Skip to content

Commit f42b9d1

Browse files
committed
Копирование описаний релиза из release-notes и публикация nuget
1 parent 3a1a1e7 commit f42b9d1

1 file changed

Lines changed: 44 additions & 10 deletions

File tree

Jenkinsfile

Lines changed: 44 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -228,16 +228,17 @@ pipeline {
228228
}
229229
}
230230
agent { label 'master' }
231+
options { skipDefaultCheckout() }
231232

232233
steps {
233234
cleanWs()
235+
234236
unstash 'dist'
235237
unstash 'vsix'
236238

237239
dir('targetContent') {
238240
sh '''
239241
ZIPS=../built
240-
NUGET=../built/nuget
241242
VSIX=../built/vscode
242243
mv $ZIPS/*.zip ./
243244
mv $VSIX/*.vsix ./
@@ -255,9 +256,14 @@ pipeline {
255256
}
256257
}
257258
agent { label 'master' }
258-
259+
options { skipDefaultCheckout() }
260+
261+
environment {
262+
CODENAME = 'preview'
263+
}
264+
259265
steps {
260-
266+
checkout scm
261267
unstash 'dist'
262268
unstash 'vsix'
263269

@@ -269,29 +275,39 @@ pipeline {
269275
mv $ZIPS/*.zip ./
270276
mv $VSIX/*.vsix ./
271277
272-
TARGET="/var/www/oscript.io/download/versions/preview/"
278+
TARGET="/var/www/oscript.io/download/versions/${CODENAME}/"
273279
sudo rsync -rv --delete --exclude mddoc*.zip --exclude *.src.rpm . $TARGET
274280
'''.stripIndent()
275281
}
282+
283+
sh '''
284+
TARGET_DIR="/var/www/oscript.io/markdown/versions/"
285+
cp install/release-notes.md "${TARGET_DIR}/${CODENAME}.md"
286+
cp install/release-notes.md "${TARGET_DIR}/${VersionPrefix}.md"
287+
'''.stripIndent()
276288
}
277289
}
278-
290+
279291
stage ('Publishing latest') {
280292
when { anyOf {
281-
branch 'latest';
293+
branch 'release/latest';
282294
}
283295
}
284296
agent { label 'master' }
285-
297+
options { skipDefaultCheckout() }
298+
299+
environment {
300+
CODENAME = 'preview'
301+
}
302+
286303
steps {
287-
304+
checkout scm
288305
unstash 'dist'
289306
unstash 'vsix'
290-
307+
291308
dir('targetContent') {
292309
sh '''
293310
ZIPS=../built
294-
NUGET=../built/nuget
295311
VSIX=../built/vscode
296312
mv $ZIPS/*.zip ./
297313
mv $VSIX/*.vsix ./
@@ -302,5 +318,23 @@ pipeline {
302318
}
303319
}
304320
}
321+
322+
stage ('Publishing artifacts to clouds') {
323+
when {
324+
anyOf {
325+
branch 'release/latest';
326+
branch 'release/preview';
327+
}
328+
}
329+
330+
agent { label 'windows' }
331+
332+
steps{
333+
unstash 'dist'
334+
withCredentials([string(credentialsId: 'NuGetToken', variable: 'NUGET_TOKEN')]) {
335+
bat "chcp $outputEnc > nul\r\n\"${tool 'MSBuild'}\" Build.csproj /t:PublishNuget /p:NugetToken=$NUGET_TOKEN"
336+
}
337+
}
338+
}
305339
}
306340
}

0 commit comments

Comments
 (0)