Skip to content

Commit

Permalink
let's try this (#2)
Browse files Browse the repository at this point in the history
* let's try this

* will need to crosspublish, so add +
  • Loading branch information
hughsimpson authored Dec 10, 2021
1 parent 26e2a51 commit a9830ef
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 50 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,10 @@ jobs:
with:
java-version: '11'
distribution: 'adopt'
# disable for testing
# - name: Test
# run: sbt +test
- name: Get tag
id: tag
uses: dawidd6/action-get-tag@v1
with:
# Optionally strip `v` prefix
strip_v: true
- name: Publish release
- uses: olafurpg/setup-scala@v13
- run: sbt +ci-release
env:
SONATYPE_PASS: ${{ secrets.SONATYPE_PASS }}
run: SONATYPE_USER=com.github.hughsimpson sbt -Dversion="${{steps.tag.outputs.tag}}" +publish
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
38 changes: 2 additions & 36 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,7 @@ import sbt._

object ScalaMeterBuild {

def repoName = "scalameter"

val publishUser = "SONATYPE_USER"
val publishPass = "SONATYPE_PASS"

val userPass = for {
user <- sys.env.get(publishUser)
pass <- sys.env.get(publishPass)
} yield (user, pass)

val publishCreds: Seq[Setting[_]] = Seq(userPass match {
case Some((user, pass)) =>
credentials += Credentials("Sonatype Nexus Repository Manager", "s01.oss.sonatype.org", user, pass)
case None =>
// prevent publishing
publish := streams.value.log.info("Publishing to Sonatype is disabled since the \"" + publishUser + "\" and/or \"" + publishPass + "\" environment variables are not set.")
})

val scalaMeterSettings = publishCreds ++ Seq(
val scalaMeterSettings = Seq(
name := "scalameter",
organization := "io.github.hughsimpson",
scalaVersion := "2.13.6",
Expand All @@ -42,14 +24,6 @@ object ScalaMeterBuild {
"Sonatype OSS Releases" at "https://oss.sonatype.org/content/repositories/releases"
),
ivyLoggingLevel in ThisBuild := UpdateLogging.Quiet,
publishMavenStyle := true,
publishTo := {
val nexus = "https://s01.oss.sonatype.org/"
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
publishArtifact in Test := false,
pomIncludeRepository := { _ => false },
pomExtra :=
Expand Down Expand Up @@ -131,7 +105,7 @@ object ScalaMeterBuild {
}
}

val scalaMeterCoreSettings = publishCreds ++ Seq(
val scalaMeterCoreSettings = Seq(
name := "scalameter-core",
organization := "io.github.hughsimpson",
scalaVersion := "2.13.0",
Expand All @@ -150,14 +124,6 @@ object ScalaMeterBuild {
"Sonatype OSS Releases" at "https://oss.sonatype.org/content/repositories/releases"
),
ivyLoggingLevel in ThisBuild := UpdateLogging.Quiet,
publishMavenStyle := true,
publishTo := {
val nexus = "https://s01.oss.sonatype.org/"
if (version.value.trim.endsWith("SNAPSHOT"))
Some("snapshots" at nexus + "content/repositories/snapshots")
else
Some("releases" at nexus + "service/local/staging/deploy/maven2")
},
publishArtifact in Test := false,
pomIncludeRepository := { _ => false },
pomExtra :=
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.9")
1 change: 0 additions & 1 deletion version.sbt

This file was deleted.

0 comments on commit a9830ef

Please sign in to comment.