diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 13feb75ac6..d614a2a604 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/FABRIC_CHANGELOG.txt b/FABRIC_CHANGELOG.txt index 56d7cee67f..2d9f283523 100644 --- a/FABRIC_CHANGELOG.txt +++ b/FABRIC_CHANGELOG.txt @@ -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 diff --git a/build.gradle b/build.gradle index 48c6cf8d5f..136224de17 100644 --- a/build.gradle +++ b/build.gradle @@ -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 { @@ -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" diff --git a/gradle/publishing/maven.gradle b/gradle/publishing/maven.gradle index e77c213c2f..ec8cc64033 100644 --- a/gradle/publishing/maven.gradle +++ b/gradle/publishing/maven.gradle @@ -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) } } } } diff --git a/gradle/publishing/publishing.gradle b/gradle/publishing/publishing.gradle index da953b14c8..57373921cd 100644 --- a/gradle/publishing/publishing.gradle +++ b/gradle/publishing/publishing.gradle @@ -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"