# 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 . # # @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 nasm tree - 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: Setup TDM-GCC run: | Write-Host Downloading TDM-GCC v10.3.0... Invoke-WebRequest -Uri 'https://github.com/jmeubank/tdm-gcc/releases/download/v10.3.0-tdm64-2/tdm64-gcc-10.3.0-2.exe' -OutFile 'C:\Windows\temp\TDM-GCC-64.exe' Write-Host Creating directory... New-Item -ItemType Directory -Path 'C:\TDM-GCC-64' Write-Host Copying files [Set 1/3]... Start-Process '7z' -ArgumentList 'e C:\Windows\temp\TDM-GCC-64.exe -oC:\TDM-GCC-64 -y' -Wait Write-Host Copying files [Set 2/3]... Start-Process '7z' -ArgumentList 'e C:\TDM-GCC-64\*.tar.xz -oC:\TDM-GCC-64 -y' -Wait Write-Host Copying files [Set 3/3]... Start-Process '7z' -ArgumentList 'x C:\TDM-GCC-64\*.tar -oC:\TDM-GCC-64 -y' -Wait Write-Host Adding environment variables... $env:PATH = 'C:\TDM-GCC-64\bin;' + $env:PATH [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine) - name: Build OpenSSL 64-bit (if not cached) if: steps.cache-openssl.outputs.cache-hit != 'true' shell: msys2 {0} run: | export PATH="/c/TDM-GCC-64/bin:$PATH" export OPENSSL_PREFIX="$(pwd)/openssl-install-64" echo "OPENSSL_PREFIX is: $OPENSSL_PREFIX" 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_sw tree $OPENSSL_PREFIX - name: Checkout Source Tree uses: actions/checkout@v4 - name: Configure UMSKT (TDM-GCC 64-bit) shell: pwsh run: | $env:PATH = 'C:\TDM-GCC-64\bin;' + $env:PATH $OPENSSL_ROOT = "$env:GITHUB_WORKSPACE/openssl-install-64" $OPENSSL_LIB = "$OPENSSL_ROOT/lib64" $OPENSSL_INC = "$OPENSSL_ROOT/include" Get-ChildItem -Recurse $OPENSSL_ROOT cmake -G "MinGW Makefiles" ` -DCMAKE_C_COMPILER="gcc" ` -DCMAKE_CXX_COMPILER="g++" ` -DOPENSSL_ROOT_DIR="$OPENSSL_ROOT" ` -DOPENSSL_INCLUDE_DIR="$OPENSSL_INC" ` -DOPENSSL_CRYPTO_LIBRARY="$OPENSSL_LIB/libcrypto.a" ` -DOPENSSL_SSL_LIBRARY="$OPENSSL_LIB/libssl.a" ` -DCMAKE_C_FLAGS="-m64" ` -DCMAKE_CXX_FLAGS="-m64" ` . - name: Build UMSKT (TDM-GCC 64-bit) shell: pwsh run: | $env:PATH = 'C:\TDM-GCC-64\bin;' + $env:PATH mingw32-make - name: Upload build artifact uses: actions/upload-artifact@v4.6.2 with: name: UMSKT-TDM64 path: ./Release/* # 32-bit support will happen when everything's all good