Skip to content

Commit 3091693

Browse files
committed
ci: add steps used to publish artefacts to maven central
1 parent 69c6134 commit 3091693

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

.github/workflows/github-packages-publish.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,19 @@ jobs:
2020
packages: write
2121

2222
steps:
23-
- uses: actions/checkout@v4
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Import PGP Private Key
27+
uses: crazy-max/ghaction-import-gpg@v6.1.0
28+
with:
29+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
30+
passphrase: ${{ secrets.GPG_PASSPHRASE }}
31+
32+
- name: Creating PGP Ring Key
33+
run: |
34+
mkdir -p ~/.gnupg
35+
gpg --export-secret-keys -o ~/.gnupg/pgp_key.ring
2436
2537
- name: Restore gradle.properties
2638
env:
@@ -31,14 +43,6 @@ jobs:
3143
echo "::set-env name=GRADLE_USER_HOME::$HOME/.gradle"
3244
echo ${GRADLE_PROPERTIES} > ~/.gradle/gradle.properties
3345
34-
- name: Restore gpg secret ring file
35-
env:
36-
GPG_SECRET_KEY_RING: ${{ secrets.GPG_SECRET_KEY_RING }}
37-
shell: bash
38-
run: |
39-
mkdir -p ~/.gnupg/
40-
echo ${GPG_SECRET_KEY_RING} > ~/.gnupg/42CBCB82.gpg
41-
4246
- name: Set up JDK 17
4347
uses: actions/setup-java@v4
4448
with:
@@ -58,8 +62,11 @@ jobs:
5862

5963
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
6064
# the publishing section of your build.gradle
61-
- name: Publish to GitHub Packages
62-
run: ./gradlew publishAllPublicationsToGithubPackagesRepository
63-
env:
64-
USERNAME: ${{ github.actor }}
65-
TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
# - name: Publish to GitHub Packages
66+
# run: ./gradlew publishAllPublicationsToGithubPackagesRepository
67+
# env:
68+
# USERNAME: ${{ github.actor }}
69+
# TOKEN: ${{ secrets.GITHUB_TOKEN }}
70+
71+
- name: Publish to Maven Central
72+
run: ./gradlew publish

0 commit comments

Comments
 (0)