Skip to content

Commit dcba37f

Browse files
fix: 改用手动导入 GPG 密钥避免 settings-security 错误
Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 43771ca commit dcba37f

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/publish-central.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,20 @@ jobs:
4040
server-id: central
4141
server-username: MAVEN_USERNAME
4242
server-password: MAVEN_PASSWORD
43-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
43+
44+
- name: Import GPG key
45+
run: |
46+
install -m 700 -d ~/.gnupg
47+
printf '%s\n' "$GPG_PRIVATE_KEY" | gpg --batch --import --yes --no-tty
48+
gpg --list-secret-keys --keyid-format long
49+
env:
50+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
4451

4552
- name: Set project version
4653
run: mvn --batch-mode versions:set -DnewVersion="$VERSION" -DgenerateBackupPoms=false
4754

4855
- name: Publish to Maven Central
49-
run: mvn --batch-mode clean deploy -Prelease -DskipTests
56+
run: mvn --batch-mode clean deploy -Prelease -DskipTests -Dgpg.passphrase=
5057
env:
5158
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
5259
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

0 commit comments

Comments
 (0)