Files
mpq-packager/examples/release.yml
T
paste 7b9a70f4fe
CI / build-and-smoke (push) Failing after 35s
Pin GITHUB_SERVER_URL to /git subpath so checkout/API resolve
act_runner reports GITHUB_SERVER_URL without the instance's /git subpath,
so actions/checkout cloned https://octowow.st/paste/... (404). Pin the
correct base at job level until the server ROOT_URL is fixed.
2026-06-25 22:39:38 -05:00

57 lines
1.9 KiB
YAML

# 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).
#
# NOTE: octowow.st is served under the /git subpath. act_runner reports
# GITHUB_SERVER_URL without it, breaking checkout and the release API calls, so
# we pin GITHUB_SERVER_URL below. Drop this once the server's ROOT_URL is fixed.
name: Release MPQ
on:
push:
tags:
- "v*"
jobs:
package:
runs-on: ubuntu-latest
env:
GITHUB_SERVER_URL: https://octowow.st/git
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."