Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 0 additions & 59 deletions .github/workflows/win32.yml

This file was deleted.

61 changes: 0 additions & 61 deletions .github/workflows/win64.yml

This file was deleted.

65 changes: 65 additions & 0 deletions .github/workflows/win_mingw.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Testbuild for x86 and x86_64 Windows with MinGW
on:
push:
branches:
- 'master'
pull_request:
types:
- edited
- opened
- synchronize
concurrency:
# Cancel concurrent workflows for the same PR or commit hash.
group: ${{github.workflow}}-${{github.event_name == 'pull_request' && github.head_ref || github.sha}}
cancel-in-progress: true
jobs:
build:
runs-on: windows-latest
permissions:
actions: read
contents: read
strategy:
fail-fast: false
# Abuse the build matrix to hack around inconsistent naming.
matrix:
include:
- arch: x86
family: i686
winapi: win32
- arch: x64
family: x86_64
winapi: win64
name: win_buildenv_${{matrix.winapi}}
steps:
- name: Check out repository code
uses: actions/checkout@v7
- name: Setup build environment
shell: bash
run: |
curl -o makebuildenv.sh https://raw.githubusercontent.com/yquake2/yquake2/refs/heads/master/stuff/winbuild/makebuildenv.sh
chmod +x makebuildenv.sh
./makebuildenv.sh buildenv
echo "${GITHUB_WORKSPACE}/buildenv/w64devkit-${{matrix.arch}}/bin/" >> ${GITHUB_PATH}
- name: Build
shell: sh -l {0}
run: |
cd ${GITHUB_WORKSPACE}
# Public runners come with 4 CPUs.
make -j4
- name: Create testbuild package
shell: bash
run: |
# Create release directory tree
mkdir -p publish/quake2-ctf-${{matrix.winapi}}-${{github.sha}}/misc/docs
# Copy release assets
cp -r release/* publish/quake2-ctf-${{matrix.winapi}}-${{github.sha}}/
# Copy misc assets
cp CHANGELOG publish/quake2-ctf-${{matrix.winapi}}-${{github.sha}}/misc/docs/CHANGELOG.txt
cp LICENSE publish/quake2-ctf-${{matrix.winapi}}-${{github.sha}}/misc/docs/LICENSE.txt
cp README.md publish/quake2-ctf-${{matrix.winapi}}-${{github.sha}}/misc/docs/README.txt
- name: Upload testbuild package
uses: actions/upload-artifact@v7
with:
name: quake2-ctf-${{matrix.winapi}}-${{github.sha}}
path: publish/
if-no-files-found: error
30 changes: 7 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,24 +58,19 @@ ifeq ($(wildcard $(CONFIG_FILE)), $(CONFIG_FILE))
include $(CONFIG_FILE)
endif

# ----------

# Normalize QUIET value to either "x" or ""
ifdef QUIET
override QUIET := "x"
else
override QUIET := ""
endif

# Detect the OS
ifdef SystemRoot
YQ2_OSTYPE ?= Windows
else
YQ2_OSTYPE ?= $(shell uname -s)
endif
# ----------

# Special case for MinGW
ifneq (,$(findstring MINGW,$(YQ2_OSTYPE)))
YQ2_OSTYPE := Windows
endif
# Detect the OS, normalize some abiguous YQ2_OSTYPE strings.
YQ2_OSTYPE ?= $(shell uname -s | sed -e 's/MINGW.*/Windows/' -e 's/Windows.*/Windows/')

# Detect the architecture
ifeq ($(YQ2_OSTYPE), Windows)
Expand All @@ -86,28 +81,17 @@ else # i686-w64-mingw32
YQ2_ARCH ?= i386
endif
else # windows, but MINGW_CHOST not defined
ifdef PROCESSOR_ARCHITEW6432
# 64 bit Windows
YQ2_ARCH ?= $(PROCESSOR_ARCHITEW6432)
else
# 32 bit Windows
YQ2_ARCH ?= $(PROCESSOR_ARCHITECTURE)
endif
YQ2_ARCH ?= $(shell uname -m | sed -e 's/i.86/i386/')
endif # windows but MINGW_CHOST not defined
else
ifneq ($(YQ2_OSTYPE), Darwin)
# Normalize some abiguous YQ2_ARCH strings
YQ2_ARCH ?= $(shell uname -m | sed -e 's/i.86/i386/' -e 's/amd64/x86_64/' -e 's/^arm.*/arm/')
YQ2_ARCH ?= $(shell uname -m | sed -e 's/i.86/i386/' -e 's/amd64/x86_64/' -e 's/arm64/aarch64/' -e 's/^arm.*/arm/')
else
YQ2_ARCH ?= $(shell uname -m)
endif
endif

# On Windows / MinGW $(CC) is undefined by default.
ifeq ($(YQ2_OSTYPE),Windows)
CC ?= gcc
endif

# Detect the compiler
ifeq ($(shell $(CC) -v 2>&1 | grep -c "clang version"), 1)
COMPILER := clang
Expand Down
Loading