Initial: MPQ patch packager (Gitea Action, StormLib-based)
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.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# Example manifest for the GlueXML repo. Copy this to the repo root as
|
||||
# `mpq.yaml`. It packs the whole repo into Interface\GlueXML\ inside a
|
||||
# patch-Z.mpq (Z sorts after Blizzard's stock MPQs, so its files win on conflict).
|
||||
|
||||
name: GlueXML
|
||||
patch-letter: Z
|
||||
|
||||
substitute:
|
||||
enabled: true
|
||||
extensions: [".lua", ".xml", ".toc"]
|
||||
|
||||
contents:
|
||||
- src: .
|
||||
dest: Interface/GlueXML
|
||||
ignore:
|
||||
- ".git/**"
|
||||
- ".gitea/**"
|
||||
- "mpq.yaml"
|
||||
- "*.md"
|
||||
- "dist/**"
|
||||
@@ -0,0 +1,50 @@
|
||||
# Example consuming workflow. Drop this in a WoW interface repo (e.g. GlueXML)
|
||||
# at .gitea/workflows/release.yml. Pushing a tag like `v1.0.0` builds the MPQ
|
||||
# and attaches it to a matching Gitea release.
|
||||
#
|
||||
# Requires: Actions enabled on the repo, and a runner advertising `ubuntu-latest`
|
||||
# (or change runs-on to a label your act_runner registers).
|
||||
|
||||
name: Release MPQ
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
|
||||
jobs:
|
||||
package:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build patch MPQ
|
||||
id: pack
|
||||
uses: paste/mpq-packager@v1
|
||||
with:
|
||||
manifest: mpq.yaml
|
||||
version: ${{ github.ref_name }}
|
||||
|
||||
- name: Create release and upload asset
|
||||
env:
|
||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||
TAG="${GITHUB_REF_NAME}"
|
||||
MPQ="${{ steps.pack.outputs.mpq-path }}"
|
||||
NAME="${{ steps.pack.outputs.mpq-name }}"
|
||||
|
||||
echo "Creating release $TAG"
|
||||
RID=$(curl -fsSL -X POST "$API/releases" \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d "{\"tag_name\":\"$TAG\",\"name\":\"$TAG\",\"draft\":false,\"prerelease\":false}" \
|
||||
| python3 -c 'import sys,json; print(json.load(sys.stdin)["id"])')
|
||||
|
||||
echo "Uploading $NAME to release $RID"
|
||||
curl -fsSL -X POST "$API/releases/$RID/assets?name=$NAME" \
|
||||
-H "Authorization: token $TOKEN" \
|
||||
-H "Content-Type: application/octet-stream" \
|
||||
--data-binary "@$MPQ"
|
||||
echo "Done."
|
||||
Reference in New Issue
Block a user