-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
85 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: Upload Release Artifacts | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
env: | ||
TAG: ${{ github.ref_name }} | ||
BUILD_NUMBER: ${{ github.run_number }} | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'microsoft' | ||
java-version: 21 | ||
- name: Copy Maven Upload URL | ||
id: extract_maven_upload_url | ||
run: echo "maven_upload_url=${{ secrets.MAVEN_UPLOAD_URL }}" >> $GITHUB_OUTPUT | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x ./gradlew | ||
- name: Build with Gradle | ||
run: ./gradlew assemble --rerun-tasks | ||
- name: Maven Release | ||
if: steps.extract_maven_upload_url.outputs.maven_upload_url | ||
env: | ||
MAVEN_UPLOAD_URL: ${{ secrets.MAVEN_UPLOAD_URL }} | ||
MAVEN_UPLOAD_USERNAME: ${{ secrets.MAVEN_UPLOAD_USERNAME }} | ||
MAVEN_UPLOAD_PASSWORD: ${{ secrets.MAVEN_UPLOAD_PASSWORD }} | ||
run: ./gradlew publish | ||
- name: Publish | ||
id: publish_fabric | ||
uses: Kir-Antipov/mc-publish@995edadc13559a8b28d0b7e6571229f067ec7659 # (new) v3.3.0 | ||
with: | ||
github-token: ${{ github.token }} | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
version: ${{ env.TAG }}-Fabric | ||
files: | | ||
build/libs/!(*-@(dev|sources|javadoc|slim)).jar | ||
build/libs/*-@(sources|javadoc).jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,10 +3,19 @@ plugins { | |
alias libs.plugins.quilt.loom | ||
} | ||
|
||
base.archivesName = project.archives_base_name | ||
version = "${project.version}+${libs.versions.minecraft.get()}" | ||
def ENV = System.getenv() | ||
def now = new Date() | ||
|
||
version = ENV.TAG ?: "development-${now.format('YY.MMdd.HHmm', TimeZone.getTimeZone('UTC'))}+${libs.versions.minecraft.get()}${(!ENV.TAG && ENV.BUILD_NUMBER) ? "-build.${ENV.BUILD_NUMBER}" : ''}" | ||
group = project.maven_group | ||
|
||
// Minecraft 1.20.6 (24w14a) upwards uses Java 21. | ||
def javaVersion = 21 | ||
|
||
base { | ||
archivesName.set("${rootProject.name}-fabric") | ||
} | ||
|
||
sourceSets { | ||
testmod { | ||
compileClasspath += main.compileClasspath | ||
|
@@ -81,23 +90,26 @@ processResources { | |
} | ||
|
||
tasks.withType(JavaCompile).configureEach { | ||
// Minecraft 1.20.6 (24w14a) upwards uses Java 21. | ||
it.options.release.set(21) | ||
it.options.release.set(javaVersion) | ||
} | ||
|
||
java { | ||
// Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task if it is present. | ||
// If you remove this line, sources will not be generated. | ||
withSourcesJar() | ||
|
||
// If this mod is going to be a library, then it should also generate Javadocs in order to aid with developement. | ||
// If this mod is going to be a library, then it should also generate Javadocs in order to aid with development. | ||
// Uncomment this line to generate them. | ||
withJavadocJar() | ||
|
||
toolchain { | ||
languageVersion.set(JavaLanguageVersion.of(javaVersion)) | ||
} | ||
} | ||
|
||
jar { | ||
from('LICENSE') { | ||
rename { "${it}_${archivesBaseName}" } | ||
from('LICENSE*') { | ||
rename { "LICENSE_${rootProject.name}" } | ||
} | ||
} | ||
|
||
|
@@ -107,10 +119,12 @@ publishing { | |
mavenJava(MavenPublication) { | ||
from components.java | ||
|
||
artifactId = "${rootProject.name}-fabric" | ||
|
||
pom { | ||
name = 'LibZoomer' | ||
description = 'A library that allows other Minecraft mods to have powerful zooming easily.' | ||
url = 'https://github.com/EnnuiL/LibZoomer' | ||
url = 'https://github.com/Up-Mods/LibZoomer' | ||
licenses { | ||
license { | ||
name = 'The MIT License' | ||
|
@@ -124,9 +138,9 @@ publishing { | |
} | ||
} | ||
scm { | ||
connection = 'scm:git:https://github.com/EnnuiL/LibZoomer.git' | ||
developerConnection = 'scm:git:[email protected]:EnnuiL/LibZoomer.git' | ||
url = 'https://github.com/EnnuiL/LibZoomer' | ||
connection = 'scm:git:https://github.com/Up-Mods/LibZoomer.git' | ||
developerConnection = 'scm:git:[email protected]:Up-Mods/LibZoomer.git' | ||
url = 'https://github.com/Up-Mods/LibZoomer' | ||
} | ||
} | ||
} | ||
|
@@ -138,5 +152,14 @@ publishing { | |
// Notice: This block does NOT have the same function as the block in the top level. | ||
// The repositories here will be used for publishing your artifact, not for | ||
// retrieving dependencies. | ||
if (ENV.MAVEN_UPLOAD_URL) { | ||
maven { | ||
url = ENV.MAVEN_UPLOAD_URL | ||
credentials { | ||
username = ENV.MAVEN_UPLOAD_USERNAME | ||
password = ENV.MAVEN_UPLOAD_PASSWORD | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,5 @@ pluginManagement { | |
gradlePluginPortal() | ||
} | ||
} | ||
|
||
rootProject.name = 'libzoomer' |