Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

CI 0.6.0 snapshot #512

Merged
merged 2 commits into from
Sep 11, 2017
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 .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ script:
fi

after_success:
- sbt ^^$SBT_VERSION orgAfterCISuccess
- if [ "$TRAVIS_BRANCH" = "master" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
if grep -q "SNAPSHOT" version.sbt; then
sbt ^^$SBT_VERSION publish;
else
sbt ^^$SBT_VERSION release;
fi
fi
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't like this and I'm open to ideas.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's ok for a temporary solution. For a permanent solution, we could add a new sbt task that checks the version internally and executes publish or release.

- sbt ^^$SBT_VERSION publishLocal
- cd autocheck && sbt ^^$SBT_VERSION -Dplugin.version=$(cat ../version.sbt | sed 's/.*"\(.*\)".*/\1/') checkDependencies

Expand Down
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ lazy val `org-policies-core` = (project in file("core"))
addCommandAlias("publishLocalAll", ";org-policies-core/publishLocal;sbt-org-policies/publishLocal")

pgpPassphrase := Some(Option(System.getenv().get("PGP_PASSPHRASE")).getOrElse("").toCharArray)
// pgpPublicRing := file(s"$gpgFolder/pubring.gpg")
// pgpSecretRing := file(s"$gpgFolder/secring.gpg")
pgpPublicRing := file(s"$gpgFolder/pubring.gpg")
pgpSecretRing := file(s"$gpgFolder/secring.gpg")
2 changes: 1 addition & 1 deletion core/src/main/scala/sbtorgpolicies/libraries.scala
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ object libraries {
"sbt-ghpages" -> "0.6.2",
"sbt-git" -> "0.9.3",
"sbt-header" -> "3.0.1",
"sbt-pgp" -> "1.1.0-M1",
"sbt-pgp" -> "1.1.0",
"sbt-jmh" -> "0.2.27",
"sbt-release" -> "1.0.6",
"sbt-scalafmt" -> "0.6.8",
Expand Down
31 changes: 15 additions & 16 deletions project/ProjectPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ import sbt.Keys._
import sbt.Resolver.sonatypeRepo
import sbt.ScriptedPlugin.autoImport._
import sbt.{Def, _}
// import sbtorgpolicies.OrgPoliciesKeys.orgAfterCISuccessTaskListSetting
// import sbtorgpolicies.OrgPoliciesPlugin
// import sbtorgpolicies.OrgPoliciesPlugin.autoImport._
// import sbtorgpolicies.runnable.syntax._
// import sbtorgpolicies.templates.badges._
// import sbtorgpolicies.model.scalac
import sbtorgpolicies.OrgPoliciesKeys.orgAfterCISuccessTaskListSetting
import sbtorgpolicies.OrgPoliciesPlugin
import sbtorgpolicies.OrgPoliciesPlugin.autoImport._
import sbtorgpolicies.runnable.syntax._
import sbtorgpolicies.templates.badges._
import sbtorgpolicies.model.scalac

object ProjectPlugin extends AutoPlugin {

// override def requires: Plugins = OrgPoliciesPlugin
override def requires: Plugins = OrgPoliciesPlugin

override def trigger: PluginTrigger = allRequirements

Expand Down Expand Up @@ -63,7 +63,7 @@ object ProjectPlugin extends AutoPlugin {
addSbtPlugin("com.eed3si9n" % "sbt-unidoc" % "0.4.1"),
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.6"),
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.0"),
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0-M1"),
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0"),
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.2"),
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.3.0"),
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.2.27"),
Expand Down Expand Up @@ -189,14 +189,13 @@ object ProjectPlugin extends AutoPlugin {
private[this] val artifactSettings = Seq(
scalaVersion := scalac.`2.12`,
scalaOrganization := "org.scala-lang",
startYear := Some(2017)
// ,
// orgBadgeListSetting := List(
// TravisBadge.apply,
// MavenCentralBadge.apply,
// LicenseBadge.apply,
// GitHubIssuesBadge.apply
// ),
startYear := Some(2017),
orgBadgeListSetting := List(
TravisBadge.apply,
MavenCentralBadge.apply,
LicenseBadge.apply,
GitHubIssuesBadge.apply
) //,
// orgAfterCISuccessTaskListSetting ~= (_ filterNot(_ == depUpdateDependencyIssues.asRunnableItem))
)
}
3 changes: 1 addition & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
resolvers += Resolver.sonatypeRepo("snapshots")
// addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.6.0-SNAPSHOT")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0-M1")
addSbtPlugin("com.47deg" % "sbt-org-policies" % "0.6.0-SNAPSHOT")

libraryDependencies += {
lazy val sbtVersionValue = (sbtVersion in pluginCrossBuild).value
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/sbtorgpolicies/settings/bash.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ trait bash {

val ref = extracted.get(thisProjectRef)

extracted.runAggregated[Unit](publishSigned in Global in ref, st)
extracted.runAggregated[Unit](publish in Global in ref, st)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, but this would only affect to the orgPublishRelease task

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In sbt 1.0:

All downstream projects that use orgAfterCISuccess depend on orgPublishReleaseTask/orgPublishRelease, as far as I can tell. If orgAfterCISuccess is called on "master" with a SNAPSHOT version, publishSigned will break for the second push/merge because overwrite = false.

https://github.com/sbt/sbt-pgp/blob/master/pgp-plugin/src/main/scala-sbt-1.0/Compat.scala#L72

case (false, true) =>
st.log.info("Release Version detected, starting the release process...")

Expand Down