Skip to content

Commit 1523601

Browse files
committed
Build from fresh modules
1 parent d651c95 commit 1523601

File tree

5 files changed

+101
-11
lines changed

5 files changed

+101
-11
lines changed

.github/workflows/ci.yml

+27-5
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,28 @@ jobs:
2929
SCALA_212: 2.12.12
3030
SCALA_213: 2.13.1
3131
UTIL_TESTS: utilCache/test;utilControl/test;utilInterface/test;utilLogging/test;utilPosition/test;utilRelation/test;utilScripted/test;utilTracking/test
32-
CURRENT_SNAPSHOT_VER: 1.4.3-SNAPSHOT
3332
SBT_LOCAL: false
3433
steps:
35-
- name: Checkout
36-
uses: actions/checkout@v1
34+
- name: Checkout sbt/sbt
35+
uses: actions/checkout@v2
36+
- name: Checkout sbt/io
37+
uses: actions/checkout@v2
38+
with:
39+
repository: sbt/io
40+
ref: develop
41+
path: io
42+
- name: Checkout sbt/librarymanagement
43+
uses: actions/checkout@v2
44+
with:
45+
repository: sbt/librarymanagement
46+
ref: develop
47+
path: librarymanagement
48+
- name: Checkout sbt/zinc
49+
uses: actions/checkout@v2
50+
with:
51+
repository: sbt/zinc
52+
ref: develop
53+
path: zinc
3754
- name: Setup
3855
uses: olafurpg/setup-scala@v10
3956
with:
@@ -61,9 +78,14 @@ jobs:
6178
sbt -v "repoOverrideTest:scripted dependency-management/*; scripted source-dependencies/* project/*"
6279
;;
6380
5)
64-
sbt -v publishLocalBin
81+
# build from fresh IO, LM, and Zinc
82+
BUILD_VERSION="1.4.0-SNAPSHOT"
83+
cd io
84+
sbt -v -Dsbt.build.version=${BUILD_VERSION} +publishLocal
85+
cd ../
86+
sbt -Dsbtlm.path=$HOME/work/sbt/sbt/librarymanagement -Dsbtzinc.path=$HOME/work/sbt/sbt/zinc -Dsbt.build.version=$BUILD_VERSION -Dsbt.build.fatal=false "+lowerUtils/publishLocal; {librarymanagement}/publishLocal; {zinc}/publishLocal; upperModules/publishLocal"
6587
rm -r $(find $HOME/.sbt/boot -name "*-SNAPSHOT") || true
66-
sbt -v -Dsbt.version=$CURRENT_SNAPSHOT_VER "++$SCALA_213; $UTIL_TESTS; ++$SCALA_212; $UTIL_TESTS; scripted actions/* source-dependencies/*1of3 dependency-management/*1of4 java/*"
88+
sbt -v -Dsbt.version=$BUILD_VERSION "++$SCALA_213; $UTIL_TESTS; ++$SCALA_212; $UTIL_TESTS; scripted actions/* source-dependencies/*1of3 dependency-management/*1of4 java/*"
6789
;;
6890
*)
6991
echo unknown jobtype

