diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 780a2f0..b34d7c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,7 @@ jobs: uses: gradle/gradle-build-action@v2 with: gradle-version: wrapper - cache-read-only: ${{ github.ref != 'refs/heads/master' }} + cache-disabled: true # specify the build version, overrides whatever is in the build.gradle file arguments: build -PoverrideVersion=${{ env.VERSION }} @@ -45,5 +45,4 @@ jobs: name: Neko Detector ${{ env.VERSION }} draft: true prerelease: false - files: | - jarscanner-${{ env.VERSION }}.jar + files: build/libs/* diff --git a/build.gradle b/build.gradle index 1413417..17190ad 100644 --- a/build.gradle +++ b/build.gradle @@ -1,16 +1,30 @@ plugins { id "java" - id("com.github.johnrengelman.shadow") version "8.1.1" + id("com.github.johnrengelman.shadow") version "8.1.1" } group 'me.cortex' version '1.0-SNAPSHOT' + sourceCompatibility = 1.8 targetCompatibility = 1.8 +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } +} + repositories { mavenCentral() } +// Reproducible builds +// https://docs.gradle.org/current/userguide/working_with_files.html#sec:reproducible_archives +tasks.withType(AbstractArchiveTask).configureEach { + preserveFileTimestamps = false + reproducibleFileOrder = true +} + dependencies { implementation 'org.ow2.asm:asm:9.5' implementation 'org.ow2.asm:asm-tree:9.5' @@ -20,13 +34,13 @@ test { useJUnitPlatform() } - tasks.shadowJar { archiveClassifier.set("") manifest { attributes "Main-Class": "me.cortex.jarscanner.Main" } } + tasks.build { dependsOn(shadowJar) if (project.hasProperty("overrideVersion")) { @@ -39,4 +53,4 @@ jar { manifest { attributes 'Main-Class': 'me.cortex.jarscanner.Main' } -} \ No newline at end of file +}