Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Oct 5, 2023
1 parent 3efdd15 commit d23e49e
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 41 deletions.
80 changes: 55 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,62 @@
name: build
on:
workflow_dispatch:
inputs:
publish:
description: Publish to Modrinth and CurseForge
required: true
default: "false"
patch:
description: Patch number, 0 for first (ex. Create 1.19.2 v0.5.0.g Patch N)
required: true
pull_request:
push:

jobs:
build:
runs-on: ubuntu-latest
steps:

- name: checkout repository
uses: actions/checkout@v3

- name: make gradle wrapper executable
run: chmod +x ./gradlew

- name: setup Java
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 17
cache: gradle

- name: build
run: ./gradlew build

- name: capture build artifacts
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: build/libs/
build:
strategy:
matrix:
java: [ 17 ]
runs-on: ubuntu-latest
env:
PUBLISH_SUFFIX: snapshots
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
PATCH_NUMBER: ${{ github.event.inputs.patch }}
PUBLISHING: ${{ github.event.inputs.publish }}
steps:

- name: checkout repository
uses: actions/checkout@v2

- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java }}

- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/loom-cache
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle-wrapper.properties') }}
restore-keys: ${{ runner.os }}-gradle

- name: make gradle wrapper executable
run: chmod +x ./gradlew

- name: build
run: ./gradlew buildOrPublish

- name: capture build artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/

- name: publish to Maven
if: ${{ github.event.inputs.publish }}
run: ./gradlew publishMod
11 changes: 3 additions & 8 deletions FABRIC_CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ No formatting, just plain text. CurseForge support for it is terrible.

Change logging starts below:
----------
- updated to 1.20.1 and patch D
- hopefully fix overlays rendering out of order (#783)
- fix overlays rendering twice, noticeable with Double Hotbar (#790)
- stop the rogue Deployer uprising, for now (#1013)
- fix plant-ness not being checked properly in some places (#1032)
- fix debug stick (#831)
- fix crash breaking blocks with wand of symmetry (#1048)
- fix performance issues with pipe connections (#935)
- update porting-lib version 2.1.1127+1.20 -> 2.1.1142+1.20-entity-refactor to fix Hephaestus compat (maybe), and config-api from forge-config-api-port move to porting-lib-config
- flywheel -> flywheel-fabric-unofficial.
- update fabric-api version 0.86.0+1.20.1 -> 0.89.3+1.20.1
40 changes: 39 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,22 @@ def recipeViewers(DependencyHandler deps) {
}
}

machete {
enabled = Boolean.getBoolean("PUBLISHING") // only optimize published releases
}

tasks.register("buildOrPublish") {
group = "build"
String mavenUser = System.getenv("MAVEN_USER")
if (mavenUser != null && !mavenUser.isEmpty()) {
dependsOn(tasks.named("publish"))
println("prepared for publish")
} else {
dependsOn(tasks.named("build"))
println("prepared for build")
}
}

sourceSets {
main {
resources {
Expand Down Expand Up @@ -225,6 +241,28 @@ jar {
}
}

publishing {
publications {
mavenJava(MavenPublication) {
artifactId = archivesBaseName + "-${project.minecraft_version}"
from components.java
}
}

repositories {
maven {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/KessokuTeaTime/create-fabric")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}
}

// see gradle/publishing.gradle for publishing
//apply from: "gradle/publishing/publishing.gradle"
// apply from: "gradle/publishing/publishing.gradle"
apply from: "gradle/compat/compat.gradle"
12 changes: 7 additions & 5 deletions gradle/publishing/maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ publishing {

repositories {
maven {
url = "https://mvn.devos.one/${System.getenv("PUBLISH_SUFFIX")}/"
credentials {
username = System.getenv("MAVEN_USER")
password = System.getenv("MAVEN_PASS")
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/KessokuTeaTime/create-fabric")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
authentication { basic(BasicAuthentication) }
}
}
}
4 changes: 2 additions & 2 deletions gradle/publishing/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ static String getChangelog(File changelogFile) {
return split[1].trim()
}

apply from: "gradle/publishing/modrinth.gradle"
apply from: "gradle/publishing/curseforge.gradle"
//apply from: "gradle/publishing/modrinth.gradle"
//apply from: "gradle/publishing/curseforge.gradle"
apply from: "gradle/publishing/maven.gradle"

0 comments on commit d23e49e

Please sign in to comment.