diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..709ebe4 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,30 @@ +name: Build + +on: [pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: temurin + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Build with Gradle + shell: bash + run: ./gradlew build + + - name: Upload Build Artifacts + uses: actions/upload-artifact@v4 + with: + name: jar + path: build/libs/* \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml deleted file mode 100644 index b58714e..0000000 --- a/.github/workflows/deploy.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: Deploy - -on: - release: - types: [published] - -jobs: - deploy: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Deploy - uses: auxves/actions/deploy-minecraft-mod@main - with: - token: ${{ secrets.GITHUB_TOKEN }} - java-version: 17 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..72de5ce --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,38 @@ +name: Release + +on: + workflow_dispatch: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + environment: Production + + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Java + uses: actions/setup-java@v4 + with: + java-version: 21 + distribution: temurin + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Build with Gradle + shell: bash + run: ./gradlew build + + - uses: Kir-Antipov/mc-publish@v3.3 + with: + modrinth-id: Xv9MHBa1 + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} + + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/build.gradle.kts b/build.gradle.kts index b8b0f2d..42ec225 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,7 +1,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -java.sourceCompatibility = JavaVersion.VERSION_1_8 -java.targetCompatibility = JavaVersion.VERSION_1_8 +java.sourceCompatibility = JavaVersion.VERSION_21 +java.targetCompatibility = JavaVersion.VERSION_21 plugins { id("fabric-loom") @@ -31,7 +31,7 @@ tasks.named("processResources") { } tasks.withType { - kotlinOptions.jvmTarget = "1.8" + kotlinOptions.jvmTarget = "21" } tasks.withType { diff --git a/gradle.properties b/gradle.properties index 948e227..2116124 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,10 +4,10 @@ org.gradle.jvmargs=-Xmx1G # Project version=2.0.8 -# Versions (https://modmuss50.me/fabric.html) -minecraft=1.20.1 -yarn=1.20.1+build.10 -loader=0.14.22 +# Versions (https://fabricmc.net/develop) +minecraft=1.20.6 +yarn=1.20.6+build.1 +loader=0.15.11 -fabric_api=0.88.1+1.20.1 -fabric_kotlin=1.10.10+kotlin.1.9.10 +fabric_api=0.98.0+1.20.6 +fabric_kotlin=1.10.20+kotlin.1.9.24 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 62f495d..b82aa23 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle.kts b/settings.gradle.kts index 02d0777..94af941 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,7 +5,7 @@ pluginManagement { } plugins { - id("fabric-loom") version "1.3-SNAPSHOT" - kotlin("jvm") version "1.9.10" + id("fabric-loom") version "1.6-SNAPSHOT" + kotlin("jvm") version "1.9.24" } } diff --git a/src/main/kotlin/dev/auxves/disco/Disc.kt b/src/main/kotlin/dev/auxves/disco/Disc.kt index 8eaccf8..fdb45ee 100644 --- a/src/main/kotlin/dev/auxves/disco/Disc.kt +++ b/src/main/kotlin/dev/auxves/disco/Disc.kt @@ -1,6 +1,6 @@ package dev.auxves.disco -import net.fabricmc.fabric.api.item.v1.FabricItemSettings +import net.minecraft.item.Item import net.minecraft.item.ItemStack import net.minecraft.item.MusicDiscItem import net.minecraft.sound.SoundEvent @@ -8,7 +8,7 @@ import net.minecraft.text.Text import net.minecraft.util.Identifier import net.minecraft.util.Rarity -private val settings = FabricItemSettings() +private val settings = Item.Settings() .rarity(Rarity.RARE) .maxCount(1) diff --git a/src/main/kotlin/dev/auxves/disco/Entrypoint.kt b/src/main/kotlin/dev/auxves/disco/Entrypoint.kt index 77e1de5..8d9e8d6 100644 --- a/src/main/kotlin/dev/auxves/disco/Entrypoint.kt +++ b/src/main/kotlin/dev/auxves/disco/Entrypoint.kt @@ -6,7 +6,6 @@ import net.minecraft.item.ItemGroups import net.minecraft.registry.Registries import net.minecraft.registry.Registry -@Suppress("unused") fun init() { val addons = FabricLoader.getInstance().allMods .filter { it.metadata.customValues.containsKey("disco") } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 74bc98e..4f8900f 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -9,7 +9,7 @@ "homepage": "https://disco.auxves.dev", "sources": "https://github.com/auxves/disco" }, - "license": "MIT", + "license": ["GPL-3.0"], "icon": "assets/disco/icon.png", "environment": "*", "entrypoints": { @@ -17,7 +17,7 @@ }, "mixins": [], "depends": { - "minecraft": "1.20.x", + "minecraft": ">=1.20", "fabric-api": "*", "fabric-language-kotlin": "*" }