160 lines
5.1 KiB
YAML
160 lines
5.1 KiB
YAML
# This file is a part of the UMSKT Project
|
|
#
|
|
# Copyleft (C) 2019-2023 UMSKT Contributors (et.al.)
|
|
#
|
|
# This program is free software: you can redistribute it and/or modify
|
|
# it under the terms of the GNU Affero General Public License as published by
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU Affero General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
#
|
|
# @FileCreated by TheTank20 on 06/13/2023
|
|
# @Maintainer Neo
|
|
|
|
name: C/C++ CI (Windows)
|
|
|
|
on:
|
|
push:
|
|
branches: [ "*" ]
|
|
paths-ignore: [ '**.md', 'doc/**', '.idea/**']
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-tdm64:
|
|
runs-on: windows-latest
|
|
env:
|
|
OPENSSL_VERSION: "3.1.8"
|
|
OPENSSL_PREFIX: "${{ github.workspace }}/openssl-install-64"
|
|
steps:
|
|
- name: Install MSYS2 and dependencies
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
update: true
|
|
install: >-
|
|
git
|
|
make
|
|
perl
|
|
mingw-w64-x86_64-gcc
|
|
mingw-w64-x86_64-pkg-config
|
|
nasm
|
|
|
|
- name: Cache OpenSSL 64-bit build
|
|
id: cache-openssl
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.OPENSSL_PREFIX }}
|
|
key: openssl-${{ env.OPENSSL_VERSION }}-msys2-mingw64
|
|
|
|
- name: Build OpenSSL 64-bit (if not cached)
|
|
if: steps.cache-openssl.outputs.cache-hit != 'true'
|
|
shell: msys2 {0}
|
|
run: |
|
|
git clone --branch openssl-${OPENSSL_VERSION} https://github.com/openssl/openssl.git
|
|
cd openssl
|
|
./Configure mingw64 no-shared --prefix="${OPENSSL_PREFIX}"
|
|
make -j$(nproc)
|
|
make install
|
|
|
|
- name: Checkout Source Tree
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Configure UMSKT (TDM-GCC 64-bit)
|
|
shell: msys2 {0}
|
|
run: |
|
|
cmake -G "MinGW Makefiles" \
|
|
-DCMAKE_C_COMPILER="mingw-w64-x86_64-gcc" \
|
|
-DCMAKE_CXX_COMPILER="mingw-w64-x86_64-g++" \
|
|
-DOPENSSL_ROOT_DIR="${OPENSSL_PREFIX}" \
|
|
-DOPENSSL_INCLUDE_DIR="${OPENSSL_PREFIX}/include" \
|
|
-DOPENSSL_CRYPTO_LIBRARY="${OPENSSL_PREFIX}/lib/libcrypto.a" \
|
|
-DOPENSSL_SSL_LIBRARY="${OPENSSL_PREFIX}/lib/libssl.a" \
|
|
-DCMAKE_C_FLAGS="-m64" \
|
|
-DCMAKE_CXX_FLAGS="-m64" \
|
|
.
|
|
|
|
- name: Build UMSKT (TDM-GCC 64-bit)
|
|
shell: msys2 {0}
|
|
run: make
|
|
|
|
- name: Upload build artifact
|
|
uses: actions/upload-artifact@v4.6.2
|
|
with:
|
|
name: UMSKT-TDM64
|
|
path: ./Release/*
|
|
|
|
build-tdm32:
|
|
runs-on: windows-latest
|
|
env:
|
|
OPENSSL_VERSION: "3.1.8"
|
|
OPENSSL_PREFIX: "${{ github.workspace }}/openssl-install-32"
|
|
steps:
|
|
- name: Install MSYS2 and dependencies
|
|
uses: msys2/setup-msys2@v2
|
|
with:
|
|
update: true
|
|
install: >-
|
|
git
|
|
make
|
|
perl
|
|
mingw-w64-i686-gcc
|
|
nasm
|
|
|
|
- name: Download and Install TDM-GCC-64
|
|
run: |
|
|
Invoke-WebRequest -Uri "https://jmeubank.github.io/tdm-gcc/download/tdm64-gcc-10.3.0.exe" -OutFile "$env:TEMP\tdm64-gcc.exe"
|
|
Start-Process -FilePath "$env:TEMP\tdm64-gcc.exe" -ArgumentList "/VERYSILENT", "/DIR=C:\TDM-GCC-64" -Wait
|
|
|
|
- name: Cache OpenSSL 32-bit build
|
|
id: cache-openssl
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ${{ env.OPENSSL_PREFIX }}
|
|
key: openssl-${{ env.OPENSSL_VERSION }}-msys2-tdmgcc32
|
|
|
|
- name: Build OpenSSL 32-bit (if not cached)
|
|
if: steps.cache-openssl.outputs.cache-hit != 'true'
|
|
shell: msys2 {0}
|
|
run: |
|
|
export PATH="/c/TDM-GCC-64/bin:$PATH"
|
|
git clone --branch openssl-${OPENSSL_VERSION} https://github.com/openssl/openssl.git
|
|
cd openssl
|
|
./Configure mingw no-shared --prefix="${OPENSSL_PREFIX}" CFLAGS="-m32" CXXFLAGS="-m32"
|
|
make -j$(nproc)
|
|
make install
|
|
|
|
- name: Checkout Source Tree
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Configure UMSKT (TDM-GCC 32-bit)
|
|
shell: msys2 {0}
|
|
run: |
|
|
export PATH="/c/TDM-GCC-64/bin:$PATH"
|
|
cmake -G "MinGW Makefiles" \
|
|
-DCMAKE_C_COMPILER="gcc" \
|
|
-DCMAKE_CXX_COMPILER="g++" \
|
|
-DOPENSSL_ROOT_DIR="${OPENSSL_PREFIX}" \
|
|
-DOPENSSL_INCLUDE_DIR="${OPENSSL_PREFIX}/include" \
|
|
-DOPENSSL_CRYPTO_LIBRARY="${OPENSSL_PREFIX}/lib/libcrypto.a" \
|
|
-DOPENSSL_SSL_LIBRARY="${OPENSSL_PREFIX}/lib/libssl.a" \
|
|
-DCMAKE_C_FLAGS="-m32" \
|
|
-DCMAKE_CXX_FLAGS="-m32" \
|
|
.
|
|
|
|
- name: Build UMSKT (TDM-GCC 32-bit)
|
|
shell: msys2 {0}
|
|
run: |
|
|
export PATH="/c/TDM-GCC-64/bin:$PATH"
|
|
make
|
|
|
|
- name: Upload build artifact
|
|
uses: actions/upload-artifact@v4.6.2
|
|
with:
|
|
name: UMSKT-TDM32
|
|
path: ./Release/* |