Skip to content

publish master commits with date + commit hash #209

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

Closed
wants to merge 3 commits into from
Closed
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: 8 additions & 0 deletions admin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ set -e
verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?"
tagPat="^v$verPat(#$verPat#[0-9]+)?$"

publish=no

if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then
currentJvmVer=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' | sed 's/^1\.//' | sed 's/[^0-9].*//')

Expand All @@ -39,6 +41,12 @@ if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then
echo "Releasing $tagVer on Java version $currentJvmVer according to 'scalaVersionsByJvm' in build.sbt."
fi

publish=yes
elif [[ "$TRAVIS_BRANCH" = master ]] && [[ "$TRAVIS_PULL_REQUEST" = false ]]; then
publish=yes
fi

if [[ "$publish" = yes ]]; then
extraTarget="+publish-signed"
cat admin/gpg.sbt >> project/plugins.sbt
cp admin/publish-settings.sbt .
Expand Down
6 changes: 5 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ scalaVersionsByJvm in ThisBuild := {
name := "scala-async"
repoName := "async"

version := "0.10.0-SNAPSHOT"
// When the git tag includes a scala version and/or jvm version, remove both from the release version
version in ThisBuild ~= (_.replaceFirst("#[^+]+", ""))

// SNAPSHOT versions are not cached by consumers. Since sbt-dynver already sets unique versions, do not produce a snapshot version.
dynverSonatypeSnapshots in ThisBuild := false

libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided"
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value % "test" // for ToolBox
Expand Down
2 changes: 2 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "1.0.14")
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "3.1.0")