Skip to content

Commit

Permalink
Run with java 21
Browse files Browse the repository at this point in the history
  • Loading branch information
lukebemish committed May 23, 2024
1 parent 5c1ccb2 commit fef75d0
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 9 deletions.
79 changes: 72 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
{
"jobs": {
"build": {
"outputs": {
"version": "${{ steps.record_version_capture_version.outputs.version }}"
},
"runs-on": "ubuntu-22.04",
"permissions": {
"contents": "write"
},
"steps": [
{
"name": "Setup Java",
"run": "echo \"JAVA_HOME=$JAVA_HOME_17_X64\" >> \"$GITHUB_ENV\""
"run": "echo \"JAVA_HOME=$JAVA_HOME_21_X64\" >> \"$GITHUB_ENV\""
},
{
"with": {
Expand All @@ -17,21 +20,25 @@
"name": "Checkout",
"uses": "actions/checkout@v4"
},
{
"name": "Validate Gradle Wrapper",
"uses": "gradle/actions/wrapper-validation@v3"
},
{
"with": {
"path": "**/.gradle/loom-cache",
"path": "**/.gradle/loom-cache\n**/.gradle/quilt-loom-cache",
"key": "${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}",
"restore-keys": "${{ runner.os }}-gradle-"
},
"name": "Cache",
"uses": "actions/cache@v3"
"uses": "actions/cache@v4"
},
{
"with": {
"gradle-home-cache-cleanup": true
},
"name": "Setup Gradle",
"uses": "gradle/gradle-build-action@v2"
"uses": "gradle/actions/setup-gradle@v3"
},
{
"uses": "fregante/setup-git-user@v2"
Expand All @@ -58,6 +65,67 @@
"GPG_KEY_PASSWORD": "${{ secrets.GPG_KEY_PASSWORD }}"
}
},
{
"run": "git push && git push --tags"
},
{
"name": "Record Version",
"run": "./gradlew recordVersion",
"id": "record_version",
"env": {
"CENTRAL_MAVEN_USER": "${{ secrets.CENTRAL_MAVEN_USER }}",
"CENTRAL_MAVEN_PASSWORD": "${{ secrets.CENTRAL_MAVEN_PASSWORD }}",
"GPG_SIGNING_KEY": "${{ secrets.GPG_SIGNING_KEY }}",
"GPG_KEY_PASSWORD": "${{ secrets.GPG_KEY_PASSWORD }}"
}
},
{
"name": "Capture Recorded Version",
"run": "echo version=$(cat build/recordVersion.txt) >> \"$GITHUB_OUTPUT\"",
"id": "record_version_capture_version"
}
]
},
"publish": {
"needs": [
"build"
],
"runs-on": "ubuntu-22.04",
"steps": [
{
"name": "Setup Java",
"run": "echo \"JAVA_HOME=$JAVA_HOME_21_X64\" >> \"$GITHUB_ENV\""
},
{
"with": {
"fetch-depth": "0",
"ref": "refs/tags/${{needs.build.outputs.version}}",
"persist-credentials": "false"
},
"name": "Checkout",
"uses": "actions/checkout@v4"
},
{
"name": "Validate Gradle Wrapper",
"uses": "gradle/actions/wrapper-validation@v3"
},
{
"with": {
"path": "**/.gradle/loom-cache\n**/.gradle/quilt-loom-cache",
"key": "${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}",
"restore-keys": "${{ runner.os }}-gradle-"
},
"name": "Cache",
"uses": "actions/cache/restore@v4"
},
{
"with": {
"cache-read-only": true,
"gradle-home-cache-cleanup": true
},
"name": "Setup Gradle",
"uses": "gradle/actions/setup-gradle@v3"
},
{
"name": "Publish",
"run": "./gradlew publish closeAndReleaseSonatypeStagingRepository",
Expand All @@ -68,9 +136,6 @@
"GPG_SIGNING_KEY": "${{ secrets.GPG_SIGNING_KEY }}",
"GPG_KEY_PASSWORD": "${{ secrets.GPG_KEY_PASSWORD }}"
}
},
{
"run": "git push && git push --tags"
}
]
}
Expand Down
16 changes: 14 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
id 'net.neoforged.gradle.userdev' version '7.0.120'
id 'org.groovymc.modsdotgroovy' version '2.0.0-beta.24'
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0-rc-1'
id 'dev.lukebemish.managedversioning' version '1.2.7'
id 'dev.lukebemish.managedversioning' version '1.2.19'
}

group = 'org.groovymc.gml'
Expand All @@ -31,16 +31,28 @@ managedVersioning {
workflowDispatch.set(true)
gradleJob {
name.set 'build'
javaVersion.set '21'
step {
setupGitUser()
}
readOnly.set false
gradlew 'Tag Release', 'tagRelease'
gradlew 'Build', 'build'
gradlew 'Publish', 'publish', 'closeAndReleaseSonatypeStagingRepository'
step {
run.set 'git push && git push --tags'
}
recordVersion 'Record Version', 'version'
secret('CENTRAL_MAVEN_USER')
secret('CENTRAL_MAVEN_PASSWORD')
secret('GPG_SIGNING_KEY')
secret('GPG_KEY_PASSWORD')
}
gradleJob {
name.set 'publish'
javaVersion.set '21'
needs.add('build')
tag.set('${{needs.build.outputs.version}}')
gradlew 'Publish', 'publish', 'closeAndReleaseSonatypeStagingRepository'
secret('CENTRAL_MAVEN_USER')
secret('CENTRAL_MAVEN_PASSWORD')
secret('GPG_SIGNING_KEY')
Expand Down

0 comments on commit fef75d0

Please sign in to comment.