From 9b7e884093e9b4a278a0a743938fd0f12cbff219 Mon Sep 17 00:00:00 2001 From: Paint_Ninja Date: Thu, 9 May 2024 19:05:18 +0100 Subject: [PATCH] Setup publishing to Forge maven, bump ASM --- .github/workflows/build.yml | 4 +- .github/workflows/publish.yml | 22 +++++++++ .github/workflows/release.yml | 21 -------- build.gradle | 91 ++++++++++++++++++++--------------- gradle.properties | 2 +- settings.gradle | 4 -- 6 files changed, 77 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0d36769d9..b1514501f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,6 @@ jobs: image: openjdk:${{ matrix.java }} options: --user root steps: - - uses: actions/checkout@v1 - - uses: gradle/wrapper-validation-action@v1 + - uses: actions/checkout@v4 + - uses: gradle/actions/wrapper-validation@v3 - run: ./gradlew build publishToMavenLocal --stacktrace \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..97b5c5a51 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,22 @@ +name: Publish + +on: workflow_dispatch # manual trigger + +permissions: + contents: read + +jobs: + build: + uses: MinecraftForge/SharedActions/.github/workflows/gradle.yml@main + with: + java: 17 + gradle_tasks: "publish" + artifact_name: "mixin" + secrets: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + PROMOTE_ARTIFACT_WEBHOOK: ${{ secrets.PROMOTE_ARTIFACT_WEBHOOK }} + PROMOTE_ARTIFACT_USERNAME: ${{ secrets.PROMOTE_ARTIFACT_USERNAME }} + PROMOTE_ARTIFACT_PASSWORD: ${{ secrets.PROMOTE_ARTIFACT_PASSWORD }} + MAVEN_USER: ${{ secrets.MAVEN_USER }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 319e54748..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Release -on: [workflow_dispatch] # Manual trigger -jobs: - build: - runs-on: ubuntu-20.04 - container: - image: openjdk:17-jdk - options: --user root - steps: - - uses: actions/checkout@v1 - - uses: gradle/wrapper-validation-action@v1 - - run: ./gradlew checkVersion build publish --stacktrace - env: - MAVEN_URL: ${{ secrets.MAVEN_URL }} - MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} - MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} - MAVEN_CENTRAL_URL: ${{ secrets.MAVEN_CENTRAL_URL }} - MAVEN_CENTRAL_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }} - MAVEN_CENTRAL_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }} - SIGNING_SERVER: ${{ secrets.SIGNING_SERVER }} - SIGNING_PGP_KEY: ${{ secrets.SIGNING_PGP_KEY }} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 5ad8caa5a..d78ded49d 100644 --- a/build.gradle +++ b/build.gradle @@ -11,9 +11,9 @@ buildscript { } } -plugins { - id "me.modmuss50.remotesign" version "0.4.0" -} +//plugins { +// id "me.modmuss50.remotesign" version "0.4.0" +//} import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar @@ -31,15 +31,15 @@ apply plugin: 'potemkin-modules' defaultTasks 'licenseFormat', 'check', 'build' // Basic project information -group = 'net.fabricmc' -archivesBaseName = 'sponge-mixin' +group = 'net.minecraftforge' +archivesBaseName = 'mixins' version = buildVersion + "+mixin." + upstreamMixinVersion def ENV = System.getenv() -if (!ENV.CI) { - version = version + "-local" -} +//if (!ENV.CI) { +// version = version + "-local" +//} // Extended project information ext.projectName = 'Mixin' @@ -65,9 +65,17 @@ repositories { name = 'minecraft' url = 'https://libraries.minecraft.net/' } +// maven { +// name = 'Fabric' +// url = 'https://maven.fabricmc.net/' +// } maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net/' + // For fernflower + name = 'sponge' + url = 'https://repo.spongepowered.org/maven' + content { + includeGroup 'org.jetbrains' + } } maven { // For modlauncher @@ -462,7 +470,7 @@ ext.excludePomDeps = [ publishing { publications { - developer(MavenPublication) { publication -> + register('developer', MavenPublication) { publication -> groupId project.group artifactId project.archivesBaseName version project.version @@ -498,25 +506,25 @@ publishing { } pom { - name = "Fabric Mixin" - description = 'Fabric Mixin is a trait/mixin and bytecode weaving framework for Java using ASM.' - url = 'https://github.com/FabricMC/Mixin' + name = "Mixin" + description = 'Mixin is a trait/mixin and bytecode weaving framework for Java using ASM.' + url = 'https://github.com/MinecraftForge/Mixin' scm { - connection = "scm:git:https://github.com/FabricMC/Mixin.git" - developerConnection = "scm:git:git@github.com:FabricMC/Mixin.git" - url = "https://github.com/FabricMC/Mixin" + connection = "scm:git:https://github.com/MinecraftForge/Mixin.git" + developerConnection = "scm:git:git@github.com:MinecraftForge/Mixin.git" + url = "https://github.com/MinecraftForge/Mixin" } issueManagement { system = "GitHub" - url = "https://github.com/FabricMC/Mixin/issues" + url = "https://github.com/MinecraftForge/Mixin/issues" } licenses { license { name = 'The MIT License' - url = 'https://raw.githubusercontent.com/FabricMC/Mixin/main/LICENSE.txt' + url = 'https://raw.githubusercontent.com/MinecraftForge/Mixin/main/LICENSE.txt' } } @@ -540,6 +548,11 @@ publishing { } repositories { + maven { + name = 'Forge' + url = 'https://maven.minecraftforge.net' + } + if (ENV.MAVEN_URL) { maven { url ENV.MAVEN_URL @@ -563,23 +576,23 @@ publishing { } } -remoteSign { - requestUrl = ENV.SIGNING_SERVER - pgpAuthKey = ENV.SIGNING_PGP_KEY - useDummyForTesting = ENV.SIGNING_SERVER == null - sign publishing.publications.developer -} - -// A task to ensure that the version being released has not already been released. -task checkVersion { - doFirst { - def xml = new URL("https://maven.fabricmc.net/net/fabricmc/sponge-mixin/maven-metadata.xml").text - def metadata = new XmlSlurper().parseText(xml) - def versions = metadata.versioning.versions.version*.text(); - if (versions.contains(version)) { - throw new RuntimeException("${version} has already been released!") - } - } -} - -publish.mustRunAfter checkVersion \ No newline at end of file +//remoteSign { +// requestUrl = ENV.SIGNING_SERVER +// pgpAuthKey = ENV.SIGNING_PGP_KEY +// useDummyForTesting = ENV.SIGNING_SERVER == null +// sign publishing.publications.developer +//} +// +//// A task to ensure that the version being released has not already been released. +//task checkVersion { +// doFirst { +// def xml = new URL("https://maven.fabricmc.net/net/fabricmc/sponge-mixin/maven-metadata.xml").text +// def metadata = new XmlSlurper().parseText(xml) +// def versions = metadata.versioning.versions.version*.text(); +// if (versions.contains(version)) { +// throw new RuntimeException("${version} has already been released!") +// } +// } +//} +// +//publish.mustRunAfter checkVersion \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 30cc75f30..76197672e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ organization=FabricMC buildVersion=0.13.4 upstreamMixinVersion=0.8.5 buildType=RELEASE -asmVersion=9.6 +asmVersion=9.7 legacyForgeAsmVersion=5.0.3 modlauncherAsmVersion=9.1 modlauncherVersion=9.0.7 diff --git a/settings.gradle b/settings.gradle index 5ba47c529..d5a8b8dae 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,10 +1,6 @@ pluginManagement { repositories { gradlePluginPortal() - maven { - name = 'Fabric' - url = 'https://maven.fabricmc.net/' - } } }