Skip to content

Commit 781278b

Browse files
authored
Fix the publishing (sksamuel#894)
1 parent 8c55703 commit 781278b

5 files changed

Lines changed: 27 additions & 35 deletions

File tree

.github/workflows/master.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
echo "email: ${{ steps.import_gpg.outputs.email }}"
4444
4545
- name: publish snapshot
46-
run: sbt publish
46+
run: sbt publishSigned
4747
env:
4848
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
49-
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
49+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}

.github/workflows/pr_scala_3.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,13 @@ jobs:
2626

2727
- name: run tests
2828
run: sbt test
29+
30+
- name: Import GPG key
31+
id: import_gpg
32+
uses: crazy-max/ghaction-import-gpg@v3
33+
with:
34+
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
35+
passphrase: ${{ secrets.PGP_PASSPHRASE }}
36+
37+
- name: publish local
38+
run: sbt publishLocalSigned

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
echo "email: ${{ steps.import_gpg.outputs.email }}"
4343
4444
- name: publish release
45-
run: sbt publishSigned
45+
run: sbt sonaUpload sonaRelease
4646
env:
4747
RELEASE_VERSION: ${{ github.event.inputs.version }}
4848
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}

project/Build.scala

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import sbt.*
55
object Build extends AutoPlugin {
66

77
object autoImport {
8-
val org = "com.sksamuel.avro4s"
98
val AvroVersion = "1.11.5"
109
val Log4jVersion = "1.2.17"
1110
val ScalatestVersion = "3.2.17"
@@ -31,7 +30,6 @@ object Build extends AutoPlugin {
3130

3231
override def trigger = allRequirements
3332
override def projectSettings = publishingSettings ++ Seq(
34-
organization := org,
3533
scalaVersion := "3.3.7",
3634
resolvers += Resolver.mavenLocal,
3735
Test / parallelExecution := false,
@@ -47,42 +45,26 @@ object Build extends AutoPlugin {
4745
)
4846

4947
val publishingSettings = Seq(
48+
pomIncludeRepository := { _ => false },
5049
publishMavenStyle := true,
5150
Test / publishArtifact := false,
51+
publishTo := {
52+
val centralSnapshots = "https://central.sonatype.com/repository/maven-snapshots/"
53+
if (isSnapshot.value) Some("central-snapshots" at centralSnapshots)
54+
else localStaging.value
55+
},
5256
credentials += Credentials(
53-
"Sonatype Nexus Repository Manager",
54-
"s01.oss.sonatype.org",
57+
null,
58+
"central.sonatype.com",
5559
ossrhUsername,
5660
ossrhPassword
5761
),
5862
version := publishVersion,
59-
publishTo := {
60-
if (isRelease)
61-
Some("releases" at "https://ossrh-staging-api.central.sonatype.com/service/local/staging/deploy/maven2/")
62-
else
63-
Some("snapshots" at "https://central.sonatype.com/repository/maven-snapshots/")
64-
},
65-
pomExtra := {
66-
<url>https://github.com/sksamuel/avro4s</url>
67-
<licenses>
68-
<license>
69-
<name>The Apache 2.0 License</name>
70-
<url>https://opensource.org/licenses/Apache-2.0</url>
71-
<distribution>repo</distribution>
72-
</license>
73-
</licenses>
74-
<scm>
75-
<url>git@github.com:sksamuel/avro4s.git</url>
76-
<connection>scm:git@github.com:sksamuel/avro4s.git</connection>
77-
</scm>
78-
<developers>
79-
<developer>
80-
<id>sksamuel</id>
81-
<name>sksamuel</name>
82-
<url>http://github.com/sksamuel</url>
83-
</developer>
84-
</developers>
85-
}
63+
organization := "com.sksamuel.avro4s",
64+
homepage := Some(url("https://github.com/sksamuel/avro4s")),
65+
scmInfo := Some(ScmInfo(url("https://github.com/sksamuel/avro4s"), "scm:git@github.com:sksamuel/avro4s.git")),
66+
licenses := List("The Apache 2.0 License" -> url("https://opensource.org/licenses/Apache-2.0")),
67+
developers := List(Developer("sksamuel", "sksamuel", "", url("http://github.com/sksamuel")))
8668
)
8769
}
8870

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.10.6
1+
sbt.version=1.12.0

0 commit comments

Comments
 (0)