Skip to content

Commit d58caee

Browse files
Cleanup of workflow files (#130)
1 parent 9073df3 commit d58caee

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

.github/workflows/cd.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
steps:
1414
- name: Check out repo
1515
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
with:
17+
persist-credentials: false
1618

1719
- name: Set up Java for publishing to Maven Central Repository
1820
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
@@ -34,7 +36,7 @@ jobs:
3436
POM_VERSION=$(xmllint --xpath "//*[local-name()='project']/*[local-name()='version']/text()" pom.xml)
3537
3638
# Get the release tag from the GitHub context
37-
RELEASE_TAG=${{ github.ref }}
39+
RELEASE_TAG=${GITHUB_REF}
3840

3941
# Remove "refs/tags/" from the release tag
4042
RELEASE_TAG=${RELEASE_TAG/refs\/tags\//}
@@ -68,10 +70,12 @@ jobs:
6870

6971
- id: install-secret-key
7072
name: Import GPG Secret Key
73+
env:
74+
GPG_KEY: ${{ steps.get-kv-secrets.outputs.GPG-KEY }}
7175
run: |
7276
# Install gpg secret key
73-
cat <(echo -e "${{ steps.get-kv-secrets.outputs.GPG-KEY }}") | gpg --batch --import
74-
77+
cat <(echo -e "${GPG_KEY}") | gpg --batch --import
78+
7579
# Verify gpg secret key
7680
gpg --list-secret-keys --keyid-format LONG
7781
@@ -80,8 +84,9 @@ jobs:
8084
mvn \
8185
--batch-mode \
8286
-Dmaven.test.skip \
83-
-Dgpg.passphrase=${{ steps.get-kv-secrets.outputs.GPG-PASSPHRASE }} \
87+
-Dgpg.passphrase="${GPG_PASSPHRASE}" \
8488
clean deploy
8589
env:
8690
MAVEN_USERNAME: ${{ steps.get-kv-secrets.outputs.OSSRH-USERNAME }}
8791
MAVEN_PASSWORD: ${{ steps.get-kv-secrets.outputs.OSSRH-TOKEN }}
92+
GPG_PASSPHRASE: ${{ steps.get-kv-secrets.outputs.GPG-PASSPHRASE }}

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,14 @@ jobs:
1919
steps:
2020
- name: Check out repo
2121
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
22+
with:
23+
persist-credentials: false
24+
2225
- name: Set up JDK 1.8
2326
uses: actions/setup-java@7a6d8a8234af8eb26422e24e3006232cccaa061b # v4.6.0
2427
with:
2528
java-version: '8'
2629
distribution: 'temurin'
30+
2731
- name: Build and Test
2832
run: mvn --batch-mode package

0 commit comments

Comments
 (0)