From 57b26ced413c83b6cfae3821de918cf4746d0415 Mon Sep 17 00:00:00 2001 From: tmp64 Date: Tue, 15 Aug 2023 20:28:35 +0700 Subject: [PATCH] CI: Use the new build script --- .github/workflows/ci.yml | 86 ++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 56 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46e68d9..50e71c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,67 +9,41 @@ on: schedule: - cron: '0 0 1 * *' -env: - # Path to the solution file relative to the root of the project. - SOLUTION_FILE_PATH: msvc/weaponmod.sln - - # Configuration type to build. - # You can convert this to a build matrix if you need coverage of multiple configuration types. - # https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - BUILD_CONFIGURATION: Release - jobs: - linux: - name: Linux-x86 - runs-on: ubuntu-latest + build: + strategy: + matrix: + runs-on: [windows-2019, ubuntu-20.04] + + # The type of runner that the job will run on + runs-on: ${{ matrix.runs-on }} + + # Steps represent a sequence of tasks that will be executed as part of the job steps: - - name: Checkout - uses: actions/checkout@v2.3.4 - - - name: Save Git info into variables - id: vars - shell: bash - run: | - echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - - name: Update system - run: sudo apt update - - name: Install G++ (multilib) - run: sudo apt install -y g++-multilib - - name: Build - run: CFG=${{env.BUILD_CONFIGURATION}} make - - name: Deploy - uses: actions/upload-artifact@v2.2.4 + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v3.3.0 with: - name: weaponmod-linux-${{ steps.vars.outputs.sha_short }} - path: | - Release/weaponmod_amxx_i386.so - win32: - name: Win32 - runs-on: windows-2019 - steps: - - uses: actions/checkout@v2 - - - name: Save Git info into variables - id: vars - shell: bash + submodules: recursive + + - name: Set up Python 3.8 + uses: actions/setup-python@v4.5.0 + with: + python-version: 3.8 + + - name: Install Ubuntu packages + if: matrix.runs-on == 'ubuntu-20.04' run: | - echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" - echo "::set-output name=sha_short::$(git rev-parse --short HEAD)" - - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1 + sudo dpkg --add-architecture i386 + sudo apt update || true + sudo apt install -y libc6:i386 ninja-build gcc-9-multilib g++-9-multilib libssl1.1:i386 libssl-dev:i386 zlib1g-dev:i386 - - name: Build - working-directory: ${{env.GITHUB_WORKSPACE}} - # Add additional options to the MSBuild command line here (like platform or verbosity level). - # See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference - run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} + - name: Build release + id: build + run: | + python ./scripts/build_release.py --build-type release --vs 2019 --toolset v141_xp --linux-compiler gcc-9 --out-dir ./_build_out --cmake-args="-DWARNINGS_ARE_ERRORS=ON" --github-actions - name: Upload build result - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3.1.2 with: - name: weaponmod-windows-${{ steps.vars.outputs.sha_short }} - path: | - msvc/Release/weaponmod_amxx.dll - msvc/Release/weaponmod_amxx.pdb + name: ${{ steps.build.outputs.artifact_name }} + path: ./_build_out/WeaponMod-*.zip