File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- name : " Release"
1+ name : Publish
2+
23on :
3- release :
4- types :
5- - " released"
4+ push :
5+ tags :
6+ - ' v*'
7+
68jobs :
7- build :
8- name : " Release "
9- runs-on : " ubuntu-latest "
9+ publish :
10+ runs-on : ubuntu-latest
11+
1012 steps :
11- - uses : " actions/checkout@master"
13+ - name : Checkout Code
14+ uses : actions/checkout@v4
1215
13- - uses : " graalvm/setup-graalvm@v1"
16+ - name : Set up JDK
17+ uses : actions/setup-java@v4
1418 with :
15- java-version : " 23"
16- distribution : " graalvm-community"
17- github-token : ${{ secrets.GITHUB_TOKEN }}
18- cache : " gradle"
19+ java-version : ' 21'
20+ distribution : ' temurin'
1921
20- - uses : " actions/cache@master"
21- with :
22- path : |
23- ~/.gradle/caches
24- ~/.gradle/wrapper
25- key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/settings.gradle.kts') }}
26- restore-keys : |
27- ${{ runner.os }}-gradle-
28- - name : Publish
22+ - name : Extract version from tag
23+ id : extract_version
24+ run : echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
25+
26+ - name : Publish package
27+ run : ./gradlew publish
2928 env :
30- GPG_KEY : ${{ secrets.GPG_KEY }}
31- GPG_PASSPHRASE : ${{ secrets.GPG_PASSPHRASE }}
32- SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
33- SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
34- run : |
35- [[ "${{ github.event.release.tag_name }}" =~ ^[0-9]+(\.[0-9]+)*$ ]] || exit -1
36- chmod +x gradlew
37- ./gradlew publishToCentralPortal -Pversion="${{ github.event.release.tag_name }}"
29+ USERNAME : ${{ github.actor }}
30+ TOKEN : ${{ secrets.GITHUB_TOKEN }}
31+ RELEASE_VERSION : ${{ env.RELEASE_VERSION }}
Original file line number Diff line number Diff line change 1- import net.thebugmc.gradle.sonatypepublisher.PublishingType
21
32plugins {
43 id(" studio.o7.remora" ) version " 0.0.9"
5- id(" net.thebugmc.gradle.sonatype-central-portal-publisher" ) version " 1.2.4"
64}
75
86remora {
@@ -23,14 +21,24 @@ dependencies {
2321
2422java.toolchain.languageVersion.set(JavaLanguageVersion .of(21 ))
2523
26- centralPortal {
27- username = System .getenv(" SONATYPE_USERNAME" )
28- password = System .getenv(" SONATYPE_PASSWORD" )
29- name = remora.artifactId
30- publishingType = PublishingType .USER_MANAGED
31- }
24+ publishing {
25+ publications {
26+ create<MavenPublication >(" gpr" ) {
27+ from(components[" java" ])
28+ groupId = " studio.o7"
29+ artifactId = " agones-sdk"
30+ version = System .getenv(" RELEASE_VERSION" ) ? : " unspecified"
31+ }
32+ }
3233
33- signing {
34- useInMemoryPgpKeys(System .getenv(" GPG_KEY" ), System .getenv(" GPG_PASSPHRASE" ))
35- sign(publishing.publications)
36- }
34+ repositories {
35+ maven {
36+ name = " GitHubPackages"
37+ url = uri(" https://maven.pkg.github.com/o7studios/agones-java-sdk" )
38+ credentials {
39+ username = project.findProperty(" gpr.user" ) as String? ? : System .getenv(" USERNAME" )
40+ password = project.findProperty(" gpr.key" ) as String? ? : System .getenv(" TOKEN" )
41+ }
42+ }
43+ }
44+ }
You can’t perform that action at this time.
0 commit comments