]> git.xonotic.org Git - xonotic/darkplaces.git/blob - .github/workflows/build.yml
New Github workflow file
[xonotic/darkplaces.git] / .github / workflows / build.yml
1 name: CI
2
3 on:
4   # Run on pushes to tags, the "master" branch, and PR's
5   push:
6     branches:
7       - master
8   pull_request:
9
10 jobs:
11   build:
12
13     runs-on: ubuntu-latest
14     container:
15       image: debian:latest
16     steps:
17       # Must install git before checking out the repo otherwise github doesn't fetch the .git directory.
18       - name: Install dependencies
19         run: |
20           apt update
21           apt install --yes build-essential git libjpeg-dev libsdl2-dev libcurl4-openssl-dev libpng-dev libfreetype-dev libvorbis-dev
22
23       - name: Fetch repository
24         uses: actions/checkout@v4.1.1
25         with:
26           # make `git describe` show the correct commit hash
27           fetch-depth: '0'
28
29       - name: Compile DP
30         run: |
31           # prevent git complaining about dubious ownership of the repo
32           chown -R root:root .
33           # fail if `git describe` doesn't work (required for the buildstring)
34           git describe --always
35           # fail if there's any warnings
36           export CC="cc -Werror"
37           make sdl-release
38
39       - name: Upload Linux artifacts
40         uses: actions/upload-artifact@v4
41         with:
42           name: Linux
43           path: |
44             darkplaces-sdl
45