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

Commit

Permalink
1.19.3 update
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkKronicle committed Jan 23, 2023
1 parent 20c12d8 commit caf0b1b
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 100 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
push:
branches:
- master
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Upload to Discord
run: ./gradlew discord --stacktrace
if: |
!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.pull_request.title, '[ci skip]')
env:
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
action_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Capture build artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
27 changes: 21 additions & 6 deletions .github/workflows/discord_publish.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
on:
push:
branches:
- main
workflow_dispatch:
inputs:
previousVersion:
description: 'Previous Version (Do not include v prefix, must be same as the last version tag! Example: 1.4.1)'
required: true
version:
description: 'Version (Do not include v prefix! Example: 1.4.2)'
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Fetch tags
run: git fetch --tags
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17
- name: Upload to Discord
run: ./gradlew discord --stacktrace
- name: Upload to websites
run: ./gradlew publishThirdParty --stacktrace -PlastTag="v${{ github.event.inputs.previousVersion }}" -PcurrentTag="v${{ github.event.inputs.version }}"
if: |
!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.pull_request.title, '[ci skip]')
env:
discord_webhook: ${{ secrets.DISCORD_WEBHOOK }}
modrinth_token: ${{ secrets.MODRINTH_TOKEN }}
curseforge_token: ${{ secrets.CURSEFORGE_TOKEN }}
github_token: ${{ secrets.GH_API_KEY }}
discord_release_webhook: ${{ secrets.DISCORD_RELEASE_WEBHOOK }}
- name: Capture build artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
86 changes: 3 additions & 83 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import javax.net.ssl.HttpsURLConnection
import java.nio.file.Files

plugins {
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'fabric-loom' version '1.0-SNAPSHOT'
id 'maven-publish'
id "io.freefair.lombok" version "6.0.0-m2"
id "com.diffplug.spotless" version "5.17.1"
}

sourceCompatibility = JavaVersion.VERSION_16
Expand All @@ -15,10 +11,7 @@ archivesBaseName = project.archives_base_name
version = "${project.minecraft_version}-${project.mod_version}"
group = project.maven_group

Properties additionalProperties = new Properties()
if (file("extra.properties").exists()) {
additionalProperties.load(file("extra.properties").newReader())
}
apply from: 'https://raw.githubusercontent.com/DarkKronicle/GradleScripts/main/gradle/publish.gradle'

repositories {
mavenCentral()
Expand All @@ -31,7 +24,7 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_api_version}"
modImplementation "fi.dy.masa.malilib:malilib-fabric-1.19.0:${project.malilib_version}"
modImplementation "fi.dy.masa.malilib:malilib-fabric-1.19.3:${project.malilib_version}"
modImplementation "com.github.DarkKronicle:AdvancedChatCore:${project.advancedchat_version}"

implementation 'org.openjdk.nashorn:nashorn-core:15.3'
Expand Down Expand Up @@ -65,30 +58,6 @@ jar {
from "LICENSE.txt"
}

spotless {
ratchetFrom 'origin/main'
format 'misc', {
// define the files to apply `misc` to
target '*.gradle', '*.md', '.gitignore'

// define the steps to apply to those files
trimTrailingWhitespace()
indentWithTabs() // or spaces. Takes an integer argument if you don't like 4
endWithNewline()
}
java {
target 'src/*/java/**/*.java'
licenseHeaderFile "HEADER.txt"
}
format 'examples', {
target 'example_filters/**/*.js'
trimTrailingWhitespace()
indentWithTabs()
endWithNewline()
licenseHeaderFile "HEADER.txt", "function setup\\("
}
}

