From 8d38d702b6ff7691defcfbf88e2dea340dab6ddb Mon Sep 17 00:00:00 2001 From: TexTrue <65154269+TexBlock@users.noreply.github.com> Date: Sun, 4 Feb 2024 11:57:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A8=A1=E7=BB=84=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8F=91=E5=B8=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 38 ++++++++++++++++++++++++ CHANGELOG.md | 0 build.gradle | 37 ++++++++++++++++++++++- gradle.properties | 6 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- 5 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..e184d7d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,38 @@ +name: Publish Release + +on: + workflow_dispatch: + release: + types: + - published + +permissions: + contents: write + +jobs: + Build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 20 + uses: actions/setup-java@v3 + with: + distribution: 'adopt' + java-version: 20 + - name: Cache + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + .gradle + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }} + - uses: gradle/wrapper-validation-action@v1 + - run: | + chmod +x gradlew + ./gradlew mergeJars publishMods --stacktrace -Porg.gradle.parallel.threads=4 + env: + CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/build.gradle b/build.gradle index ca6f0be..7c21ccc 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,8 @@ plugins { id "architectury-plugin" version "3.4-SNAPSHOT" id "io.github.pacifistmc.forgix" version "1.2.6" - id "dev.architectury.loom" version "1.3-SNAPSHOT" apply false + id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false + id "me.modmuss50.mod-publish-plugin" version "0.4.5" } architectury { @@ -59,3 +60,37 @@ forgix { jarLocation = "build/libs/${rootProject.archives_base_name}-fabric-${ rootProject.version }.jar" } } + +publishMods { + file = file(forgix.getOutputDir() + "/" + forgix.getMergedJarName()) + changelog = file("CHANGELOG.md").getText('UTF-8') + type = STABLE + modLoaders = ["fabric", "forge"] + + var CURSEFORGE_TOKEN = project.findProperty("CURSEFORGE_TOKEN") ?: System.getenv("CURSEFORGE_TOKEN") + if (CURSEFORGE_TOKEN != null) { + curseforge { + projectId = rootProject.curseforge_id + accessToken = providers.environmentVariable(CURSEFORGE_TOKEN as Provider) + minecraftVersions = ["1.16.4", "1.16.5"] + + requires { + slug = "architectury-api" + } + } + } + + + var MODRINTH_TOKEN = project.findProperty("MODRINTH_TOKEN") ?: System.getenv("MODRINTH_TOKEN") + if (MODRINTH_TOKEN != null) { + modrinth { + projectId = rootProject.modrinth_id + accessToken = providers.environmentVariable(MODRINTH_TOKEN as Provider) + minecraftVersions = ["1.16.4", "1.16.5"] + } + + requires { + slug = "architectury-api" + } + } +} diff --git a/gradle.properties b/gradle.properties index 33f25bb..2cca30a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,11 +2,10 @@ org.gradle.jvmargs=-Xmx2048M minecraft_version=1.16.5 enabled_platforms=fabric,forge - yarn_mappings=1.16.5+build.10 archives_base_name=VMTranslationUpdate -mod_version=2.3 +mod_version=2.4 maven_group=top.vmctcn architectury_version=1.32.68 @@ -17,3 +16,6 @@ fabric_loader_version=0.14.9 fabric_api_version=0.42.0+1.16 forge_version=1.16.5-36.2.41 + +curseforge_id=890229 +modrinth_id=wvCSIW08 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fae0804..e411586 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists