From 09d8031c6c4ba3ae9c5cc87291759f1c60fd3d95 Mon Sep 17 00:00:00 2001 From: Zach Levis Date: Mon, 2 Nov 2020 22:00:57 -0800 Subject: [PATCH] Update in response to feedback --- .github/workflows/build.yml | 8 ++++++ .github/workflows/validate-gradle-wrapper.yml | 16 ------------ build.gradle | 26 ++++++------------- 3 files changed, 16 insertions(+), 34 deletions(-) delete mode 100644 .github/workflows/validate-gradle-wrapper.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94a6eed..31c38ee 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,6 +22,8 @@ jobs: steps: - name: checkout repository uses: actions/checkout@v2 + - name: validate gradle wrapper + uses: gradle/wrapper-validation-action@v1 - name: setup jdk ${{ matrix.java }} uses: actions/setup-java@v1 with: @@ -31,3 +33,9 @@ jobs: run: chmod +x ./gradlew - name: build run: ./gradlew build + - name: capture build artifacts + if: ${{ runner.os == 'Linux' && matrix.java == '11' }} # Only upload artifacts built from LTS java on one OS + uses: actions/upload-artifact@v2 + with: + name: Artifacts + path: build/libs/ diff --git a/.github/workflows/validate-gradle-wrapper.yml b/.github/workflows/validate-gradle-wrapper.yml deleted file mode 100644 index dbd886a..0000000 --- a/.github/workflows/validate-gradle-wrapper.yml +++ /dev/null @@ -1,16 +0,0 @@ -# Ensure the gradle wrapper in the repository has not been tampered with. -# If this check fails, something is seriously wrong -- try creating a new -# wrapper from a local gradle install. - -name: validate gradle wrapper - -on: [pull_request, push] - -jobs: - build: - runs-on: ubuntu-20.04 - steps: - - name: checkout repository - uses: actions/checkout@v2 - - name: validate gradle wrapper - uses: gradle/wrapper-validation-action@v1 diff --git a/build.gradle b/build.gradle index 94f0b64..e619e44 100644 --- a/build.gradle +++ b/build.gradle @@ -38,12 +38,12 @@ tasks.withType(JavaCompile).configureEach { // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used. // We'll use that if it's available, but otherwise we'll use the older option. - def targetVersion = JavaVersion.VERSION_1_8 + def targetVersion = 8 if (JavaVersion.current().isJava9Compatible()) { - it.options.release = targetVersion.ordinal() + 1 + it.options.release = targetVersion } else { - it.sourceCompatibility = targetVersion - it.targetCompatibility = targetVersion + it.sourceCompatibility = JavaVersion.toVersion(targetVersion) + it.targetCompatibility = JavaVersion.toVersion(targetVersion) } } @@ -56,7 +56,7 @@ java { jar { from("LICENSE") { - rename { "${it}_${project.name}"} + rename { "${it}_${project.archivesBaseName}"} } } @@ -74,19 +74,9 @@ publishing { } } - // select the repositories you want to publish to - // to just publish to maven local, no extra repositories are necessary. Just use the task `publishToMavenLocal`. + // Select the repositories you want to publish to + // To publish to maven local, no extra repositories are necessary. Just use the task `publishToMavenLocal`. repositories { - // An example of a standard Nexus setup, for those wishing to publish their mod artifacts - // maven { - // if (project.version.endsWith("-SNAPSHOT")) { - // url = "https://nexus.myorganization.org/repository/maven-snapshots/" - // } else { - // url = "https://nexus.myorganization.org/repository/maven-releases/" - // } - - // name = "myRepo" - // credentials(PasswordCredentials) // use the ${name}Username and ${name}Password properties for authentication - // } + // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. } }