Skip to content

Commit 60c2a52

Browse files
committed
Update Gradle, Gradle plugins, and GitHub actions
1 parent 0f2875c commit 60c2a52

10 files changed

+53
-56
lines changed

.github/workflows/draftrelease.yml

+13-27
Original file line numberDiff line numberDiff line change
@@ -12,51 +12,37 @@ jobs:
1212

1313
steps:
1414
- name: Checkout repository
15-
uses: actions/checkout@v2
16-
- name: Set up JDK 6
17-
id: setup_jdk_6
18-
uses: actions/setup-java@v1
15+
uses: actions/checkout@v3
16+
- name: Set up JDK 6 & 17
17+
uses: actions/setup-java@v3
1918
with:
20-
java-version: 6
21-
- name: Set up JDK 17
22-
id: setup_jdk_17
23-
uses: actions/setup-java@v1
24-
with:
25-
java-version: 17
19+
distribution: 'zulu'
20+
java-version: |
21+
6
22+
17
2623
- name: Install advancecomp
2724
run: sudo apt-get install advancecomp
2825
- name: Install strip-nondeterminism
2926
run: sudo apt-get install strip-nondeterminism
3027
- name: Build with Gradle
3128
env:
32-
GITHUB_ACTIONS_JDK_6: ${{ steps.setup_jdk_6.outputs.path }}
33-
GITHUB_ACTIONS_JDK_17: ${{ steps.setup_jdk_17.outputs.path }}
3429
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3530
BUILD_RELEASE: ${{ github.event.release.prerelease == false }}
36-
uses: gradle/gradle-build-action@v1
31+
uses: gradle/gradle-build-action@v2
3732
with:
3833
gradle-version: wrapper
39-
distributions-cache-enabled: false
40-
dependencies-cache-enabled: false
41-
configuration-cache-enabled: false
42-
arguments: build publish
34+
cache-disabled: true
35+
arguments: build publish --scan --stacktrace --warning-mode all
4336
- name: Run strip-nondeterminism on built .jar files
4437
run: strip-nondeterminism mc-texture-gen-app/build/libs/*.jar
4538
- name: Run advzip on built .jar files
4639
run: advzip --shrink-insane --iter 99999 -k -p -z mc-texture-gen-app/build/libs/*.jar
4740
- name: Draft release
48-
id: create_release
49-
uses: actions/create-release@v1
50-
env:
51-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
uses: softprops/action-gh-release@v1
5242
with:
5343
tag_name: ${{ github.ref }}
54-
release_name: Draft release ${{ github.ref }}
44+
name: Draft release ${{ github.ref }}
5545
body: Replace this text with the description of this release!
5646
draft: true
5747
prerelease: false
58-
- name: Upload draft release assets
59-
uses: shogo82148/actions-upload-release-asset@v1
60-
with:
61-
upload_url: ${{ steps.create_release.outputs.upload_url }}
62-
asset_path: mc-texture-gen-app/build/libs/*.jar
48+
files: mc-texture-gen-app/build/libs/*.jar

.github/workflows/gradle.yml

+11-18
Original file line numberDiff line numberDiff line change
@@ -15,39 +15,32 @@ jobs:
1515

1616
steps:
1717
- name: Checkout repository
18-
uses: actions/checkout@v2
19-
- name: Set up JDK 6
20-
id: setup_jdk_6
21-
uses: actions/setup-java@v1
18+
uses: actions/checkout@v3
19+
- name: Set up JDK 6 & 17
20+
uses: actions/setup-java@v3
2221
with:
23-
java-version: 6
24-
- name: Set up JDK 17
25-
id: setup_jdk_17
26-
uses: actions/setup-java@v1
27-
with:
28-
java-version: 17
22+
distribution: 'zulu'
23+
java-version: |
24+
6
25+
17
2926
- name: Install advancecomp
3027
run: sudo apt-get install advancecomp
3128
- name: Install strip-nondeterminism
3229
run: sudo apt-get install strip-nondeterminism
3330
- name: Build with Gradle
3431
env:
35-
GITHUB_ACTIONS_JDK_6: ${{ steps.setup_jdk_6.outputs.path }}
36-
GITHUB_ACTIONS_JDK_17: ${{ steps.setup_jdk_17.outputs.path }}
3732
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38-
uses: gradle/gradle-build-action@v1
33+
uses: gradle/gradle-build-action@v2
3934
with:
4035
gradle-version: wrapper
41-
distributions-cache-enabled: true
42-
dependencies-cache-enabled: true
43-
configuration-cache-enabled: true
44-
arguments: build publish
36+
cache-read-only: ${{ github.ref != 'refs/heads/main' }}
37+
arguments: build publish --scan --stacktrace --warning-mode all
4538
- name: Run strip-nondeterminism on built .jar files
4639
run: strip-nondeterminism mc-texture-gen-app/build/libs/*.jar
4740
- name: Run advzip on built .jar files
4841
run: advzip --shrink-insane --iter 999 -k -p -z mc-texture-gen-app/build/libs/*.jar
4942
- name: Upload artifacts
50-
uses: actions/upload-artifact@v2
43+
uses: actions/upload-artifact@v3
5144
with:
5245
name: Package
5346
path: mc-texture-gen-app/build/libs

buildSrc/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ dependencies {
1313
// Shadow is used to package API classes with applications
1414
implementation "gradle.plugin.com.github.johnrengelman:shadow:7.1.2"
1515
// ProGuard is used to minify and optimise applications
16-
implementation "com.guardsquare:proguard-gradle:7.2.2"
16+
implementation "com.guardsquare:proguard-gradle:7.3.0"
1717
}

buildSrc/src/main/groovy/com.github.nerdthened.mctexturegen.java-common-conventions.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ repositories {
99
// All unit tests use JUnit Jupiter
1010
dependencies {
1111
testImplementation group: 'org.junit.jupiter',
12-
name: 'junit-jupiter', version: '5.9.1'
12+
name: 'junit-jupiter', version: '5.9.2'
1313
}
1414

1515
// Defines a Java 6 compatible JDK

gradle.properties

-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
# This property allows Gradle to find a JDK 6 installation when using GitHub actions, because GitHub actions is not smart.
2-
# TODO: Replace when Gradle supports this natively.
3-
org.gradle.java.installations.fromEnv=GITHUB_ACTIONS_JDK_6,GITHUB_ACTIONS_JDK_17
4-
51
# Versions of Java to use when compiling / testing
62

73
# Java version to select toolchain used in compiling applications / API classes

gradle/wrapper/gradle-wrapper.jar

818 Bytes
Binary file not shown.
+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

gradlew

+8-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,10 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

8888
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8989
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac

gradlew.bat

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
2828
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

settings.gradle

+16
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,18 @@
1+
plugins {
2+
id "com.gradle.enterprise" version "3.12.2"
3+
}
4+
5+
gradleEnterprise {
6+
buildScan {
7+
termsOfServiceUrl = "https://gradle.com/terms-of-service"
8+
termsOfServiceAgree = "yes"
9+
10+
if (System.getenv("CI")) {
11+
publishAlways()
12+
tag "CI"
13+
}
14+
}
15+
}
16+
117
rootProject.name = 'mc-texture-gen-base'
218
include('mc-texture-gen-app', 'mc-texture-gen-impl')

0 commit comments

Comments
 (0)