4293e90a97
A BigWigs-style CI packager for WoW MPQ patch archives. Reads an mpq.yaml manifest, stages files, builds a vanilla-1.12-compatible patch-X.mpq via StormLib, and (in the example workflow) attaches it to a Gitea release on tag.
28 lines
931 B
Bash
28 lines
931 B
Bash
#!/usr/bin/env bash
|
|
# Gitea Action entrypoint. Reads action inputs from the INPUT_* environment
|
|
# variables Gitea/GitHub Actions set, then runs the packager.
|
|
set -euo pipefail
|
|
|
|
manifest="${INPUT_MANIFEST:-mpq.yaml}"
|
|
repo="${INPUT_REPO:-${GITHUB_WORKSPACE:-.}}"
|
|
out_dir="${INPUT_OUT_DIR:-dist}"
|
|
version="${INPUT_VERSION:-${GITHUB_REF_NAME:-}}"
|
|
|
|
# Derive revision/date from git when available; harmless if absent.
|
|
revision=""
|
|
date_iso=""
|
|
if command -v git >/dev/null 2>&1 && git -C "$repo" rev-parse --short HEAD >/dev/null 2>&1; then
|
|
revision="$(git -C "$repo" rev-parse --short HEAD)"
|
|
date_iso="$(git -C "$repo" show -s --format=%cI HEAD)"
|
|
fi
|
|
|
|
echo "mpq-packager: manifest=$manifest repo=$repo version=${version:-<none>}"
|
|
|
|
exec python3 /opt/mpq-packager/package.py \
|
|
--manifest "$manifest" \
|
|
--repo "$repo" \
|
|
--out-dir "$out_dir" \
|
|
--version "$version" \
|
|
--revision "$revision" \
|
|
--date "$date_iso"
|