Skip to content

Commit

Permalink
Update deps to fix build.
Browse files Browse the repository at this point in the history
  • Loading branch information
modmuss50 committed Sep 7, 2024
1 parent 78c7d0d commit 9aa1c56
Show file tree
Hide file tree
Showing 8 changed files with 259 additions and 175 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,20 @@
name: Build
on: [push, pull_request]

concurrency:
group: build-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
strategy:
matrix:
java: [8-jdk, 11-jdk, 16-jdk, 17-jdk]
runs-on: ubuntu-20.04
java: [8-jdk, 11-jdk, 17-jdk, 21-jdk]
runs-on: ubuntu-24.04
container:
image: openjdk:${{ matrix.java }}
image: eclipse-temurin:${{ matrix.java }}
options: --user root
steps:
- uses: actions/checkout@v1
- uses: gradle/wrapper-validation-action@v1
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3
- run: ./gradlew build --stacktrace
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: Artifacts
name: Artifacts ${{ matrix.java }}
path: build/libs/
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: Release
on: [workflow_dispatch] # Manual trigger
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
container:
image: openjdk:17-jdk
image: oeclipse-temurin:21-jdk
options: --user root
steps:
- uses: actions/checkout@v1
- uses: gradle/wrapper-validation-action@v1
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v3
- run: chmod +x ./gradlew
- run: ./gradlew checkVersion build publish --stacktrace
env:
Expand Down
27 changes: 15 additions & 12 deletions HEADER
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
Copyright (c) 2016, 2017, 2018, 2019 FabricMC
/*
* Copyright (c) 2016, 2017, 2018, 2019 FabricMC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
55 changes: 33 additions & 22 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@ plugins {
id 'java'
id 'maven-publish'
id "checkstyle"
id "com.github.johnrengelman.shadow" version "7.0.0"
id "org.cadixdev.licenser" version "0.6.1"
id "de.undercouch.download" version "4.1.2"
id "me.modmuss50.remotesign" version "0.1.0"
id "com.gradleup.shadow" version "8.3.0"
id "com.diffplug.spotless" version "6.20.0"
id "de.undercouch.download" version "5.6.0"
id "me.modmuss50.remotesign" version "0.4.0"
}

sourceCompatibility = 1.8
version = '1.0.1'
archivesBaseName = "fabric-installer"

def ENV = System.getenv()
version = version + (ENV.GITHUB_ACTIONS ? "" : "+local")
Expand Down Expand Up @@ -39,6 +37,14 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
}

base {
archivesName = "fabric-installer"
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
}

tasks.withType(JavaCompile).configureEach {
it.options.encoding = "UTF-8"

Expand All @@ -64,11 +70,12 @@ shadowJar {
exclude('icon.ico')
}

task serverJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
tasks.register('serverJar', ShadowJar) {
manifest {
attributes 'Implementation-Title': 'FabricInstaller',
'Implementation-Version': project.version,
'Main-Class': 'net.fabricmc.installer.ServerLauncher'
'Implementation-Version': project.version,
'Main-Class': 'net.fabricmc.installer.ServerLauncher'
}

minimize()
Expand All @@ -85,13 +92,16 @@ assemble.dependsOn serverJar
def bootstrapVersion = "0.5.2"
def bootstrapArch = "i686"

task downloadBootstrap(type: Download) {
tasks.register('downloadBootstrap', Download) {
src "https://maven.fabricmc.net/net/fabricmc/fabric-installer-native-bootstrap/windows-${bootstrapArch}/${bootstrapVersion}/windows-${bootstrapArch}-${bootstrapVersion}.exe"
dest project.buildDir
dest layout.buildDirectory
overwrite false
}

task nativeExe(dependsOn: [shadowJar, downloadBootstrap], type: FileOutput) {
output = file("${projectDir}/build/libs/${archivesBaseName}-${project.version}.exe")
tasks.register('nativeExe', FileOutput) {
dependsOn shadowJar
dependsOn downloadBootstrap
output = file("${projectDir}/build/libs/${base.archivesName.get()}-${project.version}.exe")
outputs.upToDateWhen { false }

doFirst {
Expand Down Expand Up @@ -121,9 +131,9 @@ jar {

if (ENV.SIGNING_SERVER) {
remoteSign {
requestUrl ENV.SIGNING_SERVER
pgpAuthKey ENV.SIGNING_PGP_KEY
jarAuthKey ENV.SIGNING_JAR_KEY
requestUrl = ENV.SIGNING_SERVER
pgpAuthKey = ENV.SIGNING_PGP_KEY
jarAuthKey = ENV.SIGNING_JAR_KEY

sign (shadowJar)

Expand All @@ -135,16 +145,17 @@ if (ENV.SIGNING_SERVER) {
nativeExe.dependsOn signShadowJar
}

license {
header rootProject.file("HEADER")
include "**/*.java"
spotless {
java {
licenseHeaderFile(rootProject.file("HEADER"))
}
}

publishing {
publications {
maven(MavenPublication) {
groupId project.group
artifactId project.archivesBaseName
artifactId base.archivesName.get()
version project.version

if (ENV.SIGNING_SERVER) {
Expand Down Expand Up @@ -179,10 +190,10 @@ publishing {
}

// A task to ensure that the version being released has not already been released.
task checkVersion {
tasks.register('checkVersion') {
doFirst {
def xml = new URL("https://maven.fabricmc.net/net/fabricmc/fabric-installer/maven-metadata.xml").text
def metadata = new XmlSlurper().parseText(xml)
def metadata = new groovy.xml.XmlSlurper().parseText(xml)
def versions = metadata.versioning.versions.version*.text();
if (versions.contains(version)) {
throw new RuntimeException("${version} has already been released!")
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 9aa1c56

Please sign in to comment.