Skip to content

Commit 16faa4a

Browse files
committed
Update publish.yml to set up GPG key from base64-encoded secret and remove in-memory key configuration
1 parent 2149fa7 commit 16faa4a

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ jobs:
5757
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
5858
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
5959
# GPG signing configuration
60-
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_KEY_CONTENTS }}
6160
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_KEY_ID }}
6261
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_PASSWORD }}
6362

@@ -71,6 +70,15 @@ jobs:
7170
- name: Validate Gradle Wrapper
7271
uses: gradle/actions/wrapper-validation@v3
7372

73+
# This assumes the GPG key is stored as a base64-encoded string in the secret
74+
- name: Set up GPG key
75+
env:
76+
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }}
77+
run: |
78+
echo "$GPG_KEY_CONTENTS" | base64 -d > /tmp/gpg_key.asc
79+
echo "ORG_GRADLE_PROJECT_signingInMemoryKey=$(cat /tmp/gpg_key.asc)" >> $GITHUB_ENV
80+
rm /tmp/gpg_key.asc
81+
7482
- name: Cache Gradle and Konan
7583
uses: actions/cache@v4
7684
with:

0 commit comments

Comments
 (0)