From 8d210df4c017241cd908d24fad728b9f55d7fc44 Mon Sep 17 00:00:00 2001 From: Joan Goyeau Date: Fri, 25 Jul 2025 00:01:06 -0400 Subject: [PATCH] Publish to Sonatype Central --- .github/workflows/ci.yml | 11 +++++------ build.mill | 8 ++++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 131b5f2..208dbc3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,9 +23,8 @@ jobs: ./mill __.checkStyle + __.test + __.publishLocal - name: Publish if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') || github.event_name == 'release' - run: | - echo "${{secrets.pgp_secret_key}}" > private.key - gpg --batch --yes --import private.key - rm private.key - - ./mill mill.scalalib.PublishModule/ --sonatypeCreds ${{secrets.sonatype_credentials}} + run: ./mill mill.scalalib.SonatypeCentralPublishModule/ + env: + MILL_PGP_SECRET_BASE64: ${{ secrets.PGP_SECRET_KEY }} + MILL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + MILL_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} diff --git a/build.mill b/build.mill index 14c1096..d31377c 100644 --- a/build.mill +++ b/build.mill @@ -15,8 +15,12 @@ import org.typelevel.scalacoptions.ScalacOptions.* import org.typelevel.scalacoptions.{ScalaVersion, ScalacOptions} object `mill-git` extends Cross[MillGitCross]("1.0.0") -trait MillGitCross extends Cross.Module[String] with StyleModule with GitVersionedPublishModule: - val millVersion = crossValue +trait MillGitCross + extends Cross.Module[String] + with StyleModule + with GitVersionedPublishModule + with SonatypeCentralPublishModule: + val millVersion = crossValue override def scalaVersion = "3.7.1" override def scalacOptions = super.scalacOptions() ++ ScalacOptions.tokensForVersion( ScalaVersion.unsafeFromString(scalaVersion()),