-
Notifications
You must be signed in to change notification settings - Fork 21
32 lines (28 loc) · 1.15 KB
/
publish.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
name: Publish
on:
release:
types: [released]
jobs:
publish:
name: Upload archives
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
with:
ref:
main
- name: Prepare Sonatype Gradle properties
run: |
mkdir -p ~/.gradle
echo "${{ secrets.SONATYPE_GPG_FILE }}" > key.gpg.asc
gpg -d --passphrase "${{ secrets.SONATYPE_GPG_PASSPHRASE }}" --batch "key.gpg.asc" > "$HOME/.gradle/key.gpg"
echo "signing.keyId=${{ secrets.SONATYPE_GPG_ID }}" >> ~/.gradle/gradle.properties
echo "signing.password=${{ secrets.SONATYPE_GPG_PASSWORD }}" >> ~/.gradle/gradle.properties
echo "signing.secretKeyRingFile=$HOME/.gradle/key.gpg" >> ~/.gradle/gradle.properties
echo "sonatypeStagingProfileId=${{ secrets.SONATYPE_STAGING_PROFILE_ID }}" >> ~/.gradle/gradle.properties
- name: Publish to MavenCentral
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}