diff --git a/.github/workflows/release-all.yml b/.github/workflows/release-all.yml new file mode 100644 index 0000000..554105c --- /dev/null +++ b/.github/workflows/release-all.yml @@ -0,0 +1,31 @@ +name: Release All +on: [workflow_dispatch] + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Setup JDK 21 + uses: actions/setup-java@v2 + with: + java-version: '21' + distribution: temurin + cache: gradle + + - name: Validate Gradle Wrapper Integrity + uses: gradle/wrapper-validation-action@v1 + + - name: Make Gradle wrapper executable + run: chmod +x ./gradlew + + - name: Build & Release + env: + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} + run: ./gradlew build :neoforge:publishMods :fabric:publishMods diff --git a/.github/workflows/release-fabric-quilt.yml b/.github/workflows/release-fabric-quilt.yml new file mode 100644 index 0000000..fc142ba --- /dev/null +++ b/.github/workflows/release-fabric-quilt.yml @@ -0,0 +1,31 @@ +name: Release Fabric & Quilt +on: [workflow_dispatch] + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Setup JDK 21 + uses: actions/setup-java@v2 + with: + java-version: '21' + distribution: temurin + cache: gradle + + - name: Validate Gradle Wrapper Integrity + uses: gradle/wrapper-validation-action@v1 + + - name: Make Gradle wrapper executable + run: chmod +x ./gradlew + + - name: Build & Release + env: + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} + run: ./gradlew build :fabric:publishMods diff --git a/.github/workflows/release-neoforge.yml b/.github/workflows/release-neoforge.yml new file mode 100644 index 0000000..a92fc46 --- /dev/null +++ b/.github/workflows/release-neoforge.yml @@ -0,0 +1,31 @@ +name: Release Neoforge +on: [workflow_dispatch] + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Setup JDK 21 + uses: actions/setup-java@v2 + with: + java-version: '21' + distribution: temurin + cache: gradle + + - name: Validate Gradle Wrapper Integrity + uses: gradle/wrapper-validation-action@v1 + + - name: Make Gradle wrapper executable + run: chmod +x ./gradlew + + - name: Build & Release + env: + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} + CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} + run: ./gradlew build :neoforge:publishMods diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index d7f78db..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: Release -on: [workflow_dispatch] - -permissions: - contents: write - -env: - MINECRAFT_VERSION: 1.21.1 - JAVA_VERSION: 21 - VERSION: 2.1.0 - MODRINTH_ID: k7kuEnwe - CURSEFORGE_ID: 544990 - -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Checkout Repository - uses: actions/checkout@v3 - with: - submodules: true - - - name: Setup Java - uses: actions/setup-java@v2 - with: - distribution: "temurin" - java-version: 21 - - - name: Make Gradle Wrapper Executable - if: ${{ runner.os != 'Windows' }} - run: chmod +x ./gradlew - - - name: Build - run: ./gradlew build - - - name: Publish NeoForge to CurseForge - uses: Kir-Antipov/mc-publish@v3.3 - with: - # CurseForge - curseforge-id: ${{ env.CURSEFORGE_ID }} - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - - # Config - name: "[NeoForge] Homing Ender Eye ${{ env.VERSION }} for ${{ env.MINECRAFT_VERSION }}" - version: ${{ env.VERSION }} - version-type: release - changelog-file: changelog/${{ env.VERSION }}.md - files: neoforge/build/libs/*-${{ env.VERSION }}!(-@(dev|sources|slim|shadow)).jar - - loaders: | - neoforge - game-versions: | - ${{ env.MINECRAFT_VERSION }} - java: | - ${{ env.JAVA_VERSION }} - retry-attempts: 2 - retry-delay: 10000 - - - name: Publish Fabric/Quilt to CurseForge - uses: Kir-Antipov/mc-publish@v3.3 - with: - # CurseForge - curseforge-id: ${{ env.CURSEFORGE_ID }} - curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }} - - # Config - name: "[Fabric/Quilt] Homing Ender Eye ${{ env.VERSION }} for ${{ env.MINECRAFT_VERSION }}" - version: ${{ env.VERSION }} - version-type: release - changelog-file: changelog/${{ env.VERSION }}.md - files: fabric/build/libs/*-${{ env.VERSION }}!(-@(dev|sources|slim|shadow)).jar - - loaders: | - fabric - quilt - game-versions: | - ${{ env.MINECRAFT_VERSION }} - dependencies: | - cloth-config(required) - modmenu(optional) - java: | - ${{ env.JAVA_VERSION }} - retry-attempts: 2 - retry-delay: 10000 - - - name: Publish NeoForge to Modrinth - uses: Kir-Antipov/mc-publish@v3.3 - with: - # Modrinth - modrinth-id: ${{ env.MODRINTH_ID }} - modrinth-featured: true - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - - # Config - name: "Homing Ender Eye ${{ env.VERSION }} for ${{ env.MINECRAFT_VERSION }}" - version: ${{ env.VERSION }} - version-type: release - changelog-file: changelog/${{ env.VERSION }}.md - files: neoforge/build/libs/*-${{ env.VERSION }}!(-@(dev|sources|slim|shadow)).jar - - loaders: | - neoforge - game-versions: | - ${{ env.MINECRAFT_VERSION }} - java: | - ${{ env.JAVA_VERSION }} - retry-attempts: 2 - retry-delay: 10000 - - - name: Publish Fabric/Quilt to Modrinth - uses: Kir-Antipov/mc-publish@v3.3 - with: - # Modrinth - modrinth-id: ${{ env.MODRINTH_ID }} - modrinth-featured: true - modrinth-token: ${{ secrets.MODRINTH_TOKEN }} - - # Config - name: "Homing Ender Eye ${{ env.VERSION }} for ${{ env.MINECRAFT_VERSION }}" - version: ${{ env.VERSION }} - version-type: release - changelog-file: changelog/${{ env.VERSION }}.md - files: fabric/build/libs/*-${{ env.VERSION }}!(-@(dev|sources|slim|shadow)).jar - - loaders: | - fabric - quilt - game-versions: | - ${{ env.MINECRAFT_VERSION }} - dependencies: | - cloth-config(required) - modmenu(optional) - java: | - ${{ env.JAVA_VERSION }} - retry-attempts: 2 - retry-delay: 10000 diff --git a/build.gradle b/build.gradle index db2dad2..bbe20ee 100644 --- a/build.gradle +++ b/build.gradle @@ -2,6 +2,7 @@ plugins { id "architectury-plugin" version "3.4-SNAPSHOT" id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false id 'com.github.johnrengelman.shadow' version '8.1.1' apply false + id "me.modmuss50.mod-publish-plugin" version "0.7.4" } diff --git a/fabric/build.gradle b/fabric/build.gradle index 56b3df6..357698f 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,5 +1,6 @@ plugins { id "com.github.johnrengelman.shadow" + id "me.modmuss50.mod-publish-plugin" } @@ -91,3 +92,26 @@ publishing { // Add repositories to publish to here. } } + +publishMods { + file = tasks.remapJar.archiveFile + changelog = rootProject.file("changelog/${mod_version}.md").text + version = mod_version + type = STABLE + displayName = "[Fabric/Quilt] Homing Ender Eye ${mod_version} for ${minecraft_version}" + modLoaders.add("fabric") + modLoaders.add("quilt") + + curseforge { + projectId = "544990" + accessToken = providers.environmentVariable("CURSEFORGE_TOKEN") + minecraftVersions.add(minecraft_version) + } + + modrinth { + projectId = "k7kuEnwe" + accessToken = providers.environmentVariable("MODRINTH_TOKEN") + minecraftVersions.add(minecraft_version) + } +} + diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 62f6d27..8792d54 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -1,5 +1,6 @@ plugins { id 'com.github.johnrengelman.shadow' + id "me.modmuss50.mod-publish-plugin" } architectury { @@ -64,3 +65,25 @@ remapJar { input.set shadowJar.archiveFile } + +publishMods { + file = tasks.remapJar.archiveFile + changelog = rootProject.file("changelog/${mod_version}.md").text + version = mod_version + type = STABLE + displayName = "[NeoForge] Homing Ender Eye ${mod_version} for ${minecraft_version}" + modLoaders.add("neoforge") + + curseforge { + projectId = "544990" + accessToken = providers.environmentVariable("CURSEFORGE_TOKEN") + minecraftVersions.add(minecraft_version) + } + + modrinth { + projectId = "k7kuEnwe" + accessToken = providers.environmentVariable("MODRINTH_TOKEN") + minecraftVersions.add(minecraft_version) + } +} +