Skip to content
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

fix: fix publish to maven path and pypi env typo #1242

Merged
merged 5 commits into from
Nov 4, 2021
Merged
Show file tree
Hide file tree
Changes from 2 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
17 changes: 12 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ val settings = Seq(
assemblyOption in assembly := (assemblyOption in assembly).value.copy(includeScala = false),
autoAPIMappings := true,
pomPostProcess := pomPostFunc,
sbtPlugin := false
)
ThisBuild / publishMavenStyle := true

Expand Down Expand Up @@ -361,10 +362,16 @@ testWebsiteDocs := {
)
}

sonatypeProjectHosting := Some(
ThisBuild / sonatypeProjectHosting := Some(
GitHubHosting("Azure", "SynapseML", "mmlspark-support@microsot.com"))
homepage := Some(url("https://github.com/Microsoft/SynapseML"))
developers := List(
ThisBuild / homepage := Some(url("https://github.com/Microsoft/SynapseML"))
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/Azure/SynapseML"),
"scm:git@github.com:Azure/SynapseML.git"
)
)
ThisBuild / developers := List(
Developer("mhamilton723", "Mark Hamilton",
"mmlspark-support@microsoft.com", url("https://github.com/mhamilton723")),
Developer("imatiach-msft", "Ilya Matiach",
Expand All @@ -373,9 +380,9 @@ developers := List(
"mmlspark-support@microsoft.com", url("https://github.com/drdarshan"))
)

licenses += ("MIT", url("https://github.com/Microsoft/SynapseML/blob/master/LICENSE"))
ThisBuild / licenses += ("MIT", url("https://github.com/Microsoft/SynapseML/blob/master/LICENSE"))

credentials += Credentials("Sonatype Nexus Repository Manager",
ThisBuild / credentials += Credentials("Sonatype Nexus Repository Manager",
"oss.sonatype.org",
Secrets.nexusUsername,
Secrets.nexusPassword)
Expand Down
10 changes: 5 additions & 5 deletions pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
sbt release
displayName: Publish Artifacts
env:
STORAGE_KEY: $(storage-key)
STORAGE-KEY: $(storage-key)
NEXUS-UN: $(nexus-un)
NEXUS-PW: $(nexus-pw)
PGP-PRIVATE: $(pgp-private)
Expand All @@ -75,7 +75,7 @@ jobs:
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'))
displayName: Publish Badges
env:
STORAGE_KEY: $(storage-key)
STORAGE-KEY: $(storage-key)
NEXUS-UN: $(nexus-un)
NEXUS-PW: $(nexus-pw)
PGP-PRIVATE: $(pgp-private)
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
sbt publishBlob
displayName: Publish Blob Artifacts
env:
STORAGE_KEY: $(storage-key)
STORAGE-KEY: $(storage-key)
NEXUS-UN: $(nexus-un)
NEXUS-PW: $(nexus-pw)
PGP-PRIVATE: $(pgp-private)
Expand Down Expand Up @@ -145,7 +145,7 @@ jobs:
sbt publishBlob
displayName: Publish Blob Artifacts
env:
STORAGE_KEY: $(storage-key)
STORAGE-KEY: $(storage-key)
NEXUS-UN: $(nexus-un)
NEXUS-PW: $(nexus-pw)
PGP-PRIVATE: $(pgp-private)
Expand Down Expand Up @@ -278,7 +278,7 @@ jobs:
sbt publishPypi
condition: startsWith(variables['tag'], 'v')
env:
STORAGE_KEY: $(storage-key)
STORAGE-KEY: $(storage-key)
NEXUS-UN: $(nexus-un)
NEXUS-PW: $(nexus-pw)
PGP-PRIVATE: $(pgp-private)
Expand Down
26 changes: 12 additions & 14 deletions project/BlobMavenPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,25 @@ object BlobMavenPlugin extends AutoPlugin {
override lazy val projectSettings: Seq[Setting[_]] = Seq(
publishBlob := {
publishM2.value
//TODO make this more general - 1.0 is a hack and not sure of a way to get this with sbt keys
val sourceArtifactName = s"${moduleName.value}_${scalaBinaryVersion.value}_1.0"
val destArtifactName = s"${moduleName.value}"
val artifactName = s"${moduleName.value}_${scalaBinaryVersion.value}"
val repositoryDir = new File(new URI(Resolver.mavenLocal.root))
val orgDirs = organization.value.split(".".toCharArray.head)
val localPackageFolder = join(repositoryDir, orgDirs ++ Seq(sourceArtifactName, version.value):_*).toString
val blobMavenFolder = (orgDirs ++ Seq(destArtifactName, version.value)).mkString("/")
val localPackageFolder = join(repositoryDir, orgDirs ++ Seq(artifactName, version.value): _*).toString
val blobMavenFolder = (orgDirs ++ Seq(artifactName, version.value)).mkString("/")
uploadToBlob(localPackageFolder, blobMavenFolder, "maven")
println(blobArtifactInfo.value)
},
blobArtifactInfo := {
s"""
|SynapseML Build and Release Information
|---------------
|
|### Maven Coordinates
| `${organization.value}:${moduleName.value}:${version.value}`
|
|### Maven Resolver
| `https://mmlspark.azureedge.net/maven`
|""".stripMargin
|SynapseML Build and Release Information
|---------------
|
|### Maven Coordinates
| `${organization.value}:${moduleName.value}_${scalaBinaryVersion.value}:${version.value}`
|
|### Maven Resolver
| `https://mmlspark.azureedge.net/maven`
|""".stripMargin
}
)
}
4 changes: 2 additions & 2 deletions project/Secrets.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ object Secrets {
lazy val pgpPrivate: String = new String(Base64.getDecoder.decode(
sys.env.getOrElse("PGP-PRIVATE", getSecret("pgp-private")).getBytes("UTF-8")))
lazy val pgpPassword: String = sys.env.getOrElse("PGP-PW", getSecret("pgp-pw"))
lazy val storageKey: String = sys.env.getOrElse("STORAGE_KEY", getSecret("storage-key"))
lazy val pypiApiToken: String = sys.env.getOrElse("PYPI_API_TOKEN", getSecret("pypi-api-token"))
lazy val storageKey: String = sys.env.getOrElse("STORAGE-KEY", getSecret("storage-key"))
lazy val pypiApiToken: String = sys.env.getOrElse("PYPI-API-TOKEN", getSecret("pypi-api-token"))

}