54 lines
2.1 KiB
YAML
54 lines
2.1 KiB
YAML
# Builds the player package (DS2Revival.zip) 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 DS2Revival.zip and
|
|
# DS2Revival.zip.sha256 attached. Cross-compiled on Linux by tools/ci_build.py: clang-cl + lld-link against
|
|
# the MSVC CRT and Windows SDK fetched by xwin, same flags as mods/build.py with MSVC on Windows.
|
|
# 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: python3 tools/ci_build.py
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: DS2Revival
|
|
path: |
|
|
dist/DS2Revival.zip
|
|
dist/DS2Revival.zip.sha256
|
|
|
|
- name: Publish release
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
env:
|
|
# PACKAGES_TOKEN needs the write:repository scope to create releases; until it has 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/DS2Revival.zip dist/DS2Revival.zip.sha256
|