Skip to content

Commit c15acd6

Browse files
committed
Create gradle-publish.yml
1 parent c65bacd commit c15acd6

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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 Publish
9+
10+
on:
11+
workflow_dispatch:
12+
inputs:
13+
revision:
14+
description: 'The version to release'
15+
required: true
16+
default: '2.0.0-SNAPSHOT'
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
if: ${{ inputs.revision }}
22+
permissions:
23+
contents: read
24+
packages: write
25+
strategy:
26+
matrix:
27+
java: [ '17' ]
28+
29+
steps:
30+
- name: Checkout Source
31+
uses: actions/checkout@v4
32+
33+
- name: Setup JDK ${{ matrix.Java }}
34+
uses: actions/setup-java@v4
35+
with:
36+
java-version: ${{ matrix.java }}
37+
distribution: 'temurin'
38+
39+
- name: Setup Gradle
40+
uses: gradle/actions/setup-gradle@dbbdc275be76ac10734476cc723d82dfe7ec6eda # v3.4.2
41+
42+
- name: Build and Publish with Gradle to GitHub Packages
43+
run: gradle build publish -Drevision=${{ inputs.revision }}
44+
env:
45+
OSSRH_MAVEN_USERNAME: ${{ secrets.OSS_SONATYPE_USERNAME }}
46+
OSSRH_MAVEN_PASSWORD: ${{ secrets.OSS_SONATYPE_PASSWORD }}
47+
ORG_GRADLE_PROJECT_SIGNING_KEY_ID: ${{ secrets.OSS_SIGNING_KEY_ID }}
48+
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.OSS_SIGNING_KEY }}
49+
ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.OSS_SIGNING_PASSWORD }}

0 commit comments

Comments
 (0)