-
Notifications
You must be signed in to change notification settings - Fork 7
38 lines (36 loc) · 1.39 KB
/
publishing2sonatype.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
name: Publishing to Sonatype
on:
release:
types: [published]
env:
GH_TOKEN: ${{ github.token }}
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8.0.362'
distribution: 'zulu'
- name: Prepare gradle.properties
run: |
echo "$(pwd)"
echo -e "${{ secrets.SECRING }}" | base64 -d > ./secring.gpg
echo "$(ls -la)"
touch ./gradle.properties
echo "signing.keyId=${{ secrets.KEYID }}" >> ./gradle.properties
echo "signing.password=${{ secrets.PASS }}" >> ./gradle.properties
echo "signing.secretKeyRingFile=$(pwd)/secring.gpg" >> ./gradle.properties
echo "sonatypeUsername=${{ secrets.SUSER }}" >> ./gradle.properties
echo "sonatypePassword=${{ secrets.SPASSWORD }}" >> ./gradle.properties
echo "$(ls -la)"
- name: Prepare build.gradle
run: |
sed -i -e 's|.*sonatypeUsername.*| username = "${{ secrets.SUSER }}"|' ./build.gradle
sed -i -e 's|.*sonatypePassword.*| password = "${{ secrets.SPASSWORD }}"|' ./build.gradle
- name: Publish to Sonatype
run: |
./gradlew publishJarPublicationToStagingRepository