Skip to content

Commit

Permalink
Stop publishing fat jars (close #862)
Browse files Browse the repository at this point in the history
  • Loading branch information
spenes committed Feb 12, 2024
1 parent 563bad7 commit 4b26619
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 67 deletions.
34 changes: 0 additions & 34 deletions .github/workflows/release.yml
Expand Up @@ -8,40 +8,6 @@ on:
- 'snapshot/**'

jobs:
github_release:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v6
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Get current version
id: ver
run: echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
- name: Assemble fat jars
run: |
sbt "project pubsub; set assembly / test := {}; assembly" \
"project kinesis; set assembly / test := {}; assembly" \
"project kafka; set assembly / test := {}; assembly" \
"project nsq; set assembly / test := {}; assembly"
- name: Create GitHub release and attach artifacts
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: ${{ contains(steps.ver.outputs.tag, 'rc') }}
name: ${{ steps.ver.outputs.tag }}
tag_name: ${{ steps.ver.outputs.tag }}
files: |
modules/pubsub/target/scala-2.12/snowplow-enrich-pubsub-${{ steps.ver.outputs.tag }}.jar
modules/kinesis/target/scala-2.12/snowplow-enrich-kinesis-${{ steps.ver.outputs.tag }}.jar
modules/kafka/target/scala-2.12/snowplow-enrich-kafka-${{ steps.ver.outputs.tag }}.jar
modules/nsq/target/scala-2.12/snowplow-enrich-nsq-${{ steps.ver.outputs.tag }}.jar
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish_docker:
if: startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/snapshot')
runs-on: ubuntu-latest
Expand Down
36 changes: 4 additions & 32 deletions project/BuildSettings.scala
Expand Up @@ -12,7 +12,6 @@
import sbt._
import sbt.Keys._
import sbt.nio.Keys.{ReloadOnSourceChanges, onChangedBuildSource}
import sbtassembly.AssemblyPlugin.autoImport._
import sbtbuildinfo.BuildInfoPlugin.autoImport.{BuildInfoKey, buildInfoKeys, buildInfoPackage}
import sbtdynver.DynVerPlugin.autoImport._
import com.typesafe.sbt.SbtNativePackager.autoImport._
Expand Down Expand Up @@ -147,33 +146,6 @@ object BuildSettings {
)
)

lazy val assemblySettings = Seq(
assembly / assemblyJarName := { s"${moduleName.value}-${version.value}.jar" },
assembly / assemblyMergeStrategy := {
case x if x.endsWith(".properties") => MergeStrategy.first
case x if x.endsWith("public-suffix-list.txt") => MergeStrategy.first
case x if x.endsWith("ProjectSettings$.class") => MergeStrategy.first
case x if x.endsWith("module-info.class") => MergeStrategy.first
case x if x.endsWith("nowarn.class") => MergeStrategy.first
case x if x.endsWith("nowarn$.class") => MergeStrategy.first
case x if x.endsWith("log4j.properties") => MergeStrategy.first
case x if x.endsWith(".proto") => MergeStrategy.first
case x if x.endsWith("reflection-config.json") => MergeStrategy.first
case x if x.endsWith("config.fmpp") => MergeStrategy.first
case x if x.contains("simulacrum") => MergeStrategy.first
case x if x.endsWith("git.properties") => MergeStrategy.discard
case x if x.endsWith(".json") => MergeStrategy.first
case x if x.endsWith("AUTHORS") => MergeStrategy.first
case x if x.endsWith(".config") => MergeStrategy.first
case x if x.endsWith(".types") => MergeStrategy.first
case x if x.contains("netty") => MergeStrategy.first
case x if x.contains("FastDoubleParser-NOTICE") => MergeStrategy.first
case x =>
val oldStrategy = (assembly / assemblyMergeStrategy).value
oldStrategy(x)
}
)

lazy val dockerSettingsFocal = Seq(
Universal / javaOptions ++= Seq("-Dnashorn.args=--language=es6")
)
Expand Down Expand Up @@ -250,7 +222,7 @@ object BuildSettings {
// Project
pubsubProjectSettings ++ buildSettings ++
// Build and publish
assemblySettings ++ dockerSettingsFocal ++
dockerSettingsFocal ++
Seq(Docker / packageName := "snowplow-enrich-pubsub") ++
// Tests
scoverageSettings ++ noParallelTestExecution ++ addExampleConfToTestCp
Expand All @@ -262,7 +234,7 @@ object BuildSettings {
// Project
kinesisProjectSettings ++ buildSettings ++
// Build and publish
assemblySettings ++ dockerSettingsFocal ++
dockerSettingsFocal ++
Seq(Docker / packageName := "snowplow-enrich-kinesis") ++
// Tests
scoverageSettings ++ noParallelTestExecution ++ Seq(Test / fork := true) ++ addExampleConfToTestCp
Expand All @@ -274,7 +246,7 @@ object BuildSettings {
// Project
kafkaProjectSettings ++ buildSettings ++
// Build and publish
assemblySettings ++ dockerSettingsFocal ++
dockerSettingsFocal ++
Seq(Docker / packageName := "snowplow-enrich-kafka") ++
// Tests
scoverageSettings ++ noParallelTestExecution ++ addExampleConfToTestCp
Expand All @@ -286,7 +258,7 @@ object BuildSettings {
// Project
nsqProjectSettings ++ buildSettings ++
// Build and publish
assemblySettings ++ dockerSettingsFocal ++
dockerSettingsFocal ++
Seq(Docker / packageName := "snowplow-enrich-nsq") ++
// Tests
scoverageSettings ++ noParallelTestExecution ++ addExampleConfToTestCp
Expand Down
1 change: 0 additions & 1 deletion project/plugins.sbt
@@ -1,4 +1,3 @@
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.14.9")
addSbtPlugin("com.eed3si9n" % "sbt-buildinfo" % "0.9.0")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2")
addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.17")
Expand Down

0 comments on commit 4b26619

Please sign in to comment.