56 changes: 56 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Automatically build the project and run any configured tests for every push
# and submitted pull request. This can help catch issues that only occur on
# certain platforms or Java versions, and provides a first line of defence
# against bad commits.

name: build
on: [pull_request, push]

jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [
17, # Current Java LTS & minimum supported by Minecraft
]
# and run on both Linux and Windows
os: [ ubuntu-22.04, windows-2022 ]
runs-on: ${{ matrix.os }}

steps:
- name: checkout repository
uses: actions/checkout@v4

- name: setup JDK${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'

- name: setup gradle
uses: gradle/gradle-build-action@v2.12.0
with:
gradle-home-cache-includes: |
caches
notifications
loom-cache
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew

- name: build & run tests
run: ./gradlew check build
env:
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JACKFRED_MAVEN_USER: ${{ secrets.JACKFRED_MAVEN_USER }}
JACKFRED_MAVEN_PASS: ${{ secrets.JACKFRED_MAVEN_PASS }}

- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from latest java on one OS
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: build/libs/
198 changes: 198 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
name: Publish
run-name: Publish More Chat History

on:
workflow_dispatch:
inputs:
changelogHeader:
description: 'Message to place at the top of the changelog.'
required: false
type: string
lastTagOverride:
description: 'Override previous tag for changelog generation.'
required: false
type: string
createNewTag:
description: 'Create New Tag. May cause issues if below options are true and this is false.'
default: true
required: true
type: boolean
publishToMaven:
description: 'Publish to Maven'
default: true
required: true
type: boolean
publishToGitHub:
description: 'Publish as GitHub Release'
default: true
required: true
type: boolean
publishToModDistributors:
description: 'Publish to Modrinth and CurseForge'
default: false
required: true
type: boolean

permissions:
# packages: write
contents: write

jobs:
publish:
strategy:
matrix:
# Use these Java versions
java: [17]
# and run on both Linux and Windows
os: [ubuntu-22.04]
runs-on: ${{ matrix.os }}

steps:
- name: Checkout Repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up JDK${{ matrix.java }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'temurin'

- name: setup gradle
uses: gradle/gradle-build-action@v2.12.0
with:
gradle-home-cache-includes: |
caches
notifications
loom-cache
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew

# get new tag in the form vX.Y.Z, saved to new_tag=vX.Y.Z
- name: Pull Mod Version
id: pull-new-version
run: |
grep 'mod_version=' gradle.properties | sed 's/mod_version=/new_tag=v/g' >> $GITHUB_OUTPUT
# previous tag parsing
# we use an env variable here because it's easier than joining two step outputs I think
- name: Set previous tag from override
if: ${{ inputs.lastTagOverride != null }}
run: |
if git show-ref --tags --verify --quiet "refs/tags/${{ inputs.lastTagOverride }}"; then
echo "lastTagOverride exists"
exit 0
else
echo "lastTagOverride doesn't exist, failing"
exit 1
fi
echo "PREVIOUS_TAG=${{ inputs.lastTagOverride }}" >> "$GITHUB_ENV"
- name: Set previous tag from git history (creating new tag)
if: ${{ inputs.lastTagOverride == null && inputs.createNewTag == true }}
run: |
previous=`git describe --tags --abbrev=0`
if [ $previous ]; then
echo "PREVIOUS_TAG=$previous" >> "$GITHUB_ENV"
else
echo "PREVIOUS_TAG=NONE" >> "$GITHUB_ENV"
fi
- name: Set previous tag from git history (not creating new tag)
if: ${{ inputs.lastTagOverride == null && inputs.createNewTag == false }}
run: |
previous=`git describe --tags --abbrev=0 --exclude="$(git describe --abbrev=0 --tags)"`
if [ $previous ]; then
echo "PREVIOUS_TAG=$previous" >> "$GITHUB_ENV"
else
echo "PREVIOUS_TAG=NONE" >> "$GITHUB_ENV"
fi
# new tag parsing and concat
# vX.Y.Z -> vX.Y.Z since this is mostly multi-version
- id: new-tag-generator
name: Format new tag from input and branch
run: |
# branch=$(git rev-parse --abbrev-ref HEAD)
# newTag=${{ steps.pull-new-version.outputs.new_tag }}+$branch
newTag=${{ steps.pull-new-version.outputs.new_tag }}
echo "NEW_TAG=$newTag" >> "$GITHUB_ENV"
echo "NEW_TAG=$newTag" >> "$GITHUB_OUTPUT"
- name: Check new version doesn't exist
if: ${{ inputs.createNewTag == true }}
run: |
if git show-ref --tags --verify --quiet "refs/tags/${{ steps.new-tag-generator.outputs.NEW_TAG }}"; then
echo "newTag already exists, failing"
exit 1
else
echo "newTag doesn't exist"
exit 0
fi
- name: Output build spec
run: |
echo "Previous: $PREVIOUS_TAG"
echo "New: $NEW_TAG"
- name: build & run tests
run: ./gradlew check build

- name: Create version tag
if: ${{ inputs.createNewTag == true }}
uses: actions/github-script@v6
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/${{ steps.new-tag-generator.outputs.NEW_TAG }}",
sha: context.sha
})
- name: Fetch new tag for changelog generation
if: ${{ inputs.createNewTag == true }}
run: git fetch --tags

- name: Publish to JackFred Maven
if: ${{ inputs.publishToMaven == true }}
run: ./gradlew generateChangelog publish -PchangelogHeaderAddon="${{ inputs.changelogHeader }}"
env:
RELEASE: true
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JACKFRED_MAVEN_USER: ${{ secrets.JACKFRED_MAVEN_USER }}
JACKFRED_MAVEN_PASS: ${{ secrets.JACKFRED_MAVEN_PASS }}

- name: Publish as GitHub Release
if: ${{ inputs.publishToGitHub == true }}
run: ./gradlew generateChangelog githubRelease -PchangelogHeaderAddon="${{ inputs.changelogHeader }}"
env:
RELEASE: true
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JACKFRED_MAVEN_USER: ${{ secrets.JACKFRED_MAVEN_USER }}
JACKFRED_MAVEN_PASS: ${{ secrets.JACKFRED_MAVEN_PASS }}

- name: Publish to Modrinth and Curseforge
run: ./gradlew generateChangelog publishMods
if: ${{ inputs.publishToModDistributors == true }}
env:
RELEASE: true
GITHUB_ACTOR: ${{ secrets.GITHUB_ACTOR }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
JACKFRED_MAVEN_USER: ${{ secrets.JACKFRED_MAVEN_USER }}
JACKFRED_MAVEN_PASS: ${{ secrets.JACKFRED_MAVEN_PASS }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}

- name: Capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }} # Only upload artifacts built from LTS java on one OS
uses: actions/upload-artifact@v3
with:
name: Artifacts
path: |
build/libs/
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# MoreChatHistory

A Fabric / Quilt mod to increase the length of the chat history, from 100 to 16,384 messages.

## Features

- Increases Chat History Length

This mod is meant to be a tiny, future-proof, reliable drop-in mod (currently 11KB, which is mostly the CC0 license text & logo); if you want more features,
check out [some other cool chat-related mods](https://modrinth.com/mods?q=chat&f=categories:%27social%27) that may have what you're looking for.

## Updates

This most will almost certainly work on a new update; try it and see.
120 changes: 0 additions & 120 deletions build.gradle

This file was deleted.

Loading