Skip to content

Commit

Permalink
Merge pull request #935 from qw-ctf/ci
Browse files Browse the repository at this point in the history
Switch Windows builds to cmake / mingw.
  • Loading branch information
dsvensson authored Sep 15, 2024
2 parents 63dfbf1 + 20a4b3c commit a7f5bf1
Show file tree
Hide file tree
Showing 26 changed files with 200 additions and 6,346 deletions.
26 changes: 0 additions & 26 deletions .config_windows

This file was deleted.

27 changes: 0 additions & 27 deletions .config_windows-clang

This file was deleted.

69 changes: 28 additions & 41 deletions .github/workflows/build-and-deploy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ on:
jobs:
windows-build:
if: github.repository == 'QW-Group/ezquake-source'
runs-on: windows-latest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [windows-multi-x64]
include:
- target: windows-multi-x64
config: rls-all
- config: rls-all
platform: x64
triplet: x64-windows-static

Expand All @@ -21,60 +19,49 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Setup vcpkg (it does not install any package yet)
uses: lukka/run-vcpkg@v11

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1

- name: Build txt2c
run: msbuild misc\vstudio\txt2c\txt2c.vcxproj -t:rebuild -property:Configuration=Release

- name: Make dir
run: mkdir .vs
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq --no-install-recommends cmake ninja-build binutils-mingw-w64-x86-64 gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64
- name: Copy txt2c
run: cp misc\vstudio\txt2c\.vs\txt2c.exe .vs\
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11

- name: Build ezquake
run: msbuild ezQuake.vcxproj -t:rebuild -property:Configuration=${{ matrix.config }} -property:Platform=${{ matrix.platform }} -property:VcpkgEnableManifest=true
env:
VcpkgConfiguration: Release
VcpkgTriplet: ${{ matrix.triplet }}
- name: Run CMake
uses: lukka/run-cmake@v10
with:
configurePreset: mingw64-${{ matrix.platform }}-cross
buildPreset: mingw64-${{ matrix.platform }}-cross-release

- name: Create checksum
run: |
md5sum .vs\${{ matrix.platform }}\${{ matrix.config }}\Output\ezQuake.exe > .vs\${{ matrix.platform }}\${{ matrix.config }}\Output\ezQuake.md5
- name: Invoke msys
uses: msys2/setup-msys2@v2
with:
install: openssh
md5sum ezquake.exe > ezquake.md5
- name: Setup SSH
shell: msys2 {0}
env:
SSH_AUTH_SOCK: C:\ssh_agent.sock
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
shell: bash
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
- name: Set date
shell: msys2 {0}
shell: bash
run: |
export TZ=CET-1CEST
echo "DATE=$(date "+%Y%m%d-%H%M%S")" >> $GITHUB_ENV
export TZ=CET-1CEST
echo "DATE=$(date "+%Y%m%d-%H%M%S")" >> $GITHUB_ENV
- name: Deploy
shell: msys2 {0}
env:
SSH_AUTH_SOCK: C:\ssh_agent.sock
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
shell: bash
run: |
mkdir -p upload/releases/${{ github.ref_name }}/windows/${{ matrix.platform }}/${{ matrix.config }}
mkdir -p upload/releases/latest/windows/${{ matrix.platform }}/${{ matrix.config }}
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.exe upload/releases/${{ github.ref_name }}/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.exe
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.md5 upload/releases/${{ github.ref_name }}/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.md5
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.exe upload/releases/latest/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.exe
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.md5 upload/releases/latest/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.md5
cp ezquake.exe upload/releases/${{ github.ref_name }}/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.exe
cp ezquake.md5 upload/releases/${{ github.ref_name }}/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.md5
cp ezquake.exe upload/releases/latest/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.exe
cp ezquake.md5 upload/releases/latest/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.md5
sftp -rp -o 'StrictHostKeyChecking no' -o 'UserKnownHostsFile /dev/null' -P ${{ secrets.SFTP_PORT }} ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:/releases <<< $'put -rp upload/releases/*'
linux-build:
Expand Down
71 changes: 29 additions & 42 deletions .github/workflows/build-and-deploy-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,76 +3,63 @@ on: [push]
jobs:
windows-build:
if: github.repository == 'QW-Group/ezquake-source'
runs-on: windows-latest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [windows-multi-x64]
include:
- target: windows-multi-x64
config: rls-all
- config: rls-all
platform: x64
triplet: x64-windows-static

steps:
- name: Check out code
uses: actions/checkout@v4
with:
submodules: true

- name: Setup vcpkg (it does not install any package yet)
uses: lukka/run-vcpkg@v11

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1
submodules: true
fetch-depth: 0

- name: Build txt2c
run: msbuild misc\vstudio\txt2c\txt2c.vcxproj -t:rebuild -property:Configuration=Release

- name: Make dir
run: mkdir .vs
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq --no-install-recommends cmake ninja-build binutils-mingw-w64-x86-64 gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64
- name: Copy txt2c
run: cp misc\vstudio\txt2c\.vs\txt2c.exe .vs\
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11

- name: Build ezquake
run: msbuild ezQuake.vcxproj -t:rebuild -property:Configuration=${{ matrix.config }} -property:Platform=${{ matrix.platform }} -property:VcpkgEnableManifest=true
env:
VcpkgConfiguration: Release
VcpkgTriplet: ${{ matrix.triplet }}
- name: Run CMake
uses: lukka/run-cmake@v10
with:
configurePreset: mingw64-${{ matrix.platform }}-cross
buildPreset: mingw64-${{ matrix.platform }}-cross-release

