diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e8b358..fe3ab5b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,21 +1,19 @@ name: CI for Mod on: + workflow_dispatch: push: branches: - releases/** paths: + - src/** - common/** - fabric/** - forge/** - - neoforge/** - build.gradle - gradle.properties - settings.gradle jobs: - gametest: - secrets: inherit - uses: ./.github/workflows/gametest.yml build: runs-on: ubuntu-latest env: @@ -54,17 +52,14 @@ jobs: - name: Get Version id: version run: | - MESSAGE=$(ls forge/build/libs/* | grep sources.jar -v | grep shadow.jar -v | grep slim.jar -v | awk -F '${{ steps.properties.outputs.mod_id }}-forge-|.jar' '{print $2}') + MESSAGE=$(ls build/libs/* | grep sources.jar -v | grep shadow.jar -v | grep slim.jar -v | awk -F '${{ steps.properties.outputs.mod_id }}-neoforge-|.jar' '{print $2}') echo "version=$MESSAGE" >> $GITHUB_OUTPUT - name: capture build artifacts uses: actions/upload-artifact@v4.3.3 with: name: "${{ steps.properties.outputs.mod_name }} ${{ steps.version.outputs.version }}" - path: | - fabric/build/libs/${{ steps.properties.outputs.mod_id }}-fabric-${{ steps.version.outputs.version }}.jar - forge/build/libs/${{ steps.properties.outputs.mod_id }}-forge-${{ steps.version.outputs.version }}.jar - neoforge/build/libs/${{ steps.properties.outputs.mod_id }}-neoforge-${{ steps.version.outputs.version }}.jar + path: build/libs/${{ steps.properties.outputs.mod_id }}-neoforge-${{ steps.version.outputs.version }}.jar - name: Publish to maven run: ./gradlew publish @@ -73,3 +68,9 @@ jobs: MAVEN_USERNAME: ${{ secrets.MAVEN_USER }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASS }} continue-on-error: true + + - name: gametest + uses: Anvil-Dev/dedicated-server-launch-test@1.21.1-neoforge + with: + mod: build/libs/${{ steps.properties.outputs.mod_id }}-neoforge-${{ steps.version.outputs.version }}.jar + extra-mods: patchouli:1.21-87-neoforge cloth-config:15.0.140+neoforge diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml deleted file mode 100644 index 0983ad8..0000000 --- a/.github/workflows/dev-ci.yml +++ /dev/null @@ -1,67 +0,0 @@ -name: CI for Mod -on: - push: - branches: - - dev/** - paths: - - src/** - - build.gradle - - gradle.properties - - settings.gradle - -jobs: - build: - runs-on: ubuntu-latest - env: - CI_BUILD: true - PR_BUILD: false - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: validate gradle wrapper - uses: gradle/actions/wrapper-validation@v3 - - - name: Read Properties - id: 'properties' - uses: christian-draeger/read-properties@1.1.1 - with: - path: gradle.properties - properties: 'mod_id mod_name java_version' - - - name: Setup Java ${{ steps.properties.outputs.java_version }} - uses: actions/setup-java@v3.6.0 - with: - distribution: zulu - java-version: ${{ steps.properties.outputs.java_version }} - - - name: make gradle wrapper executable - if: ${{ runner.os != 'Windows' }} - run: chmod +x ./gradlew - - - name: Build with Gradle - uses: gradle/actions/setup-gradle@v3 - - - name: Build - run: ./gradlew build - - - name: Find correct JAR - id: find-jar - run: | - output="$(find build/libs/ ! -name "*-dev.jar" ! -name "*-sources.jar" -type f -printf "%f\n")" - echo "jarname=$output" >> $GITHUB_OUTPUT - - - name: capture build artifacts - if: ${{ runner.os == 'Linux' && matrix.java == '17' }} - uses: actions/upload-artifact@v3.1.1 - with: - name: ${{ steps.find-jar.outputs.jarname }} - path: build/libs/${{ steps.find-jar.outputs.jarname }} - - - name: Publish to maven - run: ./gradlew publish - env: - MAVEN_URL: ${{ secrets.MAVEN_URL }} - MAVEN_USERNAME: ${{ secrets.MAVEN_USER }} - MAVEN_PASSWORD: ${{ secrets.MAVEN_PASS }} - continue-on-error: true diff --git a/.github/workflows/gametest.yml b/.github/workflows/gametest.yml deleted file mode 100644 index b49a3ae..0000000 --- a/.github/workflows/gametest.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Pull Request GameTest -on: workflow_call - -jobs: - test: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v4 - - - name: validate gradle wrapper - uses: gradle/actions/wrapper-validation@v3 - - - name: Read Properties - id: 'properties' - uses: christian-draeger/read-properties@1.1.1 - with: - path: gradle.properties - properties: 'mod_id java_version' - - - name: Setup Java ${{ steps.properties.outputs.java_version }} - uses: actions/setup-java@v3.6.0 - with: - distribution: zulu - java-version: ${{ steps.properties.outputs.java_version }} - - - name: make gradle wrapper executable - if: ${{ runner.os != 'Windows' }} - run: chmod +x ./gradlew - - - name: Build with Gradle - uses: gradle/actions/setup-gradle@v3 - - - name: Run Fabric GameTest - run: ./gradlew ${{ steps.properties.outputs.mod_id }}-fabric:runGameTestServer - - - name: Run Forge GameTest - run: ./gradlew ${{ steps.properties.outputs.mod_id }}-forge:runGameTestServer - - - name: Run NeoForge GameTest - run: ./gradlew ${{ steps.properties.outputs.mod_id }}-neoforge:runGameTestServer diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 994ce15..e1bdce1 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -1,19 +1,19 @@ name: Pull Request Check on: + workflow_dispatch: pull_request: + branches: + - releases/** paths: + - src/** - common/** - fabric/** - forge/** - - neoforge/** - build.gradle - gradle.properties - settings.gradle jobs: - gametest: - secrets: inherit - uses: ./.github/workflows/gametest.yml build: runs-on: ubuntu-latest env: @@ -52,14 +52,17 @@ jobs: - name: Get Version id: version run: | - MESSAGE=$(ls forge/build/libs/* | grep sources.jar -v | grep shadow.jar -v | grep slim.jar -v | awk -F '${{ steps.properties.outputs.mod_id }}-forge-|.jar' '{print $2}') + MESSAGE=$(ls build/libs/* | grep sources.jar -v | grep shadow.jar -v | grep slim.jar -v | awk -F '${{ steps.properties.outputs.mod_id }}-neoforge-|.jar' '{print $2}') echo "version=$MESSAGE" >> $GITHUB_OUTPUT - name: capture build artifacts uses: actions/upload-artifact@v4.3.3 with: name: "${{ steps.properties.outputs.mod_name }} ${{ steps.version.outputs.version }}" - path: | - fabric/build/libs/${{ steps.properties.outputs.mod_id }}-fabric-${{ steps.version.outputs.version }}.jar - forge/build/libs/${{ steps.properties.outputs.mod_id }}-forge-${{ steps.version.outputs.version }}.jar - neoforge/build/libs/${{ steps.properties.outputs.mod_id }}-neoforge-${{ steps.version.outputs.version }}.jar + path: build/libs/${{ steps.properties.outputs.mod_id }}-neoforge-${{ steps.version.outputs.version }}.jar + + - name: gametest + uses: Anvil-Dev/dedicated-server-launch-test@1.21.1-neoforge + with: + mod: build/libs/${{ steps.properties.outputs.mod_id }}-neoforge-${{ steps.version.outputs.version }}.jar + extra-mods: patchouli:1.21-87-neoforge cloth-config:15.0.140+neoforge diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6071f14..94bfef8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,22 +1,23 @@ name: Upload Release Asset on: + workflow_dispatch: release: types: [ published ] jobs: build: permissions: write-all + runs-on: ubuntu-latest env: CI_BUILD: false PR_BUILD: false VERSION_TYPE: ${{ github.event.release.prerelease && 'alpha' || 'release' }} - runs-on: ubuntu-latest steps: - name: checkout uses: actions/checkout@v4 - name: validate gradle wrapper - uses: gradle/wrapper-validation-action@v1 + uses: gradle/actions/wrapper-validation@v3 - name: Read Properties id: 'properties' @@ -44,25 +45,14 @@ jobs: - name: Get Version id: version run: | - MESSAGE=$(ls forge/build/libs/* | grep sources.jar -v | grep shadow.jar -v | grep slim.jar -v | awk -F '${{ steps.properties.outputs.mod_id }}-forge-|.jar' '{print $2}') + MESSAGE=$(ls build/libs/* | grep sources.jar -v | grep shadow.jar -v | grep slim.jar -v | awk -F '${{ steps.properties.outputs.mod_id }}-neoforge-|.jar' '{print $2}') echo "version=$MESSAGE" >> $GITHUB_OUTPUT - name: capture build artifacts - uses: actions/upload-artifact@v3.1.1 + uses: actions/upload-artifact@v4.3.3 with: name: "${{ steps.properties.outputs.mod_name }} ${{ steps.version.outputs.version }}" - path: | - fabric/build/libs/${{ steps.properties.outputs.mod_id }}-fabric-${{ steps.version.outputs.version }}.jar - forge/build/libs/${{ steps.properties.outputs.mod_id }}-forge-${{ steps.version.outputs.version }}.jar - neoforge/build/libs/${{ steps.properties.outputs.mod_id }}-neoforge-${{ steps.version.outputs.version }}.jar - - - name: Upload Release Jar - uses: softprops/action-gh-release@v0.1.15 - with: - files: | - fabric/build/libs/${{ steps.properties.outputs.mod_id }}-fabric-${{ steps.version.outputs.version }}.jar - forge/build/libs/${{ steps.properties.outputs.mod_id }}-forge-${{ steps.version.outputs.version }}.jar - neoforge/build/libs/${{ steps.properties.outputs.mod_id }}-neoforge-${{ steps.version.outputs.version }}.jar + path: build/libs/${{ steps.properties.outputs.mod_id }}-neoforge-${{ steps.version.outputs.version }}.jar - name: Publish to maven run: ./gradlew publish @@ -71,50 +61,26 @@ jobs: MAVEN_USERNAME: ${{ secrets.MAVEN_USER }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASS }} continue-on-error: true -# -# - name: publish forge mc mod -# uses: Kir-Antipov/mc-publish@v3.3 -# continue-on-error: true -# with: -# name: "${{ steps.properties.outputs.mod_name }} For Forge v${{ steps.version.outputs.version }}" -# version: ${{ steps.version.outputs.version }} -# game-versions: 1.20.1 -# version-type: ${{ env.VERSION_TYPE }} -# java: 17 -# fail-mode: skip -# changelog: ${{ github.event.release.body }} -# -# modrinth-id: "****" -# modrinth-token: ${{ secrets.MODRINTH_TOKEN }} -# modrinth-featured: true -# -# curseforge-id: "****" -# curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} -# -# files: | -# forge/build/libs/${{ steps.properties.outputs.mod_id }}-forge-${{ steps.version.outputs.version }}.jar -# forge/build/libs/${{ steps.properties.outputs.mod_id }}-forge-${{ steps.version.outputs.version }}-sources.jar -# -# -# - name: publish fabric mc mod + +# - name: publish neoforge mc mod # uses: Kir-Antipov/mc-publish@v3.3 # continue-on-error: true # with: -# name: "${{ steps.properties.outputs.mod_name }} For Fabric v${{ steps.version.outputs.version }}" +# name: "${{ steps.properties.outputs.mod_name }} For NeoForge v${{ steps.version.outputs.version }}" # version: ${{ steps.version.outputs.version }} -# game-versions: 1.20.1 +# game-versions: 1.21.1 # version-type: ${{ env.VERSION_TYPE }} -# java: 17 +# java: 21 # fail-mode: skip # changelog: ${{ github.event.release.body }} # -# modrinth-id: "****" +# modrinth-id: ${{ steps.properties.outputs.modrinth_id }} # modrinth-token: ${{ secrets.MODRINTH_TOKEN }} # modrinth-featured: true # -# curseforge-id: "****" +# curseforge-id: ${{ steps.properties.outputs.curseforge_id }} # curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} # # files: | -# fabric/build/libs/${{ steps.properties.outputs.mod_id }}-fabric-${{ steps.version.outputs.version }}.jar -# fabric/build/libs/${{ steps.properties.outputs.mod_id }}-fabric-${{ steps.version.outputs.version }}-sources.jar +# build/libs/${{ steps.version.properties.mod_id }}-neoforge-${{ steps.version.outputs.version }}.jar +# build/libs/${{ steps.version.properties.mod_id }}-neoforge-${{ steps.version.outputs.version }}-sources.jar diff --git a/build.gradle b/build.gradle index 818b1d8..60b2aa6 100644 --- a/build.gradle +++ b/build.gradle @@ -20,10 +20,6 @@ repositories { mavenLocal() } -base { - archivesName = mod_id -} - java.toolchain.languageVersion = JavaLanguageVersion.of(21) neoForge { diff --git a/gradle.properties b/gradle.properties index adca36f..babec7a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,19 +8,19 @@ org.gradle.configuration-cache=true ## Environment Properties # You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge # The Minecraft version must agree with the Neo version to get a valid artifact -minecraft_version=1.21.0 +minecraft_version=1.21.1 # The Minecraft version range can use any release version of Minecraft as bounds. # Snapshots, pre-releases, and release candidates are not guaranteed to sort properly # as they do not follow standard versioning conventions. -minecraft_version_range=[1.21.0,1.22) +minecraft_version_range=[1.21.1,1.22) # The Neo version must agree with the Minecraft version to get a valid artifact -neo_version=21.0.167 +neo_version=21.1.79 # The Neo version range can use any version of Neo as bounds neo_version_range=[21,) # The loader version range can only use the major version of FML as bounds loader_version_range=[4,) -parchment_minecraft_version=1.21 -parchment_mappings_version=2024.07.28 +parchment_minecraft_version=1.21.1 +parchment_mappings_version=2024.11.17 ## Mod Properties # The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63} # Must match the String constant located in the main mod class annotated with @Mod. diff --git a/settings.gradle b/settings.gradle index ada876e..12032e3 100644 --- a/settings.gradle +++ b/settings.gradle @@ -9,3 +9,5 @@ pluginManagement { plugins { id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0' } + +rootProject.name = mod_id + "-neoforge" + "-" + minecraft_version