-
Notifications
You must be signed in to change notification settings - Fork 183
39 lines (31 loc) · 1.19 KB
/
gradle.yml
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
name: Publish to Maven
on:
push:
branches:
- master
- maven
env:
SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }}
SIGNING_KEYID: ${{ secrets.SIGNING_KEYID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_KEY_RING_CONTENT: ${{ secrets.SIGNING_SECRET_KEY_RING_CONTENT }}
SIGNING_SECRET_PASSPHRASE: ${{ secrets.SIGNING_SECRET_PASSPHRASE }}
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- name: Prepare environment # https://habr.com/ru/articles/490604/
run: |
echo "$SIGNING_SECRET_KEY_RING_CONTENT" | base64 -d > publish_key.gpg
gpg --batch --yes --decrypt --passphrase="$SIGNING_SECRET_PASSPHRASE" --output secret.gpg publish_key.gpg
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Publish with Gradle
run: ./gradlew publish -Psigning.secretKeyRingFile=../secret.gpg -Psigning.keyId=$SIGNING_KEYID -Psigning.password=$SIGNING_PASSWORD -Ptoken="$SONATYPE_TOKEN"