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

Commit

Permalink
Fixing background color
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkKronicle committed Sep 4, 2022
1 parent c9bc432 commit 4382804
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 55 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
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 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:
modrinth_token: ${{ secrets.MODRINTH_TOKEN }}
curseforge_token: ${{ secrets.CURSEFORGE_TOKEN }}
github_token: ${{ secrets.GH_API_KEY }}
discord_release_webhook: ${{ secrets.DISCORD_ANNOUNCEMENT_WEBHOOK }}
- name: Capture build artifacts
uses: actions/upload-artifact@v2
with:
name: Artifacts
path: build/libs/
56 changes: 2 additions & 54 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import javax.net.ssl.HttpsURLConnection
import java.nio.file.Files

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

apply from: 'https://raw.githubusercontent.com/DarkKronicle/GradleScripts/main/gradle/publish.gradle'

sourceCompatibility = JavaVersion.VERSION_16
targetCompatibility = JavaVersion.VERSION_16

Expand Down Expand Up @@ -57,7 +56,6 @@ dependencies {

}


processResources {
inputs.property "version", project.version

Expand Down Expand Up @@ -124,53 +122,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
}

String commitHash = 'git rev-parse --verify --short HEAD'.execute().text.trim()

File file = remapJar.archiveFile.get().asFile
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()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public boolean process(Text text, @Nullable Text unfiltered, @Nullable MessageSi
.width(width)
.creationTick(MinecraftClient.getInstance().inGameHud.getTicks())
.time(time)
.backgroundColor(new Color(0, 0, 0, 100))
.backgroundColor(null)
.build();
if (ChatHistory.getInstance().add(line)) {
sendToHud(line.getDisplayText(), line.getSignature(), line.getIndicator());
Expand Down

0 comments on commit 4382804

Please sign in to comment.