// configure the maven publication
publishing {
publications {
Expand All @@ -109,52 +78,3 @@ publishing {
// mavenLocal()
}
}

task discord {
dependsOn build

doLast {
String webhook
if (additionalProperties["discord_webhook"] != null) {
webhook = additionalProperties["discord_webhook"]
} else if (System.getenv("discord_webhook") != null) {
webhook = System.getenv("discord_webhook")
} else {
System.out.println("No webhook found...")
return
}

File file = remapJar.archiveFile.get().asFile
String commitHash = 'git rev-parse --verify --short HEAD'.execute().text.trim()
String fileName = "$project.archives_base_name}-${project.mod_version}-${commitHash}.jar"
String text = "<:Kronos:799707832399691867> **${project.archives_base_name} v${project.mod_version}-${commitHash} for ${project.minecraft_version}**"
URL url = new URL(webhook)
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection()

def cmdLine = "git log --format=%B -n 1"
def procCommit = cmdLine.execute()
String changeLog = procCommit.in.getText()
text = text + "\n" + changeLog

String boundary = UUID.randomUUID().toString()
connection.setRequestMethod("POST")
connection.setDoOutput(true)
connection.setRequestProperty("Content-Type", "multipart/form-data;boundary=" + boundary)
DataOutputStream stream = new DataOutputStream(connection.getOutputStream());

stream.writeBytes("--" + boundary + "\r\n")
stream.writeBytes("Content-Disposition: form-data; name=\"file\"; filename=\"" + fileName + "\"\r\n\r\n")
stream.write(Files.readAllBytes(file.toPath()))
stream.writeBytes("\r\n")
stream.writeBytes("--" + boundary + "\r\n");
stream.writeBytes('Content-Disposition: form-data; name="content"\r\n\r\n' + text + '\r\n')
stream.writeBytes("--" + boundary + "--\r\n")

stream.flush()
stream.close()

connection.getInputStream().close()
connection.disconnect()
}

}
33 changes: 25 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,30 @@
minecraft_version=1.19
yarn_mappings=1.19+build.4
loader_version=0.14.8
fabric_api_version=0.57.0+1.19
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.2
loader_version=0.14.11
fabric_api_version=0.68.1+1.19.3

mod_version=1.2.6
mod_version=1.2.7
maven_group=io.github.darkkronicle
archives_base_name=AdvancedChatFilters

malilib_version = 0.13.0
malilib_version = 0.14.0
org.gradle.jvmargs=-Xmx1G
advancedchat_version=1.5.3-build1
owo_version=2.0.0
advancedchat_version=v1.5.9
owo_version=2.0.0

# publishing
curseforge_slug=advancedchatfilters
curseforge_id=539122

modrinth_slug=advancedchatfilters
modrinth_id=c6fx2vMe

# default_release_type can be stable, beta, or alpha
default_release_type=stable
project_name=AdvancedChatFilters
project_url=https://modrinth.com/mod/advancedchatfilters
project_logo=https://raw.githubusercontent.com/DarkKronicle/AdvancedChatFilters/main/src/main/resources/assets/advancedchatfilters/icon.png
project_color=0x134bff
changelog_hide_unimportant_commits=true
changelog_max_commit_search=200
discord_webhook_changelog_line_limit=10
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ public enum NotifySound implements IConfigOptionListEntry {
ENDERMAN_TELEPORT("enderman_teleport", SoundEvents.ENTITY_ENDERMAN_TELEPORT),
WOLOLO("wololo", SoundEvents.ENTITY_EVOKER_PREPARE_WOLOLO),
BELL("bell_use", SoundEvents.BLOCK_BELL_USE),
CLICK("button_click", SoundEvents.UI_BUTTON_CLICK),
CLICK("button_click", SoundEvents.UI_BUTTON_CLICK.value()),
HUSK_TO_ZOMBIE("husk_to_zombie", SoundEvents.ENTITY_HUSK_CONVERTED_TO_ZOMBIE),
GLASS_BREAK("glass_break", SoundEvents.BLOCK_GLASS_BREAK);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public IntRange getArgumentCount() {
}

public static SoundEvent getEvent(String name) {
return new SoundEvent(new Identifier(name));
return SoundEvent.of(new Identifier(name));
}

/* How the filter notifies the client of a found string.
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"depends": {
"fabricloader": ">=0.13.0",
"fabric": "*",
"minecraft": ">=1.19",
"minecraft": ">=1.19.3",
"malilib": ">=0.13.0",
"advancedchatcore": ">=1.4.0-1.18"
},
Expand Down

0 comments on commit caf0b1b

Please sign in to comment.