Skip to content

Commit

Permalink
jitpack
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Feb 2, 2024
1 parent 3b1f2be commit ddab163
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 2 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build

on: [ pull_request, push, workflow_dispatch ]

jobs:
Build:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v3
- name: Get github short hash
id: github_short_hash
run: echo "result=$(git rev-parse --short "${{ github.sha }}")" >> $GITHUB_OUTPUT
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }}
- name: Build with Gradle
run: |
chmod +x gradlew
./gradlew build
- name: Upload artifacts (fabric)
uses: actions/upload-artifact@v3
with:
name: Artifacts-fabric
path: ${{ github.workspace }}/fabric/build/libs
- name: Upload artifacts (neoforge)
uses: actions/upload-artifact@v3
with:
name: Artifacts-neoforge
path: ${{ github.workspace }}/neoforge/build/libs
7 changes: 6 additions & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ dependencies {
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
modApi "dev.architectury:architectury-fabric:${rootProject.architectury_version}"

implementation(shadowCommon("org.quiltmc:quilt-config:${rootProject.quiltconfig_version}"))
shadowCommon "org.quiltmc:quilt-config:${rootProject.quiltconfig_version}"
shadowCommon "org.quiltmc.parsers:json:${project.quiltparsers_version}"
shadowCommon "com.electronwill.night-config:core:${rootProject.nightconfig_version}"
shadowCommon "com.electronwill.night-config:toml:${rootProject.nightconfig_version}"

common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
Expand All @@ -38,6 +41,8 @@ shadowJar {
exclude "architectury.common.json"

relocate "org.quiltmc.config", "${rootProject.maven_group}.shadow.quiltconfig"
relocate "org.quiltmc.parsers", "${rootProject.maven_group}.shadow.quiltparsers"
relocate "com.electronwill.nightconfig", "${rootProject.maven_group}.shadow.nightconfig"

configurations = [project.configurations.shadowCommon]
archiveClassifier.set("dev-shadow")
Expand Down
5 changes: 5 additions & 0 deletions jitpack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
jdk:
- openjdk18
before_install:
- sdk install java 18-open
- sdk use java 18-open
4 changes: 3 additions & 1 deletion neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ dependencies {
neoForge "net.neoforged:neoforge:${rootProject.neoforge_version}"
modApi "dev.architectury:architectury-neoforge:${rootProject.architectury_version}"

implementation(shadowCommon("org.quiltmc:quilt-config:${rootProject.quiltconfig_version}"))
shadowCommon "org.quiltmc:quilt-config:${rootProject.quiltconfig_version}"
shadowCommon "org.quiltmc.parsers:json:${project.quiltparsers_version}"

common(project(path: ":common", configuration: "namedElements")) { transitive false }
shadowCommon(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive = false }
Expand All @@ -42,6 +43,7 @@ shadowJar {
exclude "architectury.common.json"

relocate "org.quiltmc.config", "${rootProject.maven_group}.shadow.quiltconfig"
relocate "org.quiltmc.parsers", "${rootProject.maven_group}.shadow.quiltparsers"

configurations = [project.configurations.shadowCommon]
archiveClassifier.set("dev-shadow")
Expand Down

0 comments on commit ddab163

Please sign in to comment.