Skip to content

Commit

Permalink
Ensure snapshots are published as such
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed May 16, 2023
1 parent 988c27d commit db8ebb7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ implicit def millModuleBasePath: define.BasePath =

trait AmmSparkPublishModule extends PublishModule {
import mill.scalalib.publish._
def publishVersion = VcsVersion.vcsState().format()
def publishVersion = T {
val v = VcsVersion.vcsState().format()
val dirtyIdx = v.indexOf("-DIRTY")
if (dirtyIdx >= 0) v.take(dirtyIdx) + "-SNAPSHOT"
else if (v.length > 6 && v.substring(v.length - 6).forall(c => c.isDigit || (c >= 'a' && c <= 'f'))) v + "-SNAPSHOT"
else v
}
def pomSettings = PomSettings(
description = artifactName(),
organization = "sh.almond",
Expand Down

0 comments on commit db8ebb7

Please sign in to comment.