Skip to content

Commit 47f4c8d

Browse files
Create gradle-publish.yml
1 parent e38197f commit 47f4c8d

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/gradle-publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
6+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
7+
8+
name: Gradle Package
9+
10+
on:
11+
push:
12+
branches:
13+
- master
14+
- releases
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
packages: write
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: Set up JDK 8
27+
uses: actions/setup-java@v2
28+
with:
29+
java-version: '8'
30+
distribution: 'temurin'
31+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
32+
settings-path: ${{ github.workspace }} # location for the settings.xml file
33+
34+
- name: Prepare to publish
35+
run: |
36+
echo "${{ secrets.GPG_KEY_CONTENTS }}" | base64 --decode > private_key.gpg
37+
38+
- name: Publish with Gradle
39+
uses: eskatos/gradle-command-action@v1
40+
with:
41+
gradle-version: current
42+
arguments: build publishToSonatype closeAndReleaseSonatypeStagingRepository -Psigning.secretKeyRingFile=private_key.gpg -Psigning.keyId=${{secrets.SIGNING_KEYID}} -Psigning.password=${{secrets.SIGNING_PASSWORD}} -PossSonatypeUsername=${{secrets.OSS_SONATYPE_USERNAME}} -PossSonatypePassword=${{secrets.OSS_SONATYPE_PASSWORD}}

0 commit comments

Comments
 (0)