Skip to content

Commit cf6998b

Browse files
committed
Fix deploy job GPG setup to match other extensions
1 parent 31ccd6a commit cf6998b

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

.github/workflows/main.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -556,14 +556,23 @@ jobs:
556556
with:
557557
java-version: '21'
558558
distribution: 'temurin'
559-
server-id: ossrh
560-
server-username: MAVEN_USERNAME
561-
server-password: MAVEN_PASSWORD
562-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
563-
gpg-passphrase: GPG_PASSPHRASE
559+
560+
- name: Cache Maven packages
561+
uses: actions/cache@v4
562+
with:
563+
path: ~/.m2
564+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
565+
restore-keys: |
566+
${{ runner.os }}-maven-
567+
568+
- name: Import GPG key
569+
run: |
570+
echo "$GPG_PRIVATE_KEY" | base64 --decode | gpg --batch --import
571+
env:
572+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
564573

565574
- name: Deploy extension to Maven Central
566-
run: mvn -B -e clean install -Dgoal=deploy
575+
run: mvn -B -e clean install -Dgoal=deploy --settings maven-settings.xml
567576
env:
568577
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
569578
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

maven-settings.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
2+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
4+
<servers>
5+
<server>
6+
<id>ossrh</id>
7+
<username>${env.MAVEN_USERNAME}</username>
8+
<password>${env.MAVEN_PASSWORD}</password>
9+
</server>
10+
</servers>
11+
<profiles>
12+
<profile>
13+
<id>gpg</id>
14+
<properties>
15+
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
16+
</properties>
17+
</profile>
18+
</profiles>
19+
<activeProfiles>
20+
<activeProfile>gpg</activeProfile>
21+
</activeProfiles>
22+
</settings>

0 commit comments

Comments
 (0)