-
Notifications
You must be signed in to change notification settings - Fork 54
116 lines (101 loc) · 3.62 KB
/
linux.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: linux
on:
pull_request:
push:
jobs:
create_dev_release:
runs-on: ubuntu-22.04
steps:
- name: Create Development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' }}
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Development Build"
vanilla-linux:
runs-on: ubuntu-22.04
strategy:
matrix:
platform: [clang, gcc]
steps:
- uses: actions/[email protected]
with:
submodules: 'true'
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Set Git Info
id: gitinfo
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set variables
id: vars
run: |
if [ "${{ matrix.platform }}" = "clang" ]
then
echo "cc=clang" >> $GITHUB_OUTPUT
echo "cxx=clang++" >> $GITHUB_OUTPUT
else
echo "cc=gcc" >> $GITHUB_OUTPUT
echo "cxx=g++" >> $GITHUB_OUTPUT
fi
- name: Install dependencies
run: |
sudo apt-get update -qq > /dev/null
sudo apt-get install -qq -y clang-format-14 libsdl2-dev libopenal-dev > /dev/null
- name: Configure Vanilla Conquer
env:
CC: ${{ steps.vars.outputs.cc }}
CXX: ${{ steps.vars.outputs.cxx }}
run: |
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DMAP_EDITORTD=ON -DMAP_EDITORRA=ON -DBUILD_TOOLS=ON -DBUILD_TESTS=ON -B build
- name: Check formatting
if: ${{ matrix.platform }} == clang
run: |
cmake --build build --target format
git diff --exit-code
- name: Build Vanilla Conquer
run: |
cmake --build build -- -j 4
cp ./build/vanillatd ./build/vanillatd.dbg
cp ./build/vanillara ./build/vanillara.dbg
cp ./build/vanillamix ./build/vanillamix.dbg
strip --strip-all ./build/vanillatd
strip --strip-all ./build/vanillara
strip --strip-all ./build/vanillamix
objcopy --add-gnu-debuglink=./build/vanillatd.dbg ./build/vanillatd
objcopy --add-gnu-debuglink=./build/vanillara.dbg ./build/vanillara
objcopy --add-gnu-debuglink=./build/vanillamix.dbg ./build/vanillamix
- name: Run unit tests
run: |
cd build
ctest
- name: Create archives
run: |
mkdir artifact
7z a artifact/vanilla-conquer-linux-${{ matrix.platform }}-x86_64-${{ steps.gitinfo.outputs.sha_short }}.zip ./build/vanillatd ./build/vanillara ./build/vanillamix
7z a artifact/vanilla-conquer-linux-${{ matrix.platform }}-x86_64-${{ steps.gitinfo.outputs.sha_short }}-debug.zip ./build/vanillatd.dbg ./build/vanillara.dbg ./build/vanillamix.dbg
- name: Upload artifact
uses: actions/[email protected]
with:
name: vanilla-conquer-linux-${{ matrix.platform }}-x86_64
path: artifact
- name: Upload development release
if: ${{ github.event_name != 'pull_request' && github.ref == 'refs/heads/vanilla' }}
uses: softprops/action-gh-release@v1
with:
name: Development Build
tag_name: "latest"
prerelease: true
files: |
artifact/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload tagged release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: softprops/action-gh-release@v1
with:
files: |
artifact/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}