s1lentq bb5152db0b CI Build remove unittest
Fix linux compile
2023-01-09 20:59:46 +07:00

176 lines
4.9 KiB
YAML

name: C/C++ CI
on:
push:
branches: [experimental_with_safe_pointer, master]
paths-ignore:
- '**.md'
pull_request:
types: [opened, reopened, synchronize]
release:
types: [published]
jobs:
windows:
name: 'Windows'
runs-on: windows-2019
env:
solution: 'msvc/ReGameDLL.sln'
buildPlatform: 'Win32'
buildRelease: 'Release'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Nuget
uses: nuget/setup-nuget@v1
with:
nuget-api-key: ${{ secrets.NuGetAPIKey }}
nuget-version: '5.x'
- run: nuget restore '${{ env.solution }}'
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.0.2
with:
vs-version: '16.8'
- name: Build
run: |
msbuild ${{ env.solution }} -p:Configuration="${{ env.buildRelease }}" /t:Clean,Build /p:Platform=${{ env.buildPlatform }} /p:PlatformToolset=v140_xp /p:XPDeprecationWarning=false
- name: Move files
run: |
mkdir publish\debug
mkdir publish\bin\win32\cstrike\dlls
move msvc\${{ env.buildRelease }}\mp.dll publish\bin\win32\cstrike\dlls\mp.dll
move msvc\${{ env.buildRelease }}\mp.pdb publish\debug\mp.pdb
- name: Deploy artifacts
uses: actions/upload-artifact@v2
with:
name: win32
path: publish/*
linux:
name: 'Linux'
runs-on: ubuntu-latest
container: s1lentq/linux86buildtools:latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
- name: Build using Intel C++ Compiler 19.0
run: |
rm -rf build-icc && CC=icc CXX=icpc cmake -B build-icc && cmake --build build-icc -j8
- name: Build using GCC Compiler 9.3
run: |
rm -rf build-gcc && CC=gcc CXX=g++ cmake -B build-gcc && cmake --build build-gcc -j8
- name: Prepare CSSDK
run: |
mkdir -p publish/cssdk
rsync -a regamedll/extra/cssdk/ publish/cssdk/ --exclude=.git --exclude=LICENSE --exclude=README.md
- name: Move files
run: |
mkdir -p publish/bin/linux32/cstrike/dlls
mv build-icc/regamedll/cs.so publish/bin/linux32/cstrike/dlls/cs.so
mv build-gcc/regamedll/cs.so publish/cs-gcc.so
mv regamedll/version/appversion.h publish/appversion.h
mv dist/ publish/
- name: Run GLIBC/ABI version compat test
run: |
binaries=(
"publish/bin/linux32/cstrike/dlls/cs.so"
"publish/cs-gcc.so"
)
bash ./regamedll/version/glibc_test.sh ${binaries[@]}
if [[ $? -ne 0 ]]; then
exit 1 # Assertion failed
fi
shell: bash
- name: Deploy artifacts
uses: actions/upload-artifact@v2
id: upload-job
with:
name: linux32
path: publish/*
- name: Cleanup temporary artifacts
if: success() && steps.upload-job.outcome == 'success'
run: |
rm -rf cssdk
rm -f appversion.h
publish:
name: 'Publish'
runs-on: ubuntu-latest
needs: [windows, linux]
steps:
- name: Deploying linux artifacts
uses: actions/download-artifact@v2
with:
name: linux32
- name: Deploying windows artifacts
uses: actions/download-artifact@v2
with:
name: win32
- name: Reading appversion.h
run: |
if [ -e appversion.h ]; then
APP_VERSION=$(cat appversion.h | grep -wi '#define APP_VERSION_STRD' | sed -e 's/#define APP_VERSION_STRD[ \t\r\n\v\f]\+\(.*\)/\1/i' -e 's/\r//g')
if [ $? -ne 0 ]; then
APP_VERSION=""
else
# Remove quotes
APP_VERSION=$(echo $APP_VERSION | xargs)
echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_ENV
fi
fi
rm -f appversion.h
- name: Packaging binaries
id: packaging-job
if: |
github.event_name == 'release' &&
github.event.action == 'published' &&
startsWith(github.ref, 'refs/tags/')
run: |
rsync -a dist/ bin/win32/cstrike
rsync -a dist/ bin/linux32/cstrike
7z a -tzip regamedll-bin-${{ env.APP_VERSION }}.zip bin/ cssdk/
- name: Publish artifacts
uses: softprops/action-gh-release@v1
id: publish-job
if: |
startsWith(github.ref, 'refs/tags/') &&
steps.packaging-job.outcome == 'success'
with:
files: |
*.zip
env:
GITHUB_TOKEN: ${{ secrets.API_TOKEN }}
- name: Cleanup temporary artifacts
if: success() && steps.publish-job.outcome == 'success'
run: |
rm -rf bin dist debug cssdk
rm -f *.zip appversion.h