diff --git a/.github/workflows/publish-artifacts.yml b/.github/workflows/publish-artifacts.yml index 48a48f993..9feb6fdc7 100644 --- a/.github/workflows/publish-artifacts.yml +++ b/.github/workflows/publish-artifacts.yml @@ -8,16 +8,13 @@ on: jobs: publish-maven: - strategy: - matrix: - shard: [ 1, 2, 3, 4, 5, 6] - fail-fast: false + runs-on: ubuntu-latest env: - SONATYPE_DEPLOY_USER: ${{ secrets.SONATYPE_USER }} - SONATYPE_DEPLOY_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} - SONATYPE_PGP_SECRET: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY }} - SONATYPE_PGP_PASSWORD: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD }} + SONATYPE_PGP_PRIVATE_KEY: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY }} + SONATYPE_PGP_PRIVATE_KEY_PASSWORD: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD }} + SONATYPE_USER: ${{ secrets.SONATYPE_USER }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} LANG: "en_US.UTF-8" LC_MESSAGES: "en_US.UTF-8" LC_ALL: "en_US.UTF-8" @@ -29,8 +26,18 @@ jobs: with: java-version: '8' distribution: temurin - - run: test -z "$SONATYPE_PGP_SECRET" || echo "$SONATYPE_PGP_SECRET" | base64 --decode | gpg --import --no-tty --batch --yes - - run: GPG_TTY=$(tty) ./mill -i publishSonatype __.publishArtifacts --shard ${{ matrix.shard }} --divisionCount 6 + - run: | + echo $SONATYPE_PGP_PRIVATE_KEY | base64 --decode > gpg_key + gpg --import --no-tty --batch --yes gpg_key + rm gpg_key + ./mill -i mill.scalalib.PublishModule/publishAll \ + --sonatypeCreds $SONATYPE_USER:$SONATYPE_PASSWORD \ + --gpgArgs --passphrase=$SONATYPE_PGP_PRIVATE_KEY_PASSWORD,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \ + --publishArtifacts __.publishArtifacts \ + --readTimeout 600000 \ + --awaitTimeout 600000 \ + --release true \ + --signed true publish-docs: runs-on: ubuntu-latest diff --git a/build.sc b/build.sc index 1c3ccc042..afccaf34c 100644 --- a/build.sc +++ b/build.sc @@ -1007,48 +1007,6 @@ def partition( } -def publishSonatype( - publishArtifacts: mill.main.Tasks[PublishModule.PublishData], - shard: Int, - divisionCount: Int -) = - T.command { - - val x: Seq[(Seq[(os.Path, String)], Artifact)] = { - mill.define.Target.sequence(partition(publishArtifacts, shard, divisionCount))().map { - case PublishModule.PublishData(a, s) => (s.map { case (p, f) => (p.path, f) }, a) - } - } - if (isPublishableCommit) - new SonatypePublisher( - uri = "https://oss.sonatype.org/service/local", - snapshotUri = "https://oss.sonatype.org/content/repositories/snapshots", - credentials = sys.env("SONATYPE_DEPLOY_USER") + ":" + sys.env("SONATYPE_DEPLOY_PASSWORD"), - signed = true, - gpgArgs = Seq( - "--passphrase", - sys.env("SONATYPE_PGP_PASSWORD"), - "--no-tty", - "--pinentry-mode", - "loopback", - "--batch", - "--yes", - "-a", - "-b" - ), - readTimeout = 600000, - connectTimeout = 600000, - log = T.ctx().log, - workspace = T.workspace, - env = T.env, - awaitTimeout = 600000, - stagingRelease = true - ).publishAll( - true, - x: _* - ) - } - /** * Somethime, the Mill publish command fails although the Sonatype publishing went through. * This command checks, whether all artifacts are publshed.