replaced libpq pointers with safe unique ptrs #37
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
paths: | |
- '**.hpp' | |
- '**.h' | |
- '**.cpp' | |
- '**.c' | |
- '**.cmake' | |
- '**.txt' | |
- '**.json' | |
- '.github/workflows/build.yml' | |
workflow_dispatch: | |
env: | |
GIT_BRANCH: ${{ github.ref_type == 'branch' && github.ref_name || 'release' }} | |
BUILD_TYPE: RelWithDebInfo | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [windows-latest, ubuntu-20.04] | |
arch: [x64, x86] | |
include: | |
- os: windows-latest | |
arch: x64 | |
CMAKE_ARCH_FLAG: --preset=x64-windows | |
- os: windows-latest | |
arch: x86 | |
CMAKE_ARCH_FLAG: --preset=x86-windows | |
- os: ubuntu-20.04 | |
arch: x64 | |
CMAKE_ARCH_FLAG: --preset=x64-linux | |
- os: ubuntu-20.04 | |
arch: x86 | |
CMAKE_ARCH_FLAG: --preset=x86-linux | |
- os: macos-13 | |
arch: x64 | |
CMAKE_ARCH_FLAG: --preset=x64-macos | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: lukka/get-cmake@latest | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: lukka/run-vcpkg@v11 | |
- name: Install dependencies Ubuntu x86 | |
if: ${{ matrix.os == 'ubuntu-20.04' && matrix.arch == 'x86' }} | |
run: | | |
sudo apt update | |
sudo apt install gcc-multilib g++-multilib | |
- name: Download garrysmod_common | |
uses: actions/checkout@v4 | |
with: | |
repository: dankmolot/garrysmod_common | |
ref: ${{ matrix.arch == 'x64' && 'x86-64-cmake' || 'master-cmake' }} | |
submodules: recursive | |
path: third-party/garrysmod_common | |
- name: Configure project | |
run: cmake ${{matrix.CMAKE_ARCH_FLAG}} -DGARRYSMOD_COMMON_PATH="third-party/garrysmod_common" -DAUTOINSTALL="." -DGIT_BRANCH="${{env.GIT_BRANCH}}" -DCMAKE_BUILD_TYPE="${{env.BUILD_TYPE}}" | |
- name: Build project | |
run: cmake --build build -j -t async_postgres --config ${{env.BUILD_TYPE}} | |
- name: Strip debug information from binaries and keep them outside (Ubuntu) | |
if: ${{ matrix.os == 'ubuntu-20.04' }} | |
run: | | |
find *.dll -exec objcopy --only-keep-debug {} {}.pdb \; | |
find *.dll -exec objcopy --strip-debug {} \; | |
find *.dll -exec objcopy --add-gnu-debuglink {}.pdb {} \; | |
- name: "Upload artifacts" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{matrix.os}}-${{matrix.arch}}-${{env.BUILD_TYPE}} | |
path: | | |
./*.dll | |
# ./*.pdb | |
if-no-files-found: error |