- name: Create checksum
run: |
md5sum .vs\${{ matrix.platform }}\${{ matrix.config }}\Output\ezQuake.exe > .vs\${{ matrix.platform }}\${{ matrix.config }}\Output\ezQuake.md5
- name: Invoke msys
uses: msys2/setup-msys2@v2
with:
install: openssh
md5sum ezquake.exe > ezquake.md5
- name: Setup SSH
shell: msys2 {0}
env:
SSH_AUTH_SOCK: C:\ssh_agent.sock
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
shell: bash
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
- name: Set date
shell: msys2 {0}
shell: bash
run: |
export TZ=CET-1CEST
echo "DATE=$(date "+%Y%m%d-%H%M%S")" >> $GITHUB_ENV
export TZ=CET-1CEST
echo "DATE=$(date "+%Y%m%d-%H%M%S")" >> $GITHUB_ENV
- name: Deploy
shell: msys2 {0}
env:
SSH_AUTH_SOCK: C:\ssh_agent.sock
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
shell: bash
run: |
mkdir -p upload/snapshots/windows/${{ matrix.platform }}/${{ matrix.config }}
mkdir -p upload/snapshots/latest/windows/${{ matrix.platform }}/${{ matrix.config }}
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.exe upload/snapshots/windows/${{ matrix.platform }}/${{ matrix.config }}/${{ env.DATE }}_${GITHUB_SHA::7}_ezquake.exe
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.md5 upload/snapshots/windows/${{ matrix.platform }}/${{ matrix.config }}/${{ env.DATE }}_${GITHUB_SHA::7}_ezquake.md5
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.exe upload/snapshots/latest/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.exe
cp .vs/${{ matrix.platform }}/${{ matrix.config }}/Output/ezQuake.md5 upload/snapshots/latest/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.md5
cp ezquake.exe upload/snapshots/windows/${{ matrix.platform }}/${{ matrix.config }}/${{ env.DATE }}_${GITHUB_SHA::7}_ezquake.exe
cp ezquake.md5 upload/snapshots/windows/${{ matrix.platform }}/${{ matrix.config }}/${{ env.DATE }}_${GITHUB_SHA::7}_ezquake.md5
cp ezquake.exe upload/snapshots/latest/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.exe
cp ezquake.md5 upload/snapshots/latest/windows/${{ matrix.platform }}/${{ matrix.config }}/ezquake.md5
sftp -rp -o 'StrictHostKeyChecking no' -o 'UserKnownHostsFile /dev/null' -P ${{ secrets.SFTP_PORT }} ${{ secrets.SFTP_USERNAME }}@${{ secrets.SFTP_HOST }}:/snapshots <<< $'put -rp upload/snapshots/*'
linux-build:
Expand Down
63 changes: 37 additions & 26 deletions .github/workflows/build-targets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,49 +2,45 @@ name: build targets
on: [push, pull_request, workflow_dispatch]
jobs:
windows-build:
runs-on: windows-latest
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target: [windows-multi-x64]
include:
- target: windows-multi-x64
config: rls-all
platform: x64
triplet: x64-windows-static
- target: x64

steps:
- name: Check out code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Setup vcpkg (it does not install any package yet)
uses: lukka/run-vcpkg@v11

- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v1.1

- name: Build txt2c
run: msbuild misc\vstudio\txt2c\txt2c.vcxproj -t:rebuild -property:Configuration=Release
- name: Fetch upstream tags for version metadata
run: |
git remote add upstream https://github.com/QW-Group/ezquake-source.git
git fetch --tags --no-recurse-submodules upstream
if: github.repository != 'QW-Group/ezquake-source'

- name: Make dir
run: mkdir .vs
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq --no-install-recommends cmake ninja-build binutils-mingw-w64-x86-64 gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64
- name: Copy txt2c
run: cp misc\vstudio\txt2c\.vs\txt2c.exe .vs\
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11

- name: Build ezquake
run: msbuild ezQuake.vcxproj -t:rebuild -property:Configuration=${{ matrix.config }} -property:Platform=${{ matrix.platform }} -property:VcpkgEnableManifest=true
env:
VcpkgConfiguration: Release
VcpkgTriplet: ${{ matrix.triplet }}
- name: Run CMake
uses: lukka/run-cmake@v10
with:
configurePreset: mingw64-${{ matrix.target }}-cross
buildPreset: mingw64-${{ matrix.target }}-cross-release

- name: Archive client
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: .vs\${{ matrix.platform }}\${{ matrix.config }}\Output\ezQuake.exe
name: windows-multi-${{ matrix.target }}
path: ezquake.exe

macos-build:
runs-on: macos-latest
Expand All @@ -56,6 +52,13 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Fetch upstream tags for version metadata
run: |
git remote add upstream https://github.com/QW-Group/ezquake-source.git
git fetch --tags --no-recurse-submodules upstream
if: github.repository != 'QW-Group/ezquake-source'

- name: Install macOS build dependencies
run: brew install -q autoconf automake libtool
Expand Down Expand Up @@ -124,7 +127,7 @@ jobs:
path: ezQuake.zip
compression-level: 9

linux-build:
appimage-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -145,6 +148,14 @@ jobs:
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0

- name: Fetch upstream tags for version metadata
run: |
git config --global --add safe.directory '*' # container build workaround
git remote add upstream https://github.com/QW-Group/ezquake-source.git
git fetch --tags --no-recurse-submodules upstream
if: github.repository != 'QW-Group/ezquake-source'

- name: Build
run: git config --global --add safe.directory $PWD && ./misc/appimage/appimage-manual_creation.sh
Expand Down
Loading

0 comments on commit a7f5bf1

Please sign in to comment.