SE2Revival/.forgejo/workflows/build.yml
DS2Revival c06d0479e6
Some checks failed
build / build (push) Failing after 37s
CI: build on the project's own runner at git.dsii.uk
2026-10-27 22:06:33 -04:00

62 lines
2.5 KiB
YAML

# Builds the SE2 Revival package (SE2-Revival.zip: Ultimate ASI Loader as version.dll, scripts/DS2Toolkit.asi + .ini,
# bw/BWCompat.ds2dll, README.txt) from source: on every push to main (and to the ci branch, for testing CI changes)
# as a workflow artifact, and for every v* tag as a release with SE2-Revival.zip and SE2-Revival.zip.sha256
# attached. Cross-compiled on Linux by tools/ci_build.py --project se2: clang-cl + lld-link against the MSVC CRT and
# Windows SDK fetched by xwin, same flags as mods/build.py with MSVC on Windows; packaged by tools/package_toolkit.py.
# Release notes: .forgejo/release-notes.md, then the commit and the SHA-256 (tools/ci_release.py).
# Runner: the project's own self-hosted Forgejo runner on git.dsii.uk (label dsii; Docker-in-Docker).
name: build
on:
push:
branches: [main, ci]
tags: ['v*']
workflow_dispatch:
jobs:
build:
runs-on: dsii
container:
image: ghcr.io/catthehacker/ubuntu:act-24.04
steps:
- uses: actions/checkout@v4
- name: Install clang 20 and lld 20 (Ubuntu 24.04 packages)
run: |
apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends clang-20 lld-20 >/dev/null
- name: Toolchain cache key
id: key
run: echo "key=$(python3 tools/ci_build.py --cache-key)" >> "$GITHUB_OUTPUT"
- name: Cache the MSVC CRT + Windows SDK
uses: actions/cache@v4
with:
path: build/ci-toolchain
key: ${{ steps.key.outputs.key }}
- name: Build
run: |
case "$GITHUB_REF" in
refs/tags/v*) python3 tools/ci_build.py --project se2 --version "$GITHUB_REF_NAME" ;;
*) python3 tools/ci_build.py --project se2 ;;
esac
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: SE2-Revival
path: |
dist/SE2-Revival.zip
dist/SE2-Revival.zip.sha256
- name: Publish release
if: startsWith(github.ref, 'refs/tags/v')
env:
# PACKAGES_TOKEN (a repository secret) needs the write:repository scope to create releases; without it
# the workflow's own token is used instead (tools/ci_release.py says which one it used).
RELEASE_TOKEN: ${{ secrets.PACKAGES_TOKEN }}
RELEASE_TOKEN_FALLBACK: ${{ secrets.GITHUB_TOKEN }}
run: >-
python3 tools/ci_release.py --notes .forgejo/release-notes.md "${{ github.ref_name }}"
dist/SE2-Revival.zip dist/SE2-Revival.zip.sha256