File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed
Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Original file line number Diff line number Diff line change 1+ # .github/workflows/publish-to-maven.yml
2+ name : Publish to Maven Central
3+
4+ on :
5+ workflow_dispatch :
6+ inputs :
7+ version :
8+ description : ' Version to publish (e.g., 3.0.0)'
9+ required : true
10+ type : string
11+
12+ permissions :
13+ actions : read
14+ contents : read
15+ id-token : write
16+
17+ jobs :
18+ publish :
19+ if : github.event.sender.site_admin == true
20+ runs-on : [self-hosted, linux]
21+ steps :
22+ - name : Checkout code
23+ uses : actions/checkout@v4
24+
25+ - name : Set up JDK
26+ uses : actions/setup-java@v4
27+ with :
28+ distribution : ' temurin'
29+ java-version : ' 21'
30+
31+ - name : Prepare root gradle.properties
32+ run : |
33+ echo "mavenCentralUsername=${{ secrets.MAVEN_CENTRAL_USERNAME }}" >> gradle.properties
34+ echo "mavenCentralPassword=${{ secrets.MAVEN_CENTRAL_PASSWORD }}" >> gradle.properties
35+ echo "signing.password=${{ secrets.SIGNING_PASSWORD }}" >> gradle.properties
36+ echo "signing.keyId=${{ secrets.SIGNING_KEY_ID }}" >> gradle.properties
37+ echo "signing.secretKeyRingFile=secring.gpg" >> gradle.properties
38+
39+ # Write secret keyring file
40+ echo "${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}" | base64 -d > secring.gpg
41+
42+ - name : Set VERSION_NAME in library/gradle.properties
43+ run : |
44+ if grep -q "^VERSION_NAME=" library/gradle.properties; then
45+ sed -i "s/^VERSION_NAME=.*/VERSION_NAME=${{ github.event.inputs.version }}/" library/gradle.properties
46+ else
47+ echo "VERSION_NAME=${{ github.event.inputs.version }}" >> library/gradle.properties
48+ fi
49+ - name : Run publish and release
50+ run : ./gradlew :library:publishAndReleaseToMavenCentral --no-configuration-cache
You can’t perform that action at this time.
0 commit comments