Skip to content

Commit 280e414

Browse files
committed
try to fix publishing
1 parent b00bae1 commit 280e414

File tree

2 files changed

+17
-52
lines changed

2 files changed

+17
-52
lines changed

.github/workflows/publish-artifacts.yml

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,13 @@ on:
88

99
jobs:
1010
publish-maven:
11-
strategy:
12-
matrix:
13-
shard: [ 1, 2, 3, 4, 5, 6]
14-
fail-fast: false
11+
1512
runs-on: ubuntu-latest
1613
env:
17-
SONATYPE_DEPLOY_USER: ${{ secrets.SONATYPE_USER }}
18-
SONATYPE_DEPLOY_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
19-
SONATYPE_PGP_SECRET: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY }}
20-
SONATYPE_PGP_PASSWORD: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD }}
14+
SONATYPE_PGP_PRIVATE_KEY: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY }}
15+
SONATYPE_PGP_PRIVATE_KEY_PASSWORD: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD }}
16+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
17+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
2118
LANG: "en_US.UTF-8"
2219
LC_MESSAGES: "en_US.UTF-8"
2320
LC_ALL: "en_US.UTF-8"
@@ -29,8 +26,18 @@ jobs:
2926
with:
3027
java-version: '8'
3128
distribution: temurin
32-
- run: test -z "$SONATYPE_PGP_SECRET" || echo "$SONATYPE_PGP_SECRET" | base64 --decode | gpg --import --no-tty --batch --yes
33-
- run: GPG_TTY=$(tty) ./mill -i publishSonatype __.publishArtifacts --shard ${{ matrix.shard }} --divisionCount 6
29+
- run: |
30+
echo $SONATYPE_PGP_PRIVATE_KEY | base64 --decode > gpg_key
31+
gpg --import --no-tty --batch --yes gpg_key
32+
rm gpg_key
33+
./mill -i mill.scalalib.PublishModule/publishAll \
34+
--sonatypeCreds $SONATYPE_USER:$SONATYPE_PASSWORD \
35+
--gpgArgs --passphrase=$SONATYPE_PGP_PRIVATE_KEY_PASSWORD,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \
36+
--publishArtifacts __.publishArtifacts \
37+
--readTimeout 600000 \
38+
--awaitTimeout 600000 \
39+
--release true \
40+
--signed true
3441
3542
publish-docs:
3643
runs-on: ubuntu-latest

build.sc

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1007,48 +1007,6 @@ def partition(
10071007

10081008
}
10091009

1010-
def publishSonatype(
1011-
publishArtifacts: mill.main.Tasks[PublishModule.PublishData],
1012-
shard: Int,
1013-
divisionCount: Int
1014-
) =
1015-
T.command {
1016-
1017-
val x: Seq[(Seq[(os.Path, String)], Artifact)] = {
1018-
mill.define.Target.sequence(partition(publishArtifacts, shard, divisionCount))().map {
1019-
case PublishModule.PublishData(a, s) => (s.map { case (p, f) => (p.path, f) }, a)
1020-
}
1021-
}
1022-
if (isPublishableCommit)
1023-
new SonatypePublisher(
1024-
uri = "https://oss.sonatype.org/service/local",
1025-
snapshotUri = "https://oss.sonatype.org/content/repositories/snapshots",
1026-
credentials = sys.env("SONATYPE_DEPLOY_USER") + ":" + sys.env("SONATYPE_DEPLOY_PASSWORD"),
1027-
signed = true,
1028-
gpgArgs = Seq(
1029-
"--passphrase",
1030-
sys.env("SONATYPE_PGP_PASSWORD"),
1031-
"--no-tty",
1032-
"--pinentry-mode",
1033-
"loopback",
1034-
"--batch",
1035-
"--yes",
1036-
"-a",
1037-
"-b"
1038-
),
1039-
readTimeout = 600000,
1040-
connectTimeout = 600000,
1041-
log = T.ctx().log,
1042-
workspace = T.workspace,
1043-
env = T.env,
1044-
awaitTimeout = 600000,
1045-
stagingRelease = true
1046-
).publishAll(
1047-
true,
1048-
x: _*
1049-
)
1050-
}
1051-
10521010
/**
10531011
* Somethime, the Mill publish command fails although the Sonatype publishing went through.
10541012
* This command checks, whether all artifacts are publshed.

0 commit comments

Comments
 (0)