diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2f4182e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,25 @@ +name: Build with Gradle + +on: [ push, pull_request ] + +jobs: + build: + runs-on: ubuntu-24.04 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Validate Gradle Wrapper + uses: gradle/actions/wrapper-validation@v3 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 21 + check-latest: true + - name: Build with Gradle + run: ./gradlew build + - name: Upload artifacts to GitHub + uses: actions/upload-artifact@v4 + with: + name: MidnightControls-Artifacts + path: /build/libs/ diff --git a/.github/workflows/gradlebuild.yml b/.github/workflows/gradlebuild.yml deleted file mode 100755 index 59841f8..0000000 --- a/.github/workflows/gradlebuild.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Gradle Build - -on: [ push, pull_request ] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 16 - uses: actions/setup-java@v1 - with: - java-version: 16 - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - - name: Build with Gradle - run: ./gradlew build - - - uses: actions/upload-artifact@v2 - with: - name: Artifacts - path: ./build/libs/ diff --git a/.github/workflows/modrinth_update.yml b/.github/workflows/modrinth_update.yml deleted file mode 100755 index c4ca2d9..0000000 --- a/.github/workflows/modrinth_update.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Gradle Build - -on: - release: - types: - - published - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 16 - uses: actions/setup-java@v1 - with: - java-version: 16 - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - - name: Build with Gradle - env: - MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} - run: ./gradlew publishModrinth diff --git a/.github/workflows/gradlepublish.yml b/.github/workflows/publish.yml old mode 100755 new mode 100644 similarity index 54% rename from .github/workflows/gradlepublish.yml rename to .github/workflows/publish.yml index f8c8fbf..8ce6418 --- a/.github/workflows/gradlepublish.yml +++ b/.github/workflows/publish.yml @@ -1,30 +1,24 @@ -name: Gradle Package +name: Publish to Modrinth on: - push: - tags: - - '*' + release: + types: + - published jobs: - build: - runs-on: ubuntu-latest + publish: + runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@v2 - - name: Set up JDK 16 - uses: actions/setup-java@v1 + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Validate Gradle Wrapper + uses: gradle/actions/wrapper-validation@v3 + - name: Set up JDK 21 + uses: actions/setup-java@v4 with: - java-version: 16 - server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - settings-path: ${{ github.workspace }} # location for the settings.xml file - - - name: Build with Gradle - run: ./gradlew build - - - uses: actions/upload-artifact@v2 - with: - name: Artifacts - path: ./build/libs/ - + distribution: 'temurin' + java-version: 21 + check-latest: true # The USERNAME and PASSWORD need to correspond to the credentials environment variables used in # the publishing section of your build.gradle - name: Publish to GitHub Packages and other Mavens @@ -38,3 +32,7 @@ jobs: midnightcontrols_MAVEN: ${{ secrets.MAVEN_URL }} MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + - name: Publish to Modrinth + env: + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + run: ./gradlew publishModrinth diff --git a/README.md b/README.md index 23ad637..cc42bf3 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Version](https://img.shields.io/github/v/tag/TeamMidnightDust/MidnightControls?label=version&style=round)](https://github.com/TeamMidnightDust/MidnightControls/releases) ![Environment: Client](https://img.shields.io/badge/environment-client-1976d2?style=round) [![Mod loader: Quilt/Fabric]][Quilt] -[![Java 17](https://img.shields.io/badge/language-Java%2017-9B599A.svg?style=round)](https://www.oracle.com/java/technologies/downloads/#java17) +[![Java 21](https://img.shields.io/badge/language-Java%2021-9B599A.svg?style=round)](https://www.oracle.com/java/technologies/downloads/#java21) [![GitHub license](https://img.shields.io/github/license/TeamMidnightDust/MidnightControls?style=round)](LICENSE) A Fabric Minecraft mod which adds better controls, reach-around and controller support. diff --git a/common/src/main/resources/midnightcontrols.mixins.json b/common/src/main/resources/midnightcontrols.mixins.json index 8a47266..b00371b 100644 --- a/common/src/main/resources/midnightcontrols.mixins.json +++ b/common/src/main/resources/midnightcontrols.mixins.json @@ -1,7 +1,7 @@ { "required": true, "package": "eu.midnightdust.midnightcontrols.client.mixin", - "compatibilityLevel": "JAVA_16", + "compatibilityLevel": "JAVA_21", "client": [ "AdvancementsScreenAccessor", "ChatScreenMixin", diff --git a/common/src/main/resources/midnightcontrols_compat.mixins.json b/common/src/main/resources/midnightcontrols_compat.mixins.json index 12d13ab..08d4bfb 100644 --- a/common/src/main/resources/midnightcontrols_compat.mixins.json +++ b/common/src/main/resources/midnightcontrols_compat.mixins.json @@ -2,7 +2,7 @@ "required": true, "package": "eu.midnightdust.midnightcontrols.client.compat.mixin", "plugin": "eu.midnightdust.midnightcontrols.client.compat.MidnightControlsMixinPlugin", - "compatibilityLevel": "JAVA_16", + "compatibilityLevel": "JAVA_21", "client": [ "sodium.SodiumOptionsGUIAccessor" ], diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index 80553c7..f8f7cbd 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -54,7 +54,7 @@ "fabric": ">=0.71.0", "minecraft": ">=1.20.5", "obsidianui": ">=0.2.5", - "java": ">=17" + "java": ">=21" }, "suggests": { "kontrolo": "*"