.github/workflows/nightly.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Nightly
2+
on:
3+
workflow_dispatch:
4+
5+
jobs:
6+
deploy:
7+
strategy:
8+
matrix:
9+
include:
10+
- os: ubuntu-latest
11+
java: 8
12+
runs-on: ${{ matrix.os }}
13+
env:
14+
JAVA_OPTS: -Xms800M -Xmx800M -Xss6M -XX:ReservedCodeCacheSize=128M -server -Dsbt.io.virtual=false -Dfile.encoding=UTF-8
15+
steps:
16+
- name: Checkout sbt/sbt
17+
uses: actions/checkout@v2
18+
- name: Checkout sbt/io
19+
uses: actions/checkout@v2
20+
with:
21+
repository: sbt/io
22+
ref: wip/nightly
23+
path: io
24+
- name: Checkout sbt/librarymanagement
25+
uses: actions/checkout@v2
26+
with:
27+
repository: sbt/librarymanagement
28+
ref: wip/nightly
29+
path: librarymanagement
30+
- name: Checkout sbt/zinc
31+
uses: actions/checkout@v2
32+
with:
33+
repository: sbt/zinc
34+
ref: wip/nightly
35+
path: zinc
36+
- name: Setup
37+
uses: olafurpg/setup-scala@v10
38+
with:
39+
java-version: "adopt@1.${{ matrix.java }}"
40+
- name: Coursier cache
41+
uses: coursier/cache-action@v5
42+
- name: Build and deploy
43+
run: |
44+
# build from fresh IO, LM, and Zinc
45+
TIMESTAMP=$(TZ=UTC date +%Y%m%dT%H%M%S)
46+
export BUILD_VERSION="1.4.0-bin-${TIMESTAMP}"
47+
echo publishing to Package Registry $RELEASE_GITHUB_PACKAGE_REGISTRY
48+
cd io
49+
sbt -v -Dsbt.sbtbintray=false +publish
50+
cd ../
51+
sbt -Dsbtlm.path=$HOME/work/sbt/sbt/librarymanagement -Dsbtzinc.path=$HOME/work/sbt/sbt/zinc -Dsbt.sbtbintray=false -Dsbt.build.fatal=false "+lowerUtils/publish; {librarymanagement}/publish; {zinc}/publish; upperModules/publish"
52+
rm -rf "$HOME/.ivy2/local" || true
53+
rm -r $(find $HOME/.sbt/boot -name "*-SNAPSHOT") || true
54+
find $HOME/Library/Caches/Coursier/v1 -name "ivydata-*.properties" -delete || true
55+
find $HOME/.ivy2/cache -name "ivydata-*.properties" -delete || true
56+
find $HOME/.cache/coursier/v1 -name "ivydata-*.properties" -delete || true
57+
find $HOME/.sbt -name "*.lock" -delete || true
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
RELEASE_GITHUB_PACKAGE_REGISTRY: sbt/sbt

build.sbt

+11-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import java.nio.file.{ Files, Path => JPath }
88
import scala.util.Try
99

1010
ThisBuild / version := {
11-
// update .travis.yml too for dog fooding
1211
val v = "1.4.3-SNAPSHOT"
1312
nightlyVersion.getOrElse(v)
1413
}
@@ -1544,9 +1543,17 @@ def customCommands: Seq[Setting[_]] = Seq(
15441543

15451544
ThisBuild / publishTo := {
15461545
val old = (ThisBuild / publishTo).value
1547-
sys.props.get("sbt.build.localmaven") match {
1548-
case Some(path) => Some(MavenCache("local-maven", file(path)))
1549-
case _ => old
1546+
sys.env.get("RELEASE_GITHUB_PACKAGE_REGISTRY") match {
1547+
case Some(repo) =>
1548+
Some(s"GitHub Package Registry ($repo)" at s"https://maven.pkg.github.com/$repo")
1549+
case _ => old
1550+
}
1551+
}
1552+
ThisBuild / credentials ++= {
1553+
sys.env.get("GITHUB_TOKEN") match {
1554+
case Some(token) =>
1555+
List(Credentials("GitHub Package Registry", "maven.pkg.github.com", "unused", token))
1556+
case _ => Nil
15501557
}
15511558
}
15521559
ThisBuild / whitesourceProduct := "Lightbend Reactive Platform"

project/Dependencies.scala

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ object Dependencies {
88
val scala213 = "2.13.3"
99
val checkPluginCross = settingKey[Unit]("Make sure scalaVersion match up")
1010
val baseScalaVersion = scala212
11-
def nightlyVersion = sys.props.get("sbt.build.version")
11+
def nightlyVersion: Option[String] =
12+
sys.env.get("BUILD_VERSION") orElse sys.props.get("sbt.build.version")
1213

1314
// sbt modules
1415
private val ioVersion = nightlyVersion.getOrElse("1.4.0")

sbt-allsources.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/usr/bin/env bash
22

3-
sbt -Dsbtio.path=../io -Dsbtutil.path=../util -Dsbtlm.path=../librarymanagement -Dsbtzinc.path=../zinc "$@"
3+
sbt -Dsbtio.path=../io -Dsbtlm.path=../librarymanagement -Dsbtzinc.path=../zinc "$@"

0 commit comments

Comments
 (0)