diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..5245183 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,46 @@ +name: Build and Release (1.20) + +on: + push: + branches: + - "1.20/main" + +jobs: + build: + name: "Build and Release" + runs-on: ubuntu-20.04 + + permissions: + contents: write + steps: + - uses: actions/checkout@v2 + + - name: Set up JDK 17 + uses: actions/setup-java@v2 + with: + java-version: 17 + distribution: 'temurin' + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v1 + + - run: chmod +x gradlew + + - name: Build Version + uses: gradle/gradle-build-action@v2 + with: + arguments: build --stacktrace --no-daemon + + - name: Setting mod version + run: | + cat $GITHUB_WORKSPACE/gradle.properties | grep ^archives_base_name= >> $GITHUB_ENV + cat $GITHUB_WORKSPACE/gradle.properties | grep ^minecraft_version= >> $GITHUB_ENV + cat $GITHUB_WORKSPACE/gradle.properties | grep ^mod_version= >> $GITHUB_ENV + + - name: Publish to Maven + uses: gradle/gradle-build-action@v2 + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} + with: + arguments: publish --stacktrace --no-daemon \ No newline at end of file diff --git a/build.gradle b/build.gradle index 73b5a11..d25f542 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id "architectury-plugin" version "3.4-SNAPSHOT" - id "dev.architectury.loom" version "1.3-SNAPSHOT" apply false + id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false } architectury { @@ -29,7 +29,7 @@ allprojects { apply plugin: "maven-publish" archivesBaseName = rootProject.archives_base_name - version = "${rootProject.minecraft_version}-${rootProject.mod_version}" as Object + version = "${rootProject.mod_version}+${rootProject.minecraft_version}" as Object group = rootProject.maven_group repositories { diff --git a/common/build.gradle b/common/build.gradle index de24764..af64bd3 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -4,6 +4,10 @@ architectury { loom { accessWidenerPath = file("src/main/resources/palladiumcore.accesswidener") + + mixin { + defaultRefmapName = "palladiumcore-common-refmap.json" + } } dependencies { @@ -14,17 +18,17 @@ dependencies { publishing { publications { mavenCommon(MavenPublication) { - artifactId = rootProject.archives_base_name + artifactId = rootProject.archives_base_name + "-" + project.name from components.java } } repositories { maven { - url 'https://repo.repsy.io/mvn/lucraft/threetag' + url 'https://maven.threetag.net' credentials { - username System.getenv('REPSY_USERNAME') - password System.getenv('REPSY_PASSWORD') + username System.getenv('MAVEN_USERNAME') + password System.getenv('MAVEN_PASSWORD') } } } diff --git a/fabric/build.gradle b/fabric/build.gradle index 0f6ba46..c691cf8 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -9,6 +9,21 @@ architectury { loom { accessWidenerPath = project(":common").loom.accessWidenerPath + + runConfigs.configureEach { + if (name == "client") { + runDir = "../run" + + if (System.getenv('MC_USERNAME') && System.getenv('MC_UUID') && System.getenv('MC_ACCESS_TOKEN')) { + programArgs '--username', System.getenv('MC_USERNAME'), '--uuid', System.getenv('MC_UUID'), '--accessToken', System.getenv('MC_ACCESS_TOKEN') + } + } else if (name == "server") + runDir = "../run/server-fabric" + } + + mixin { + defaultRefmapName = "palladiumcore-fabric-refmap.json" + } } configurations { @@ -75,10 +90,10 @@ publishing { repositories { maven { - url 'https://repo.repsy.io/mvn/lucraft/threetag' + url 'https://maven.threetag.net' credentials { - username System.getenv('REPSY_USERNAME') - password System.getenv('REPSY_PASSWORD') + username System.getenv('MAVEN_USERNAME') + password System.getenv('MAVEN_PASSWORD') } } } diff --git a/forge/build.gradle b/forge/build.gradle index 5c1c48c..3e01c57 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -10,6 +10,20 @@ architectury { loom { accessWidenerPath = project(":common").loom.accessWidenerPath + runConfigs.configureEach { + if (name == "client") { + runDir = "../run" + + if (System.getenv('MC_USERNAME') && System.getenv('MC_UUID') && System.getenv('MC_ACCESS_TOKEN')) { + programArgs '--username', System.getenv('MC_USERNAME'), '--uuid', System.getenv('MC_UUID'), '--accessToken', System.getenv('MC_ACCESS_TOKEN') + } + } else if (name == "server") { + runDir = "../run/server-forge" + } else if (name == "data") { + programArgs '--existing', project(":common").file("src/main/resources/").absolutePath + } + } + forge { convertAccessWideners = true extraAccessWideners.add loom.accessWidenerPath.get().asFile.name @@ -17,6 +31,10 @@ loom { mixinConfig "palladiumcore-common.mixins.json" mixinConfig "palladiumcore.mixins.json" } + + mixin { + defaultRefmapName = "palladiumcore-forge-refmap.json" + } } configurations { @@ -64,6 +82,18 @@ remapJar { } jar { + manifest { + attributes([ + "Specification-Title" : project.mod_id, + "Specification-Vendor" : project.mod_author, + "Specification-Version" : "1", + "Implementation-Title" : project.name, + "Implementation-Version" : version, + "Implementation-Vendor" : project.mod_author, + "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") + ]) + } + archiveClassifier = "dev" } @@ -89,10 +119,10 @@ publishing { repositories { maven { - url 'https://repo.repsy.io/mvn/lucraft/threetag' + url 'https://maven.threetag.net' credentials { - username System.getenv('REPSY_USERNAME') - password System.getenv('REPSY_PASSWORD') + username System.getenv('MAVEN_USERNAME') + password System.getenv('MAVEN_PASSWORD') } } } diff --git a/gradle.properties b/gradle.properties index 40458b9..28779b9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,16 +1,23 @@ org.gradle.jvmargs=-Xmx2048M +# MC/Arch Settings minecraft_version=1.20.1 enabled_platforms=fabric,forge mappings=1.20.1:2023.09.03 -archives_base_name=PalladiumCore -mod_version=1.6.0.0 +# Mod Settings +archives_base_name=palladiumcore +mod_id=palladiumcore +mod_version=1.0.0 +mod_author=Lucraft maven_group=net.threetag +# Common Dependencies architectury_version=9.1.12 +# Fabric Dependencies fabric_loader_version=0.15.3 fabric_api_version=0.91.0+1.20.1 +# Forge Dependencies forge_version=1.20.1-47.1.84 \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 59bc51a..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-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle index 1cdf6f1..ad13360 100644 --- a/settings.gradle +++ b/settings.gradle @@ -11,4 +11,4 @@ include("common") include("fabric") include("forge") -rootProject.name = "PalladiumCore" +rootProject.name = "palladiumcore"