Skip to content

Commit

Permalink
auto publish setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kasualix committed Dec 20, 2023
1 parent 71b09c9 commit a7b8d13
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 10 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Publish Release

on:
workflow_dispatch:
release:
types:
- published

permissions:
contents: write

jobs:
Build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 20
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: 20
- name: Cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }}
- uses: gradle/wrapper-validation-action@v1
- run: |
chmod +x gradlew
./gradlew build publishCurseForge publish modrinth --stacktrace -Porg.gradle.parallel.threads=4
env:
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# 2.11.0
Huge update with a bunch of remaking and cleaning
Resolve three potential NullPointerException crashes with mods
33 changes: 32 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
import net.darkhax.curseforgegradle.TaskPublishCurseForge

buildscript {
repositories {
maven { url = 'https://files.minecraftforge.net/maven' }
maven { url='https://dist.creeper.host/Sponge/maven' }
maven { url='https://repo.spongepowered.org/maven' }
maven {
url "https://plugins.gradle.org/m2/"
}
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath group: 'org.spongepowered', name: 'mixingradle', version: '0.7-SNAPSHOT'
classpath group: 'net.darkhax.curseforgegradle', name: 'CurseForgeGradle', version: '1.1.+'
}
}

plugins {
id 'net.darkhax.curseforgegradle' version '1.1.+'
}

apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.spongepowered.mixin'

Expand Down Expand Up @@ -114,4 +124,25 @@ jar {
}
}

jar.finalizedBy('reobfJar')
jar.finalizedBy('reobfJar')
java.withSourcesJar()

String currentChangeLog = file("CHANGELOG.md").getText("UTF-8");

tasks.register("publishCurseForge", TaskPublishCurseForge) {
apiToken = System.getenv("CURSEFORGE_TOKEN")
disableVersionDetection()

def mainFile = upload(cf_project_id, jar)
mainFile.displayName = "Better End Potato Edition - ${version}"
mainFile.releaseType = "release"
mainFile.changelog = currentChangeLog
mainFile.changelogType = "markdown"
mainFile.addModLoader("Forge")
mainFile.addJavaVersion("Java 17", "Java 8")
mainFile.addGameVersion("1.16.5")

def sourcesFile = mainFile.withAdditionalFile(sourcesJar)
sourcesFile.changelog = currentChangeLog
sourcesFile.changelogType = "markdown"
}
5 changes: 1 addition & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
org.gradle.jvmargs=-Xmx2G
org.gradle.daemon=false
systemProp.http.proxyHost=localhost
systemProp.http.proxyPort=7890
systemProp.https.proxyHost=localhost
systemProp.https.proxyPort=7890
cf_project_id=825357
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
//import net.minecraft.util.Mth;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
//import ru.betterend.config.Configs;

public class GeneratorOptions {
public static boolean vanillaEndIntegration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ public class ServerPlayerEntityMixin
@Inject(method = "func_242110_a", at = @At("HEAD"), cancellable = true)
private void be_createEndSpawnPlatform(ServerWorld world, BlockPos centerPos, CallbackInfo info)
{
if (!GeneratorOptions.generateObsidianPlatform())
{
info.cancel();
}
if (GeneratorOptions.generateObsidianPlatform()) return;
info.cancel();
}
}

0 comments on commit a7b8d13

Please sign in to comment.