Skip to content

Commit 3953433

Browse files
committed
Merge pull request scala#4481 from lrytz/2.12.x
Fixes to the release script, remove existing artifacts before building.
2 parents faa3264 + 1a292c3 commit 3953433

File tree

2 files changed

+42
-15
lines changed

2 files changed

+42
-15
lines changed

scripts/jobs/integrate/bootstrap

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ update() {
141141
cd $2
142142

143143
git fetch --tags "https://github.com/$1/$2.git"
144-
(git fetch "https://github.com/$1/$2.git" $3 && git checkout -q FETCH_HEAD) #|| git checkout -q $3 # || fallback is for local testing on tag
144+
(git fetch "https://github.com/$1/$2.git" $3 && git checkout -fq FETCH_HEAD) #|| git checkout -fq $3 # || fallback is for local testing on tag
145145
git reset --hard
146146
}
147147

@@ -258,18 +258,21 @@ buildSwing() {
258258
fi
259259
}
260260

261+
# should only be called with publishTasks publishing to private-repo
261262
buildScalacheck(){
262263
if [ "$SCALACHECK_BUILT" != "yes" ] && [ "$forceRebuild" != "yes" ] && ( sbtResolve "org.scalacheck" "scalacheck" $SCALACHECK_VER )
263264
then echo "Found scalacheck $SCALACHECK_VER; not building."
264265
else
265266
update rickynils scalacheck $SCALACHECK_REF && gfxd
266-
sbtBuild 'set version := "'$SCALACHECK_VER'"' 'set VersionKeys.scalaParserCombinatorsVersion := "'$PARSERS_VER'"' $clean $publishPrivateTask # test times out NOTE: never published to sonatype
267+
sbtBuild 'set version := "'$SCALACHECK_VER'"' 'set VersionKeys.scalaParserCombinatorsVersion := "'$PARSERS_VER'"' $clean publish # test times out NOTE: never published to sonatype
267268
SCALACHECK_BUILT="yes"
268269
fi
269270
}
270271

271272
# build modules, using ${buildTasks[@]} (except for Scalacheck, which is hard-coded to publish to private-repo)
272273
buildModules() {
274+
publishTasks=('set credentials += Credentials(Path.userHome / ".credentials-private-repo")' "set every publishTo := Some(\"private-repo\" at \"$releaseTempRepoUrl\")")
275+
buildTasks=($publishPrivateTask)
273276
buildXML
274277
buildParsers
275278
buildSwing
@@ -278,6 +281,16 @@ buildModules() {
278281
# buildPartestIface
279282
}
280283

284+
buildPublishedModules() {
285+
publishTasks=('set credentials += Credentials(Path.userHome / ".credentials-sonatype")' "set pgpPassphrase := Some(Array.empty)")
286+
buildTasks=($publishSonatypeTaskModules)
287+
buildXML
288+
buildParsers
289+
buildSwing
290+
buildPartest
291+
# buildPartestIface
292+
}
293+
281294

282295
## BUILD STEPS:
283296

@@ -416,6 +429,29 @@ deriveModuleVersions() {
416429
# PARTEST_IFACE_VER=${PARTEST_IFACE_VER-$(deriveVersion scala scala-partest-interface "$PARTEST_IFACE_REF")}
417430
}
418431

432+
createNetrcFile() {
433+
local netrcFile=$HOME/`basename $1`-netrc
434+
grep 'host=' $1 | sed 's/host=\(.*\)/machine \1/' > $netrcFile
435+
grep 'user=' $1 | sed 's/user=\(.*\)/login \1/' >> $netrcFile
436+
grep 'password=' $1 | sed 's/password=\(.*\)/password \1/' >> $netrcFile
437+
}
438+
439+
removeExistingBuilds() {
440+
createNetrcFile "$HOME/.credentials-private-repo"
441+
local netrcFile="$HOME/.credentials-private-repo-netrc"
442+
443+
local storageApiUrl=`echo $releaseTempRepoUrl | sed 's/\(scala-release-temp\)/api\/storage\/\1/'`
444+
local scalaLangModules=`curl -s $storageApiUrl/org/scala-lang | jq -r '.children | .[] | "org/scala-lang" + .uri'`
445+
446+
for module in "org/scalacheck" $scalaLangModules; do
447+
local artifacts=`curl -s $storageApiUrl/$module | jq -r ".children | .[] | select(.uri | contains(\"$SCALA_VER\")) | .uri"`
448+
for artifact in $artifacts; do
449+
echo "Deleting $releaseTempRepoUrl$module$artifact"
450+
curl -s --netrc-file $netrcFile -X DELETE $releaseTempRepoUrl$module$artifact
451+
done
452+
done
453+
}
454+
419455
constructUpdatedModuleVersions() {
420456
updatedModuleVersions=()
421457

@@ -466,8 +502,6 @@ bootstrap() {
466502
# publish to our internal repo (so we can resolve the modules in the scala build below)
467503
# we only need to build the modules necessary to build Scala itself
468504
# since the version of locker and quick are the same
469-
publishTasks=('set credentials += Credentials(Path.userHome / ".credentials-private-repo")' "set every publishTo := Some(\"private-repo\" at \"$releaseTempRepoUrl\")")
470-
buildTasks=($publishPrivateTask)
471505
buildModules
472506

473507
constructUpdatedModuleVersions
@@ -521,9 +555,7 @@ publishSonatype() {
521555
# (was hoping we could make everything go to the same staging repo, but it's not timing that causes two staging repos to be opened)
522556
# NOTE: only publish those for which versions are set
523557
# test and publish to sonatype, assuming you have ~/.sbt/0.13/sonatype.sbt and ~/.sbt/0.13/plugin/gpg.sbt
524-
publishTasks=('set credentials += Credentials(Path.userHome / ".credentials-sonatype")' "set pgpPassphrase := Some(Array.empty)")
525-
buildTasks=($publishSonatypeTaskModules)
526-
buildModules
558+
buildPublishedModules
527559

528560
open=$(st_stagingReposOpen)
529561
allOpenUrls=$(echo $open | jq '.repositoryURI' | tr -d \")
@@ -543,15 +575,10 @@ determineScalaVersion
543575

544576
deriveModuleVersions
545577

578+
removeExistingBuilds
579+
546580
bootstrap
547581

548582
if [ "$publishToSonatype" == "yes" ]
549583
then publishSonatype
550-
else # build modules one more time, just to mimic the regular build as much when running as nightly
551-
echo "### Rebuilding modules with quick, publishing to $baseDir/ivy/local"
552-
buildTasks=(publish-local)
553-
# buildScalacheck always uses publishPrivateTask (not buildTasks). we override it to avoid publishing to private-repo.
554-
publishPrivateTask="publish-local"
555-
forceRebuild="yes"
556-
buildModules
557584
fi

versions.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jline.version=2.12.1
2929

3030
# external modules, used internally (not shipped)
3131
partest.version.number=1.0.7
32-
scalacheck.version.number=1.12.2
32+
scalacheck.version.number=1.11.6
3333

3434
# TODO: modularize the compiler
3535
#scala-compiler-doc.version.number=1.0.0-RC1

0 commit comments

Comments
 (0)