Skip to content

Commit

Permalink
Setup publishing to Forge maven, bump ASM
Browse files Browse the repository at this point in the history
  • Loading branch information
PaintNinja committed May 9, 2024
1 parent 2f35deb commit 9b7e884
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 67 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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 }}

21 changes: 0 additions & 21 deletions .github/workflows/release.yml

This file was deleted.

91 changes: 52 additions & 39 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -462,7 +470,7 @@ ext.excludePomDeps = [

publishing {
publications {
developer(MavenPublication) { publication ->
register('developer', MavenPublication) { publication ->
groupId project.group
artifactId project.archivesBaseName
version project.version
Expand Down Expand Up @@ -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'
}
}

Expand All @@ -540,6 +548,11 @@ publishing {
}

repositories {
maven {
name = 'Forge'
url = 'https://maven.minecraftforge.net'
}

if (ENV.MAVEN_URL) {
maven {
url ENV.MAVEN_URL
Expand All @@ -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
//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
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 0 additions & 4 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
pluginManagement {
repositories {
gradlePluginPortal()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
}
}

Expand Down

0 comments on commit 9b7e884

Please sign in to comment.