-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (46 loc) · 1.54 KB
/
Copy pathpublish.yml
File metadata and controls
53 lines (46 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
name: publish
on:
workflow_dispatch:
workflow_call:
inputs:
ref:
description: 'Git ref to checkout'
required: false
type: string
push:
branches:
- main
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
ref: ${{ inputs.ref || github.ref }}
- uses: actions/setup-java@v6
with:
distribution: 'temurin'
java-version: '17'
- name: list gpg keys
shell: bash
run: gpg -K
- name: import GPG private key
shell: bash
run: |
echo "use-agent" >> ~/.gnupg/gpg.conf
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
echo -e "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import --batch
for fpr in $(gpg --list-keys --with-colons | awk -F: '/fpr:/ {print $10}' | sort -u);
do
echo -e "5\\ny\\n" | gpg --batch --command-fd 0 --expert --edit-key $fpr trust;
done
- name: list gpg keys
shell: bash
run: gpg -K
- name: publish
shell: bash
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.CENTRAL_SONATYPE_TOKEN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.CENTRAL_SONATYPE_TOKEN_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }}
run: ./gradlew build publishToMavenCentral --stacktrace -Psigning.gnupg.executable=gpg -Psigning.gnupg.passphrase="${{ secrets.GPG_PASSPHRASE }}"