Skip to content

Commit

Permalink
skill issue fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysdh540 committed Apr 10, 2024
1 parent 576d23f commit 84ace2a
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 22 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: build
on: [ workflow_dispatch, push, pull_request ]

jobs:
build:
if: !contains(github.event.head_commit.message, '[skip]')
runs-on: ubuntu-20.04
steps:
- name: checkout
uses: actions/checkout@v4

- name: setup java
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 17

- name: setup gradle
uses: gradle/gradle-build-action@v2.4.2
with:
cache-read-only: false

- name: do the build
run: ./gradlew assemble
continue-on-error: true

- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: interiors-artifacts #-v${{ github.run_number }} <-- doesnt work with nightly.link
path: |
*/build/libs/*.jar
11 changes: 6 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.idea
build
.gradle
run
.idea/
build/
.gradle/
run/
.DS_Store
src/main/resources/assets/create
src/main/resources/assets/create/
.architectury-transformer/
23 changes: 12 additions & 11 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import java.util.zip.Deflater

plugins {
java
id("architectury-plugin") version "3.4-SNAPSHOT" apply false
id("dev.architectury.loom") version "1.4.+" apply false
id("architectury-plugin") version "3.4.155" apply false
id("dev.architectury.loom") version "1.4.380" apply false
id("com.github.johnrengelman.shadow") version "8.1.1" apply false
}

Expand All @@ -29,9 +29,7 @@ val isRelease = System.getenv("RELEASE_BUILD")?.toBoolean() ?: false
val buildNumber = System.getenv("GITHUB_RUN_NUMBER")?.toInt()
val gitHash = "\"${calculateGitHash() + (if (hasUnstaged()) "-modified" else "")}\""

tasks.jar {
enabled = false
}
tasks.jar { enabled = false }

allprojects {
apply(plugin = "java")
Expand All @@ -44,14 +42,17 @@ allprojects {
// example: 1.0.0+fabric-1.19.2-build.100 (or -local)
val build = buildNumber?.let { "-build.${it}" } ?: "-local"

version = "${"mod_version"()}+${project.name}-mc${"minecraft_version"() + if (isRelease) "" else build}"
version = "${"mod_version"()}+${project.name}-mc${"minecraft_version"()}${if (isRelease) "" else build}"

tasks.withType<JavaCompile>().configureEach {
options.release = 17
options.encoding = "UTF-8"
}

java {
withSourcesJar()
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
}
}

Expand Down Expand Up @@ -110,7 +111,7 @@ subprojects {
dependsOn(shadowJar)
archiveClassifier = null
doLast {
squishJar(outputs.files.singleFile)
squishJar(archiveFile.get().asFile)
}
}

Expand Down Expand Up @@ -148,9 +149,9 @@ subprojects {
"minecraft_version" to "minecraft_version"(),
"fabric_api_version" to "fabric_api_version"(),
"fabric_loader_version" to "fabric_loader_version"(),
"forge_version" to "forge_version"().split(".")[0], // only specify major version of forge
"create_forge_version" to "create_forge_version"().split("-")[0], // cut off build number
"create_fabric_version" to "create_fabric_version"().split("+")[0] // Trim +mcX.XX.X from version string
"forge_version" to "forge_version"().substringBefore("."), // only specify major version of forge
"create_forge_version" to "create_forge_version"().substringBefore("-"), // cut off build number
"create_fabric_version" to "create_fabric_version"().substringBefore("+") // Trim +mcX.XX.X from version string
)

inputs.properties(properties)
Expand Down Expand Up @@ -200,7 +201,7 @@ fun squishJar(jar: File) {
JarOutputStream(jar.outputStream()).use { out ->
out.setLevel(Deflater.BEST_COMPRESSION)
contents.forEach { var (name, data) = it
if(name.startsWith("architectury_inject_${project.name}_common"))
if(name.startsWith("architectury_inject_"))
return@forEach

if (name.endsWith(".json") || name.endsWith(".mcmeta")) {
Expand Down
7 changes: 1 addition & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@ org.gradle.caching = true
fabric.loom.disableProjectDependentMods = true
fabric.loom.multiProjectOptimisation = true

## Gradle Plugins
arch_plugin_version = 3.4.151
loom_version = 1.4.380
shadow_version = 8.1.1

## Mod Info
archives_base_name = interiors
mod_version=0.5.2
mod_version=0.5.3
maven_group = com.sudolev

mixin_extras_version = 0.3.5
Expand Down

0 comments on commit 84ace2a

Please sign in to comment.