FKRPG/.gitea/workflows/build-pack.yaml
mithral 4b7e122dde
All checks were successful
Build & Release Pack / build (push) Successful in 1m45s
CI: compile packwiz on runner via go install (fixes glibc mismatch)
Drop the committed packwiz binary (built against glibc 2.34, incompatible
with the runner's node:20-bullseye / glibc 2.31). Instead fetch Go into
the image and 'go install github.com/packwiz/packwiz@latest' so it links
against the runner's glibc. Keeps the working inline git clone + tag-gated
release.
2026-08-26 15:28:53 -04:00

85 lines
3.3 KiB
YAML

name: Build & Release Pack
on:
push:
branches: [main]
tags: ['v*']
jobs:
build:
runs-on: docker
steps:
- name: Install Go
run: |
GO_VER=1.22.5
curl -sSL "https://go.dev/dl/go${GO_VER}.linux-amd64.tar.gz" -o /tmp/go.tgz
tar -C /usr/local -xzf /tmp/go.tgz
/usr/local/go/bin/go version
- name: Install packwiz
run: /usr/local/go/bin/go install github.com/packwiz/packwiz@latest
- name: Add packwiz to PATH
run: echo "$(/usr/local/go/bin/go env GOPATH)/bin" >> "$GITHUB_PATH"
- name: Fetch sources
run: |
REPO="https://git.mithraic.cloud/ad3laid3/FKRPG.git"
if [ -n "${GITHUB_TOKEN}" ]; then
git -c "credential.https://git.mithraic.cloud.username=x-access-token" \
-c "credential.https://git.mithraic.cloud.password=${GITHUB_TOKEN}" \
clone --branch "${GITHUB_REF_NAME}" --depth 1 "${REPO}" "${GITHUB_WORKSPACE}"
else
git clone --branch "${GITHUB_REF_NAME}" --depth 1 "${REPO}" "${GITHUB_WORKSPACE}"
fi
- name: Refresh index
working-directory: client_pack
run: packwiz refresh
- name: Integrity check
working-directory: client_pack
run: python3 ../tools/validate_pack.py . integrity
- name: Sanity grep download URLs
working-directory: client_pack
run: python3 ../tools/validate_pack.py . sanity
- name: Export client Modrinth pack
working-directory: client_pack
run: packwiz modrinth export -o ../FKRPG-${GITHUB_REF_NAME}.mrpack --restrictDomains=false
- name: Refresh server index
working-directory: server_pack
run: packwiz refresh
- name: Integrity check (server)
working-directory: server_pack
run: python3 ../tools/validate_pack.py . integrity
- name: Sanity grep download URLs (server)
working-directory: server_pack
run: python3 ../tools/validate_pack.py . sanity
- name: Export server Modrinth pack
working-directory: server_pack
run: packwiz modrinth export -o ../FKRPG-SERVER-${GITHUB_REF_NAME}.mrpack --restrictDomains=false
- name: Release
if: startsWith(github.ref, 'refs/tags/v')
run: |
set -e
TAG="${GITHUB_REF_NAME}"
API="https://git.mithraic.cloud/api/v1/repos/ad3laid3/FKRPG/releases"
AUTH="Authorization: token ${{ secrets.GITHUB_TOKEN }}"
RELEASE_JSON=$(curl -sS -X POST "$API" \
-H "$AUTH" \
-H "Content-Type: application/json" \
-d "{\"tag_name\":\"$TAG\",\"name\":\"FKRPG $TAG\",\"body\":\"Download the .mrpack and import it into Prism Launcher (File > Import Instance > select the file). All mods are bundled or auto-fetched. Use the SERVER pack on the server side. Worldgen tuned for realistic+expansive RPG (Tectonic+Terralith+Continents).\"}")
RELEASE_ID=$(printf '%s' "$RELEASE_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
for mr in "FKRPG-${TAG}.mrpack" "FKRPG-SERVER-${TAG}.mrpack"; do
curl -sS -X POST "$API/$RELEASE_ID/assets?name=${mr}" \
-H "$AUTH" \
-F "attachment=@${mr}"
done
echo "Uploaded FKRPG-${TAG}.mrpack and FKRPG-SERVER-${TAG}.mrpack"