Skip to content

Commit 9af9bbf

Browse files
authored
Merge pull request #535 from non/topic/release-process
Set up a repeatable release process.
2 parents d7afb54 + f03d1e1 commit 9af9bbf

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

build.sbt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ lazy val sharedSettings = MimaSettings.settings ++ scalaVersionSettings ++ Seq(
145145
lazy val js = project.in(file("js"))
146146
.settings(sharedSettings: _*)
147147
.settings(
148+
// remove scala 2.10 since scala.js dropped support
149+
crossScalaVersions := Seq("2.11.12", "2.12.9", scalaVersion.value),
148150
scalaJSStage in Global := FastOptStage,
149151
libraryDependencies += "org.scala-js" %% "scalajs-test-interface" % scalaJSVersion
150152
)
@@ -162,6 +164,7 @@ lazy val native = project.in(file("native"))
162164
.settings(
163165
doc in Compile := (doc in Compile in jvm).value,
164166
scalaVersion := "2.11.12",
167+
crossScalaVersions := Seq("2.11.12"),
165168
// TODO: re-enable MiMa for native once published
166169
mimaPreviousArtifacts := Set(),
167170
libraryDependencies ++= Seq(

release.sh

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
#!/bin/sh
2+
3+
# overview:
4+
# - before running this script, follow steps 1-3.
5+
# - running this script counts as step 4.
6+
# - after running this script, follow step 5.
7+
#
8+
# step 1: double-check scala.js and scala native versions.
9+
#
10+
# step 2: tag the release
11+
#
12+
# step 3: edit build.sbt
13+
# a. set versionNumber to this release number (e.g. "1.14.2" or "1.14.3-M1")
14+
# this version could include RC or M but should not include SNAPSHOT.
15+
# b. set isRelease to true
16+
#
17+
# step 4: start the actual release
18+
# a. run ./release.sh publishSigned
19+
# b. you need to have PGP set up to work with SBT.
20+
# we'll invoke SBT 5 times (jvm + 2js + 2native)
21+
# so you'll need to enter your password 5 times.
22+
# it's annoying :/
23+
#
24+
# step 5: edit build.sbt again
25+
# a. set versionNumber to the next release number (e.g. "1.14.3")
26+
# note -- don't include SNAPSHOT, RC, or M in this version.
27+
# b. set isRelease back to false
28+
29+
usage() {
30+
echo "usage: $0 [compile | test | package | publishLocal | publishSigned]"
31+
exit 1
32+
}
33+
34+
runsbt() {
35+
sbt "$1"
36+
RES=$?
37+
if [ $RES -ne 0 ]; then
38+
echo "sbt '$1' failed: $RES"
39+
exit $RES
40+
fi
41+
}
42+
43+
if [ $# -ne 1 ]; then usage; fi
44+
45+
case "$1" in
46+
compile|test|package|publishLocal)
47+
CMD="$1";;
48+
publishSigned)
49+
egrep -q '^lazy val isRelease = true$' build.sbt
50+
if [ $? -ne 0 ]; then
51+
echo "isRelease is not true in build.sbt. fix this!"
52+
echo "also make sure versionNumber is correct!"
53+
usage
54+
fi
55+
CMD="$1";;
56+
*) echo "unknown argument: $1"; usage;;
57+
esac
58+
59+
# step 4a: jvm release
60+
runsbt "+ jvm/$CMD"
61+
62+
# step 4b: js releases
63+
SCALAJS_VERSION="0.6.28" runsbt "+ js/$CMD"
64+
SCALAJS_VERSION="1.0.0-M8" runsbt "+ js/$CMD"
65+
66+
# step 4c: native releases
67+
SCALANATIVE_VERSION="0.3.9" runsbt "+ native/$CMD"
68+
SCALANATIVE_VERSION="0.4.0-M2" runsbt "+ native/$CMD"

0 commit comments

Comments
 (0)