Skip to content

Commit 2dad74a

Browse files
committed
0.9.1
1 parent ec0488a commit 2dad74a

File tree

1 file changed

+14
-20
lines changed

1 file changed

+14
-20
lines changed

.github/workflows/actions.yml

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,40 +37,33 @@ jobs:
3737
java-version: 11
3838
- name: Check Binary Compatibility
3939
run: ./mill -i __.mimaReportBinaryIssues
40-
4140
publish-sonatype:
41+
# when in master repo, publish all tags and manual runs on main
4242
if: github.repository == 'com-lihaoyi/PPrint' && contains(github.ref, 'refs/tags/')
43-
needs: test
4443
runs-on: ubuntu-latest
44+
45+
# only run one publish job for the same sha at the same time
46+
# e.g. when a main-branch push is also tagged
47+
concurrency: publish-sonatype-${{ github.sha }}
48+
4549
env:
46-
SONATYPE_PGP_PRIVATE_KEY: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY }}
47-
SONATYPE_PGP_PRIVATE_KEY_PASSWORD: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD }}
48-
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
49-
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
50+
MILL_SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
51+
MILL_SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
52+
MILL_PGP_SECRET_BASE64: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY }}
53+
MILL_PGP_PASSPHRASE: ${{ secrets.SONATYPE_PGP_PRIVATE_KEY_PASSWORD }}
5054
LANG: "en_US.UTF-8"
5155
LC_MESSAGES: "en_US.UTF-8"
5256
LC_ALL: "en_US.UTF-8"
57+
5358
steps:
5459
- uses: actions/checkout@v3
5560
- uses: actions/setup-java@v3
5661
with:
5762
distribution: 'temurin'
5863
java-version: 11
5964
- name: Publish to Maven Central
60-
run: |
61-
if [[ $(git tag --points-at HEAD) != '' ]]; then
62-
echo $SONATYPE_PGP_PRIVATE_KEY | base64 --decode > gpg_key
63-
gpg --import --no-tty --batch --yes gpg_key
64-
rm gpg_key
65-
./mill -i mill.scalalib.PublishModule/publishAll \
66-
--sonatypeCreds $SONATYPE_USER:$SONATYPE_PASSWORD \
67-
--gpgArgs --passphrase=$SONATYPE_PGP_PRIVATE_KEY_PASSWORD,--no-tty,--pinentry-mode,loopback,--batch,--yes,-a,-b \
68-
--publishArtifacts __.publishArtifacts \
69-
--readTimeout 600000 \
70-
--awaitTimeout 600000 \
71-
--release true \
72-
--signed true
73-
fi
65+
run: ./mill -i mill.scalalib.SonatypeCentralPublishModule/
66+
7467
- name: Create GitHub Release
7568
id: create_gh_release
7669
uses: actions/[email protected]
@@ -80,3 +73,4 @@ jobs:
8073
tag_name: ${{ github.ref }}
8174
release_name: ${{ github.ref }}
8275
draft: false
76+

0 commit comments

Comments
 (0)