Skip to content

Commit

Permalink
Fixing color parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkKronicle committed Sep 28, 2022
1 parent 55cd40a commit dbe44f7
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
push:
branches:
- 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/
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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: Change wrapper permissions
run: chmod +x ./gradlew
- 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/
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ plugins {
id "io.freefair.lombok" version "6.0.0-m2"
}

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

version = "${project.mod_version}-${project.minecraft_version}"
group = project.maven_group

Expand Down
18 changes: 17 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,25 @@ minecraft_version=1.19
yarn_mappings=1.19+build.1
loader_version=0.14.6

mod_version=0.2.2
mod_version=0.2.3
maven_group=io.github.darkkronicle
archives_base_name=DarkKore

night_config_version=3.6.5
konstruct_version=2.0.3-build1

# Uploading data
curseforge_slug=darkkore
curseforge_id=632729

modrinth_slug=darkkore
modrinth_id=mB8GNQWO

default_release_type=stable
project_name=DarkKore
project_url=https://modrinth.com/mod/darkkore
project_logo=https://raw.githubusercontent.com/DarkKronicle/DarkKore/main/src/main/resources/assets/darkkore/icon.png
project_color=0xF37357
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 @@ -156,7 +156,7 @@ private static Color hexToSimple(String string) {
int blue = Integer.parseInt(string.substring(4, 6), 16);
int alpha = 255;
if (string.length() == 8) {
alpha = Integer.parseInt(string.substring(6));
alpha = Integer.parseInt(string.substring(6), 16);
}
return new Color(red, green, blue, alpha);
} catch (Exception e) {
Expand Down

0 comments on commit dbe44f7

Please sign in to comment.