Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 37 additions & 29 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,47 @@
# 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

name: build
on: [pull_request, push]
on:
push:
branches:
- "*"

jobs:
build:
strategy:
matrix:
# Use these Java versions
java: [ 21 ]
distro: [ temurin ]
# and run on both Linux and Windows
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest

steps:
- name: checkout repository
uses: actions/checkout@v4
- name: validate gradle wrapper
uses: gradle/actions/wrapper-validation@v4
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v4
- uses: actions/checkout@v6

- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
with:
distribution: ${{ matrix.distro }}
java-version: ${{ matrix.java }}
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
cache-read-only: false

- name: Store short commit hash
run: echo "short_commit_hash=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"

- name: Build with Gradle
run: ./gradlew build
- name: capture build artifacts
if: ${{ runner.os == 'Linux' }}
uses: actions/upload-artifact@v4
env:
PRESERVE_PRERELEASE_VERSION: true
VERSION_SUFFIX: ${{ env.short_commit_hash }}

- name: Publish to Maven
run: ./gradlew publishMavenPublicationToOffsetMonkey538Repository
env:
PRESERVE_PRERELEASE_VERSION: true
VERSION_SUFFIX: ${{ env.short_commit_hash }}
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}

- name: Upload build artifacts
uses: actions/upload-artifact@v7
with:
name: Artifacts
path: build/libs/
30 changes: 0 additions & 30 deletions .github/workflows/docs.yml

This file was deleted.

64 changes: 37 additions & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,46 +1,56 @@
name: Release
name: Publish

on:
release:
types:
- published
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

permissions:
contents: write

steps:
- uses: actions/cache@v4
- uses: actions/checkout@v6

- name: Set up JDK 21
uses: actions/setup-java@v5
with:
path: |
~/.gradle/loom-cache
~/.gradle/caches
~/.gradle/wrapper
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
java-version: '21'
distribution: 'temurin'

- name: Set up Gradle
uses: gradle/actions/setup-gradle@v6
with:
java-version: 21
distribution: 'microsoft'
cache-read-only: false

- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
env:
IS_RELEASE: true
VERSION_SUFFIX: ""

- name: Build and publish with Gradle
run: ./gradlew build publish
- name: Upload to Modrinth
run: ./gradlew modrinth
env:
MAVEN_URL: ${{ secrets.MAVEN_URL }}
IS_RELEASE: true
VERSION_SUFFIX: ""
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
VERSION_NAME: ${{ github.event.release.name }}
VERSION_IS_PRERELEASE: ${{ github.event.release.prerelease }}
VERSION_CHANGELOG: ${{ github.event.release.body }}

- name: Publish to Maven
run: ./gradlew publishMavenPublicationToOffsetMonkey538Repository
env:
IS_RELEASE: true
VERSION_SUFFIX: ""
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
MODRINTH: ${{ secrets.MODRINTH }}
CURSEFORGE: ${{ secrets.CURSEFORGE }}
CHANGELOG: ${{ github.event.release.body }}
- name: Upload GitHub release
uses: AButler/upload-release-assets@v3.0

- name: Upload to GitHub
uses: softprops/action-gh-release@v2
with:
files: 'build/libs/*.jar;!build/libs/*-sources.jar;!build/libs/*-dev.jar'
repo-token: ${{ secrets.GITHUB_TOKEN }}
files: ./build/libs/*.jar
25 changes: 22 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,26 @@
# About Placeholder API
It's a small, jij-able API that allows creation and parsing placeholders within strings and Minecraft Text Components.
# About Placeholder API NeoForge
This is an unofficial port of Placeholder API to NeoForge, check out the original by Patbox [here](https://modrinth.com/mod/placeholder-api) and a Paper port [here](https://modrinth.com/project/placeholder-api-paper).

Placeholder API is a small, JIJ-able API that allows creation and parsing placeholders within strings and Minecraft Text Components.
Placeholders use simple format of `%modid:type%` or `%modid:type/data%`.
It also includes simple, general usage text format indented for simplifying user input in configs/chats/etc.

For information about usage (for developers and users) you can check official docs at https://placeholders.pb4.eu/!
For information about usage (for developers and users) you can check official docs of the original Fabric version at https://placeholders.pb4.eu/!

## Developers
To depend on Placeholder API NeoForge, add the following to your buildscript:
```groovy
repositories {
// ... other repositories
maven("https://maven.offsetmonkey538.top/releases") { name = "OffsetMonkey538" }
}

dependencies {
// ... other dependencies
implementation "eu.pb4:placeholder-api-neoforge:[VERSION]"
}
```
This will allow you to use the library in your project, but requires users to manually download it.
If you want to JIJ the library, see the NeoForge documentation for how to do so [here](https://docs.neoforged.net/toolchain/docs/dependencies/jarinjar/).

Make sure to replace the `[VERSION]` with an actual valid version. For a list of available versions, check the maven [here](https://maven.offsetmonkey538.top/#/releases/eu/pb4/placeholder-api-neoforge).
Loading