Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow publishing bridge for a single version #2822

Merged
merged 2 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/publish-bridges.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ name: Publish Bridges
# publishing workflow that runs every Mill version
on:
workflow_dispatch:
inputs:
bridge_versions:
description: 'comma-separated list of Scala versions to publish or `all` for all supported versions'
required: true
type: string

jobs:
publish-bridges:
runs-on: ubuntu-latest
Expand All @@ -19,7 +25,7 @@ jobs:
LANG: "en_US.UTF-8"
LC_MESSAGES: "en_US.UTF-8"
LC_ALL: "en_US.UTF-8"
MILL_BUILD_COMPILER_BRIDGES: "true"
MILL_COMPILER_BRIDGE_VERSIONS: ${{ inputs.bridge_versions }}

steps:
- uses: actions/checkout@v4
Expand Down
21 changes: 12 additions & 9 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,6 @@ def millBinPlatform: T[String] = T {

def baseDir = build.millSourcePath

// We limit the number of compiler bridges to compile and publish for local
// development and testing, because otherwise it takes forever to compile all
// of them. Compiler bridges not in this set will get downloaded and compiled
// on the fly anyway. For publishing, we publish everything.
val buildAllCompilerBridges = interp.watchValue(sys.env.contains("MILL_BUILD_COMPILER_BRIDGES"))
val bridgeVersion = "0.0.1"

val bridgeScalaVersions = Seq(
// Our version of Zinc doesn't work with Scala 2.12.0 and 2.12.4 compiler
// bridges. We skip 2.12.1 because it's so old not to matter, and we need a
Expand Down Expand Up @@ -223,7 +216,17 @@ val bridgeScalaVersions = Seq(
"2.13.11"
)

val buildBridgeScalaVersions = if (!buildAllCompilerBridges) Seq() else bridgeScalaVersions
// We limit the number of compiler bridges to compile and publish for local
// development and testing, because otherwise it takes forever to compile all
// of them. Compiler bridges not in this set will get downloaded and compiled
// on the fly anyway. For publishing, we publish everything or a specific version
// if given.
val compilerBridgeScalaVersions = interp.watchValue(sys.env.get("MILL_COMPILER_BRIDGE_VERSIONS")) match {
case None => Seq.empty[String]
case Some("all") => bridgeScalaVersions
case Some(versions) => versions.split(',').map(_.trim).toSeq
}
val bridgeVersion = "0.0.1"

trait MillJavaModule extends JavaModule {

Expand Down Expand Up @@ -395,7 +398,7 @@ trait MillStableScalaModule extends MillPublishScalaModule with Mima {
def skipPreviousVersions: T[Seq[String]] = T(Seq.empty[String])
}

object bridge extends Cross[BridgeModule](buildBridgeScalaVersions)
object bridge extends Cross[BridgeModule](compilerBridgeScalaVersions)
trait BridgeModule extends MillPublishJavaModule with CrossScalaModule {
def scalaVersion = crossScalaVersion
def publishVersion = bridgeVersion
Expand Down