Fix crash? #34
This file contains hidden or 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: | |
| paths-ignore: | |
| - LICENSE | |
| - README.md | |
| pull_request: | |
| paths-ignore: | |
| - LICENSE | |
| - README.md | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build on ${{ matrix.os_short }} | |
| runs-on: ${{ matrix.os }} | |
| container: ${{ matrix.container }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, windows-latest] | |
| include: | |
| - os: ubuntu-latest | |
| os_short: linux | |
| container: registry.gitlab.steamos.cloud/steamrt/sniper/sdk | |
| - os: windows-latest | |
| os_short: win | |
| steps: | |
| - name: Install dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y clang-16 python3-pip | |
| ln -sf /usr/bin/clang-16 /usr/bin/clang && ln -sf /usr/bin/clang++-16 /usr/bin/clang++ | |
| echo "CC=clang" >> $GITHUB_ENV | |
| echo "CXX=clang++" >> $GITHUB_ENV | |
| clang --version | |
| clang++ --version | |
| - name: Install AMBuild | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel | |
| pip install git+https://github.com/alliedmodders/ambuild | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| path: project | |
| submodules: recursive | |
| - name: Checkout CS2 SDK | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: alliedmodders/hl2sdk | |
| ref: cs2 | |
| path: hl2sdk-cs2 | |
| - name: Checkout Metamod:Source | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: alliedmodders/metamod-source | |
| ref: master | |
| path: metamod-source | |
| submodules: recursive | |
| - name: Build | |
| working-directory: project | |
| shell: bash | |
| run: | | |
| mkdir build && cd build | |
| python ../configure.py --enable-optimize --sdks=cs2 --targets=x86_64 --hl2sdk-manifests=./hl2sdk-manifests | |
| ambuild | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ runner.os }} | |
| path: project/build/package | |
| release: | |
| name: Release | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| - name: Package | |
| run: | | |
| 7z a -mx9 linux.zip ./Linux/* | |
| 7z a -mx9 windows.zip ./Windows/* | |
| - name: Release | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: '*.zip' | |
| tag: ${{ github.ref }} | |
| file_glob: true |