/ .github / workflows / build.yml
build.yml
  1  name: Build
  2  
  3  on:
  4    push:
  5      branches: [master]
  6    pull_request: {}
  7    merge_group: {}
  8    workflow_dispatch:
  9  
 10  concurrency:
 11    group: ${{ github.workflow }}-${{ github.ref }}
 12    cancel-in-progress: true
 13  
 14  jobs:
 15  
 16    build-windows:
 17      strategy:
 18        fail-fast: false
 19        matrix:
 20          include:
 21            - name: x86_64 GCC
 22              ref: master
 23              sys: mingw64
 24              env: x86_64
 25              opt: SDLCONFIG=
 26              additional-cmd: cp -a ./package/updater/w64/notbloodupdate ./upload/notbloodupdate.exe
 27              zipname: win64
 28            - name: i686 GCC
 29              ref: master
 30              sys: mingw32
 31              env: i686
 32              pkg: nasm mingw-w64-i686-SDL
 33              opt: SDLCONFIG=
 34              additional-cmd: cp -a ./package/updater/w32/notbloodupdate ./upload/notbloodupdate.exe
 35              zipname: win32
 36            - name: i686 GCC WinXP
 37              ref: windows-xp
 38              sys: mingw32
 39              env: i686
 40              pkg: nasm sed unzip mingw-w64-i686-SDL
 41              opt: SDL_TARGET=1 USE_MIMALLOC=0 USE_OPENGL=0 NETCODE=0
 42              additional-cmd: unzip "./package/xp support files.zip" -d ./upload; echo ADVAPI32.dll\0\0\0\0 with ZDVAPI32.dll\0\0\0\0; sed -i -b -e 's/\x41\x44\x56\x41\x50\x49\x33\x32\x2E\x64\x6C\x6C\x00\x00\x00\x00/\x5A\x44\x56\x41\x50\x49\x33\x32\x2E\x64\x6C\x6C\x00\x00\x00\x00/g' ./notblood.exe; echo KERNEL32.dll\0\0\0\0 with ZERNEL32.dll\0\0\0\0; sed -i -b -e 's/\x4B\x45\x52\x4E\x45\x4C\x33\x32\x2E\x64\x6C\x6C\x00\x00\x00\x00/\x5A\x45\x52\x4E\x45\x4C\x33\x32\x2E\x64\x6C\x6C\x00\x00\x00\x00/g' ./notblood.exe; echo WS2_32.dll\0\0 with ZS2_32.dll\0\0; sed -i -b -e 's/\x57\x53\x32\x5F\x33\x32\x2E\x64\x6C\x6C\x00\x00/\x5A\x53\x32\x5F\x33\x32\x2E\x64\x6C\x6C\x00\x00/g' ./notblood.exe
 43              zipname: winxp
 44      name: Windows MSYS2 ${{matrix.name}}
 45      runs-on: windows-latest
 46      defaults:
 47        run:
 48          shell: msys2 {0}
 49      steps:
 50      - uses: actions/checkout@v4
 51        with:
 52          ref: ${{matrix.ref}}
 53      - uses: msys2/setup-msys2@v2
 54        with:
 55          msystem: ${{matrix.sys}}
 56          update: true
 57          cache: true
 58          install: git mingw-w64-${{matrix.env}}-toolchain make ${{matrix.pkg}}
 59      - name: build
 60        run: make -j$(nproc) blood ${{matrix.opt}}
 61      - name: 'prepare files for upload'
 62        run: |
 63          mkdir -p ./upload
 64          ${{matrix.additional-cmd}}
 65          cp ./notblood.exe ./upload
 66      - uses: actions/upload-artifact@v4
 67        with:
 68          name: notblood-${{matrix.zipname}}
 69          path: ./upload
 70          if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn`
 71  
 72    build-windows-msys2-testonly:
 73      strategy:
 74        fail-fast: false
 75        matrix:
 76          include:
 77            - name: x86_64 GCC without SDL
 78              sys: mingw64
 79              env: x86_64
 80              opt: RENDERTYPE=WIN
 81            - name: i686 GCC without SDL
 82              sys: mingw32
 83              env: i686
 84              opt: RENDERTYPE=WIN
 85              pkg: nasm
 86      name: Windows MSYS2 ${{matrix.name}}
 87      runs-on: windows-latest
 88      defaults:
 89        run:
 90          shell: msys2 {0}
 91      steps:
 92      - uses: actions/checkout@v4
 93      - uses: msys2/setup-msys2@v2
 94        with:
 95          msystem: ${{matrix.sys}}
 96          update: true
 97          cache: true
 98          install: git mingw-w64-${{matrix.env}}-toolchain make ${{matrix.pkg}}
 99      - name: build
100        run: make -j$(nproc) blood tools SDLCONFIG=
101  
102    build-linux:
103      strategy:
104        fail-fast: false
105        matrix:
106          include:
107            - name: GCC
108              pkg: libsdl2-dev
109              zipname: gcc
110              opt: HAVE_FLAC=0
111            - name: Clang
112              pkg: libsdl2-dev clang
113              opt: CLANG=1 HAVE_FLAC=0
114              zipname: clang
115      name: Linux ${{matrix.name}}
116      runs-on: ubuntu-latest
117      steps:
118      - uses: actions/checkout@v4
119      - name: install-prerequisites
120        run: |
121          sudo apt-get update
122          sudo apt-get -y install libvorbis-dev libflac-dev libglu1-mesa-dev libgtk2.0-dev ${{matrix.pkg}}
123      - name: build
124        run: make -j$(nproc) blood tools ${{matrix.opt}}
125      - name: 'prepare files for upload'
126        run: |
127          mkdir -p ./upload
128          cp ./notblood ./upload
129      - uses: actions/upload-artifact@v4
130        with:
131          name: notblood-linux-${{matrix.zipname}}
132          path: ./upload
133          if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` 
134  
135    build-linux-tests:
136      strategy:
137        fail-fast: false
138        matrix:
139          include:
140            - name: GCC SDL 1.2
141              pkg: libsdl1.2-dev
142              opt: SDL_TARGET=1
143            - name: GCC SDL 1.2 without GL/NoOne Extensions Disabled
144              pkg: libsdl1.2-dev
145              opt: SDL_TARGET=1 USE_OPENGL=0 NOONE_EXTENSIONS=0
146            - name: Clang without GL
147              pkg: libsdl2-dev clang
148              opt: CLANG=1 USE_OPENGL=0
149            - name: Clang without Polymer
150              pkg: libsdl2-dev clang
151              opt: CLANG=1 POLYMER=0
152      name: Linux ${{matrix.name}}
153      runs-on: ubuntu-latest
154      steps:
155      - uses: actions/checkout@v4
156      - name: install-prerequisites
157        run: |
158          sudo apt-get update
159          sudo apt-get -y install libflac-dev libgtk2.0-dev ${{matrix.pkg}}
160      - name: build
161        run: make -j$(nproc) blood tools ${{matrix.opt}}
162  
163    build-macos:
164      name: macOS Clang
165      runs-on: macos-latest
166      steps:
167      - uses: actions/checkout@v4
168      - name: install-prerequisites
169        run: |
170          brew install sdl2 flac make
171          brew unlink lz4
172      - name: build
173        run: gmake -j2 blood tools NETCODE=0
174      - name: 'prepare files for upload'
175        run: |
176          mkdir -p ./upload
177          cp -R ./notblood.app ./upload
178      - uses: actions/upload-artifact@v4
179        with:
180          name: notblood-macos
181          path: ./upload
182          if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` 
183