Browse Source

Build fully on Java 17, closes #2670 (#2676)

21w37a-wip
modmuss50 1 month ago
committed by GitHub
parent
commit
b23b7c6681
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      .github/workflows/build.yml
  2. 18
      .github/workflows/publish.yml
  3. 7
      build.gradle
  4. BIN
      gradle/wrapper/gradle-wrapper.jar
  5. 2
      gradle/wrapper/gradle-wrapper.properties
  6. 2
      gradlew

7
.github/workflows/build.yml

@ -4,7 +4,7 @@ jobs:
build:
strategy:
matrix:
java: [16-jdk]
java: [17-jdk]
runs-on: ubuntu-20.04
container:
image: openjdk:${{ matrix.java }}
@ -12,10 +12,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
- run: |
curl https://maven.fabricmc.net/net/java/jdk/openjdk-17-ea%2B24_linux-x64_bin.tar.gz --output java.tar.gz
tar -xf java.tar.gz
- run: ./gradlew build javadocJar checkMappings --stacktrace -Porg.gradle.java.installations.auto-download=false -Porg.gradle.java.installations.paths=$(pwd)/jdk-17
- run: ./gradlew build javadocJar checkMappings --stacktrace
- name: Build artifacts
if: ${{ matrix.java == '16-jdk' }}
continue-on-error: true

18
.github/workflows/publish.yml

@ -1,25 +1,16 @@
name: Publish
on: [push]
concurrency: ci-${{ github.ref }}
jobs:
build:
runs-on: ubuntu-20.04
container:
image: openjdk:16-jdk
image: openjdk:17-jdk
options: --user root
steps:
- uses: actions/checkout@v2
- uses: gradle/wrapper-validation-action@v1
# Ensure that releases are not ran in parallel, this ensures that the latest commit is the latest release
# See https://github.com/softprops/turnstyle
- name: Turnstyle
uses: softprops/turnstyle@v1
with:
continue-after-seconds: 3600
same-branch-only: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Generate the build number based on tags to allow per branch build numbers, not something github provides by default.
- name: Generate build number
id: buildnumber
@ -28,10 +19,7 @@ jobs:
token: ${{ secrets.github_token }}
prefix: ${{ github.ref }}
- run: |
curl https://maven.fabricmc.net/net/java/jdk/openjdk-17-ea%2B24_linux-x64_bin.tar.gz --output java.tar.gz
tar -xf java.tar.gz
- run: ./gradlew build javadocJar checkVersion publish --stacktrace -Porg.gradle.java.installations.auto-download=false -Porg.gradle.java.installations.paths=$(pwd)/jdk-17
- run: ./gradlew build javadocJar checkVersion publish --stacktrace
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}

7
build.gradle

@ -827,13 +827,6 @@ javadoc {
group = "javadoc generation"
outputs.upToDateWhen { false }
if (ENV.CI) {
// Java 17 is provided on CI to build the javadocs with, see https://github.com/FabricMC/yarn/issues/2429
javadocTool = javaToolchains.javadocToolFor {
languageVersion = JavaLanguageVersion.of(17)
}
}
def mappingPoetJar = project.provider { zipTree configurations.mappingPoetJar.singleFile }
failOnError = false

BIN
gradle/wrapper/gradle-wrapper.jar

2
gradle/wrapper/gradle-wrapper.properties

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

2
gradlew

@ -72,7 +72,7 @@ case "`uname`" in
Darwin* )
darwin=true
;;
MINGW* )
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )

Loading…
Cancel
Save