-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a dedicated GitHub maven repository
- Loading branch information
1 parent
898ae64
commit 4940502
Showing
12 changed files
with
217 additions
and
131 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,53 @@ | ||
name: Deployment | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.repository == 'GlennFolker/glTFrenzy' }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v4 | ||
with: | ||
java-version: 17 | ||
distribution: temurin | ||
- name: Setup Gradle | ||
uses: gradle/actions/setup-gradle@v4 | ||
- name: Set Artifact Version | ||
run: | | ||
if [ "${GITHUB_REF_TYPE}" = "tag" ]; then | ||
# This is a release, so use the release's tag as the version. | ||
echo "ARTIFACT_VERSION=${GITHUB_REF_NAME}" >> $GITHUB_ENV | ||
elif [ "${GITHUB_REF_TYPE}" = "branch" ] && [ "${GITHUB_REF_NAME}" = "main" ]; then | ||
# This is a bleeding-edge, so use the short commit's hash as the version. | ||
echo "ARTIFACT_VERSION=$(git rev-parse --short=10 HEAD)" >> $GITHUB_ENV | ||
else | ||
# Sanity checks. | ||
echo "Error: Unsupported branch '${GITHUB_REF_NAME}' or ref type '${GITHUB_REF_TYPE}'" >&2 | ||
exit 1 | ||
fi | ||
- name: Publish Artifacts | ||
run: | | ||
chmod +x gradlew | ||
./gradlew -P version="${ARTIFACT_VERSION}" -D maven.repo.local="$(pwd)/.out" publishToMavenLocal | ||
git clone https://${{ secrets.MAVEN_TOKEN_GITHUB }}@github.com/GlennFolker/glTFrenzyMaven.git --depth=1 ../glTFrenzyMaven | ||
cp -r .out/* ../glTFrenzyMaven | ||
cd ../glTFrenzyMaven | ||
git config user.name "GitHub Actions" | ||
git config user.email "actions@github.com" | ||
git add . | ||
git commit -m "Publishing for ${ARTIFACT_VERSION}" | ||
git push https://${{ secrets.MAVEN_TOKEN_GITHUB }}@github.com/GlennFolker/glTFrenzyMaven.git |
This file was deleted.
Oops, something went wrong.
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,147 @@ | ||
import java.io.* | ||
|
||
plugins{ | ||
`java-library` | ||
`maven-publish` | ||
} | ||
|
||
val arcVersion: String by project | ||
val mindustryVersion: String by project | ||
val entVersion: String by project | ||
val javapoetVersion: String by project | ||
|
||
fun arc(module: String): String{ | ||
return "com.github.Anuken.Arc$module:$arcVersion" | ||
} | ||
|
||
fun mindustry(module: String): String{ | ||
return "com.github.Anuken.Mindustry$module:$mindustryVersion" | ||
} | ||
|
||
fun entity(module: String): String{ | ||
return "com.github.GlennFolker.EntityAnno$module:$entVersion" | ||
} | ||
|
||
fun javapoet(): String{ | ||
return "com.squareup:javapoet:$javapoetVersion" | ||
} | ||
|
||
allprojects{ | ||
apply(plugin = "java-library") | ||
|
||
sourceSets["main"].java.setSrcDirs(listOf(layout.projectDirectory.file("src"))) | ||
dependencies{ | ||
annotationProcessor(entity(":downgrader")) | ||
} | ||
|
||
repositories{ | ||
mavenCentral() | ||
maven("https://oss.sonatype.org/content/repositories/snapshots/") | ||
maven("https://oss.sonatype.org/content/repositories/releases/") | ||
maven("https://raw.githubusercontent.com/GlennFolker/EntityAnnoMaven/main") | ||
|
||
maven("https://raw.githubusercontent.com/Zelaux/MindustryRepo/master/repository") | ||
maven("https://jitpack.io") | ||
} | ||
} | ||
|
||
project(":annotations"){ | ||
sourceSets["main"].resources.setSrcDirs(listOf(layout.projectDirectory.file("assets"))) | ||
|
||
dependencies{ | ||
implementation(arc(":arc-core")) | ||
implementation(arc(":g3d")) | ||
implementation(javapoet()) | ||
} | ||
|
||
tasks.withType<JavaCompile>().configureEach{ | ||
options.apply{ | ||
isIncremental = true | ||
encoding = "UTF-8" | ||
compilerArgs.add("-Xlint:-options") | ||
} | ||
|
||
sourceCompatibility = "17" | ||
targetCompatibility = "8" | ||
|
||
doFirst{ | ||
sourceCompatibility = "8" | ||
} | ||
} | ||
} | ||
|
||
project(":"){ | ||
apply(plugin = "maven-publish") | ||
|
||
group = "com.github.GlennFolker" | ||
|
||
java{ | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
dependencies{ | ||
annotationProcessor(project(":annotations")) | ||
compileOnly(project(":annotations")) | ||
|
||
compileOnlyApi(arc(":arc-core")) | ||
compileOnlyApi(arc(":g3d")) | ||
} | ||
|
||
tasks.withType<Jar>().configureEach{ | ||
exclude("gltfrenzy/spec/**") | ||
metaInf{ | ||
from(layout.projectDirectory.file("LICENSE")) | ||
} | ||
} | ||
|
||
tasks.withType<JavaCompile>().configureEach{ | ||
sourceCompatibility = "17" | ||
options.apply{ | ||
release = 8 | ||
compilerArgs.add("-Xlint:-options") | ||
|
||
isIncremental = true | ||
encoding = "UTF-8" | ||
} | ||
} | ||
|
||
tasks.withType<Javadoc>().configureEach{ | ||
options{ | ||
encoding = "UTF-8" | ||
|
||
val exports = (project.property("org.gradle.jvmargs") as String) | ||
.split(Regex("\\s+")) | ||
.filter{it.startsWith("--add-opens")} | ||
.map{"--add-exports ${it.substring("--add-opens=".length)}"} | ||
.reduce{accum, arg -> "$accum $arg"} | ||
|
||
val opts = File(temporaryDir, "exports.options") | ||
BufferedWriter(FileWriter(opts, Charsets.UTF_8, false)).use{it.write("-Xdoclint:none $exports")} | ||
optionFiles(opts) | ||
} | ||
} | ||
|
||
publishing.publications.register<MavenPublication>("maven"){ | ||
from(components["java"]) | ||
pom{ | ||
name = "glTFrenzy" | ||
description = "A glTF loader for Arc-based projects." | ||
url = "https://github.com/GlennFolker/glTFrenzy" | ||
inceptionYear = "2024" | ||
|
||
licenses{ | ||
license{ | ||
name = "GPL-3.0-or-later" | ||
url = "https://www.gnu.org/licenses/gpl-3.0.en.html" | ||
distribution = "repo" | ||
} | ||
} | ||
|
||
issueManagement{ | ||
system = "GitHub Issue Tracker" | ||
url = "https://github.com/GlennFolker/EntityAnno/issues" | ||
} | ||
} | ||
} | ||
} |
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
Binary file not shown.
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
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 |
---|---|---|
@@ -1,7 +1,2 @@ | ||
before_install: | ||
- sdk install java 17.0.10-tem | ||
- sdk use java 17.0.10-tem | ||
install: | ||
- chmod +x gradlew | ||
- ./gradlew publishToMavenLocal | ||
- echo -n > gradle.properties | ||
build: | ||
skip: true |
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
if(JavaVersion.current().ordinal < JavaVersion.VERSION_17.ordinal){ | ||
throw IllegalStateException("JDK 17 is a required minimum version. Yours: ${System.getProperty("java.version")}") | ||
} | ||
|
||
rootProject.name = "glTFrenzy" | ||
include(":annotations") |