From 3afc0b94a702184aff415620f747a745ce0c9c05 Mon Sep 17 00:00:00 2001 From: msdigital Date: Tue, 3 Feb 2026 10:16:02 +0100 Subject: [PATCH] ci: switch CurseForge upload to API with repo config --- .github/workflows/release.yml | 55 ++++++++++++++++++++++++++++------- USAGE.md | 48 ++++++++++++++++++++++++++++++ curseforge.json | 7 +++++ 3 files changed, 99 insertions(+), 11 deletions(-) create mode 100644 USAGE.md create mode 100644 curseforge.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1167cb5..337d6a3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,17 +53,50 @@ jobs: JAR_PATH="$(ls -1 build/libs/*.jar | head -n 1)" echo "CF_FILE_PATH=$JAR_PATH" >> "$GITHUB_ENV" - - name: Upload to CurseForge - uses: itsmeow/curseforge-upload@v3.1.2 - with: - token: ${{ secrets.CF_API_TOKEN }} - project_id: "1452160" - game_endpoint: "hytale" - file_path: ${{ env.CF_FILE_PATH }} - game_versions: "14284" - release_type: "release" - changelog: ${{ github.event.release.body }} - changelog_type: "markdown" + - name: Load CurseForge config + shell: bash + run: | + set -euo pipefail + python - <<'PY' >> "$GITHUB_ENV" + import json, pathlib + cfg = json.loads(pathlib.Path("curseforge.json").read_text(encoding="utf-8")) + print(f"CF_PROJECT_ID={cfg['projectId']}") + print(f"CF_GAME_ENDPOINT={cfg['gameEndpoint']}") + print(f"CF_RELEASE_TYPE={cfg.get('releaseType', 'release')}") + print(f"CF_CHANGELOG_TYPE={cfg.get('changelogType', 'markdown')}") + print("CF_GAME_VERSIONS=" + ",".join(str(v) for v in cfg["gameVersions"])) + PY + + - name: Build CurseForge zip + shell: bash + run: | + set -euo pipefail + ZIP_PATH="build/libs/bumenfeld-clock-${{ github.ref_name }}.zip" + zip -j "$ZIP_PATH" "$CF_FILE_PATH" "LICENSE" "USAGE.md" + echo "CF_ZIP_PATH=$ZIP_PATH" >> "$GITHUB_ENV" + + - name: Upload to CurseForge (Upload API) + shell: bash + env: + CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} + CHANGELOG: ${{ github.event.release.body }} + run: | + set -euo pipefail + python - <<'PY' + import json, os, pathlib + changelog = os.environ.get("CHANGELOG", "") + metadata = { + "changelog": changelog, + "changelogType": os.environ.get("CF_CHANGELOG_TYPE", "markdown"), + "gameVersions": [int(v) for v in os.environ["CF_GAME_VERSIONS"].split(",") if v], + "releaseType": os.environ.get("CF_RELEASE_TYPE", "release"), + } + pathlib.Path("build/cf-metadata.json").write_text(json.dumps(metadata), encoding="utf-8") + PY + curl -sS -X POST "https://${CF_GAME_ENDPOINT}.curseforge.com/api/projects/${CF_PROJECT_ID}/upload-file" \ + -H "X-Api-Token: $CF_API_TOKEN" \ + -F "metadata=@build/cf-metadata.json;type=application/json" \ + -F "file=@${CF_ZIP_PATH}" - name: Publish release assets uses: softprops/action-gh-release@v2 diff --git a/USAGE.md b/USAGE.md new file mode 100644 index 0000000..837da44 --- /dev/null +++ b/USAGE.md @@ -0,0 +1,48 @@ +## Overview + +Bumenfeld Clock adds a lightweight **HUD clock** for every player and lets them customize **format** and **screen position**. + +*** + +## Features + +* **Always-visible clock HUD** (default: `HH:mm`) +* **Per-player settings** (each player chooses their own format & position) +* **Instant updates** via commands + +*** + +## Commands + +* `/clock format <pattern>` — Set the time format (Java `DateTimeFormatter` patterns) +* `/clock position left|center|right` — Set the HUD position + +*** + +## Dependencies (required) + +* [MultipleHUD](https://www.curseforge.com/hytale/mods/multiplehud) + +*** + +## Installation + +1. Install **MultipleHUD** (required). +2. Drop this mod’s `.jar` into your server’s `/mods/` folder. +3. Start the server once (config gets generated). +4. Adjust config if needed and restart / rejoin.   + +*** + +## Configuration + +Default configuration: + +`{ "Format": "HH:mm", "Position": "center", "UpdateIntervalMs": 1000 }` + +*** + +## Changelog + +* **1.1.0 (2026-02-02)** — Require MultipleHUD for clock HUD updates; docs/UI refresh. +* **1.0.0 (2026-02-01)** — Initial release. \ No newline at end of file diff --git a/curseforge.json b/curseforge.json new file mode 100644 index 0000000..25bfb6a --- /dev/null +++ b/curseforge.json @@ -0,0 +1,7 @@ +{ + "projectId": "1452160", + "gameEndpoint": "hytale", + "gameVersions": [14284], + "releaseType": "release", + "changelogType": "markdown" +}