|
1 | 1 | name: Build |
2 | 2 |
|
3 | 3 | on: [push, pull_request] |
| 4 | +env: |
| 5 | + WAF_FLAGS: -T release --disable-warns --prefix=build_hl2 |
4 | 6 |
|
5 | 7 | jobs: |
6 | | - build-linux-i386: |
7 | | - runs-on: ubuntu-latest |
8 | | - |
9 | | - steps: |
10 | | - - uses: actions/checkout@v2 |
11 | | - - name: Build linux-i386 |
12 | | - run: | |
13 | | - scripts/build-ubuntu-i386.sh |
14 | | -
|
15 | | - build-linux-amd64: |
16 | | - runs-on: ubuntu-20.04 |
17 | | - |
18 | | - steps: |
19 | | - - uses: actions/checkout@v2 |
20 | | - - name: Build linux-amd64 |
21 | | - run: | |
22 | | - scripts/build-ubuntu-amd64.sh |
23 | | -
|
24 | | - build-android-armv7a: |
25 | | - runs-on: ubuntu-20.04 |
26 | | - |
27 | | - steps: |
28 | | - - uses: actions/checkout@v2 |
29 | | - - name: Build android-armv7a |
30 | | - run: | |
31 | | - scripts/build-android-armv7a.sh |
32 | | -
|
33 | | - build-windows-i386: |
34 | | - runs-on: windows-2019 |
35 | | - |
36 | | - steps: |
37 | | - - uses: actions/checkout@v2 |
38 | | - - name: Build windows-i386 |
39 | | - run: | |
40 | | - git submodule init && git submodule update |
41 | | - ./waf.bat configure -T debug |
42 | | - ./waf.bat build |
43 | | -
|
44 | | - build-windows-amd64: |
45 | | - runs-on: windows-2019 |
46 | | - |
47 | | - steps: |
48 | | - - uses: actions/checkout@v2 |
49 | | - - name: Build windows-amd64 |
50 | | - run: | |
51 | | - git submodule init && git submodule update |
52 | | - ./waf.bat configure -T debug -8 |
53 | | - ./waf.bat build |
54 | | -
|
55 | | - build-dedicated-windows-i386: |
56 | | - runs-on: windows-2019 |
57 | | - |
58 | | - steps: |
59 | | - - uses: actions/checkout@v2 |
60 | | - - name: Build dedicated windows-i386 |
61 | | - run: | |
62 | | - git submodule init && git submodule update |
63 | | - ./waf.bat configure -T debug -d |
64 | | - ./waf.bat build |
65 | | -
|
66 | | - build-dedicated-windows-amd64: |
67 | | - runs-on: windows-2019 |
68 | | - |
| 8 | + build-linux: |
| 9 | + strategy: |
| 10 | + fail-fast: false |
| 11 | + matrix: |
| 12 | + os: [ubuntu-latest] |
| 13 | + bits: ['', '--64bits'] |
| 14 | + android: [''] |
| 15 | + flags: ['', '-d'] |
| 16 | + include: |
| 17 | + - os: ubuntu-20.04 |
| 18 | + bits: '' |
| 19 | + android: '--android=armeabi-v7a-hard,4.9,21 --togles' |
| 20 | + flags: '' |
| 21 | + runs-on: ${{ matrix.os }} |
| 22 | + env: |
| 23 | + DEPS: libopenal-dev libpng-dev libjpeg-dev libfreetype6-dev libfontconfig1-dev libcurl4-gnutls-dev libsdl2-dev zlib1g-dev libbz2-dev libedit-dev |
69 | 24 | steps: |
70 | | - - uses: actions/checkout@v2 |
71 | | - - name: Build dedicated windows-amd64 |
72 | | - run: | |
73 | | - git submodule init && git submodule update |
74 | | - ./waf.bat configure -T debug -d -8 |
75 | | - ./waf.bat build |
76 | | -
|
77 | | - build-dedicated-linux-i386: |
78 | | - runs-on: ubuntu-20.04 |
79 | | - |
80 | | - steps: |
81 | | - - uses: actions/checkout@v2 |
82 | | - - name: Build dedicated linux-i386 |
83 | | - run: | |
84 | | - scripts/build-ubuntu-i386.sh -d |
85 | | -
|
86 | | - build-dedicated-linux-amd64: |
87 | | - runs-on: ubuntu-20.04 |
88 | | - |
89 | | - steps: |
90 | | - - uses: actions/checkout@v2 |
91 | | - - name: Build dedicated linux-amd64 |
92 | | - run: | |
93 | | - scripts/build-ubuntu-amd64.sh -d |
94 | | -
|
95 | | - build-macos-amd64: |
| 25 | + - uses: actions/checkout@v3 |
| 26 | + with: |
| 27 | + submodules: recursive |
| 28 | + |
| 29 | + - name: Install common dependencies |
| 30 | + run: sudo apt-get update && sudo apt-get install -y g++-multilib gcc-multilib |
| 31 | + - name: Install 32bit dependencies |
| 32 | + if: ${{ matrix.bits == '' && !matrix.android }} |
| 33 | + run: | |
| 34 | + sudo dpkg --add-architecture i386 |
| 35 | + sudo apt-get update |
| 36 | + sudo apt-get install -y aptitude |
| 37 | + sudo aptitude install -y $(echo $DEPS | sed -r 's/[a-z0-9_\-]+/&:i386/g') |
| 38 | + echo "PKG_CONFIG_PATH=/usr/lib/i386-linux-gnu/pkgconfig" >> $GITHUB_ENV |
| 39 | + - name: Install 64bit dependencies |
| 40 | + if: ${{ matrix.bits != '' }} |
| 41 | + run: | |
| 42 | + sudo apt-get install -y $DEPS |
| 43 | + - name: Install Android dependencies |
| 44 | + if: ${{ matrix.android != '' }} |
| 45 | + run: | |
| 46 | + wget https://dl.google.com/android/repository/android-ndk-r10e-linux-x86_64.zip -o /dev/null |
| 47 | + unzip android-ndk-r10e-linux-x86_64.zip |
| 48 | + export NDK_HOME=$PWD/android-ndk-r10e/ |
| 49 | + echo "NDK_HOME=$NDK_HOME" >> $GITHUB_ENV |
| 50 | + echo "ANDROID_NDK_HOME=$NDK_HOME" >> $GITHUB_ENV |
| 51 | +
|
| 52 | + - name: Configure |
| 53 | + run: ./waf configure ${{ matrix.bits }} ${{ matrix.android }} ${{ matrix.flags }} $WAF_FLAGS |
| 54 | + - name: Build ${{ matrix.os }} |
| 55 | + run: ./waf install |
| 56 | + - name: Tar binaries |
| 57 | + run: tar cvf build.tar build_hl2 |
| 58 | + - name: Upload artifact |
| 59 | + uses: actions/upload-artifact@v3 |
| 60 | + with: |
| 61 | + name: Linux${{matrix.bits}}${{matrix.flags}}${{matrix.android}}.tar |
| 62 | + path: build.tar |
| 63 | + |
| 64 | + build-macos: |
| 65 | + strategy: |
| 66 | + fail-fast: false |
| 67 | + matrix: |
| 68 | + flags: ['', '-d'] |
96 | 69 | runs-on: macos-latest |
97 | | - |
98 | 70 | steps: |
99 | | - - uses: actions/checkout@v2 |
100 | | - - name: Build macos-amd64 |
101 | | - run: | |
102 | | - scripts/build-macos-amd64.sh |
| 71 | + - uses: actions/checkout@v3 |
| 72 | + with: |
| 73 | + submodules: recursive |
| 74 | + |
| 75 | + - name: Install dependencies |
| 76 | + run: brew install sdl2 |
| 77 | + |
| 78 | + - name: Configure |
| 79 | + run: ./waf configure --64bits ${{ matrix.flags }} $WAF_FLAGS |
| 80 | + - name: Build macos-amd64 |
| 81 | + run: ./waf install |
| 82 | + - name: Tar binaries |
| 83 | + run: tar cvf build.tar build_hl2 |
| 84 | + - name: Upload artifact |
| 85 | + uses: actions/upload-artifact@v3 |
| 86 | + with: |
| 87 | + name: macOS--64bits${{matrix.flags}}.tar |
| 88 | + path: build.tar |
| 89 | + |
| 90 | + build-windows: |
| 91 | + strategy: |
| 92 | + fail-fast: false |
| 93 | + matrix: |
| 94 | + os: [windows-2019] |
| 95 | + bits: ['', '--64bits'] |
| 96 | + flags: ['', '-d'] |
| 97 | + runs-on: ${{ matrix.os }} |
| 98 | + steps: |
| 99 | + - uses: actions/checkout@v3 |
| 100 | + with: |
| 101 | + submodules: recursive |
103 | 102 |
|
104 | | - build-dedicated-macos-amd64: |
105 | | - runs-on: macos-latest |
| 103 | + - name: Configure |
| 104 | + run: ./waf configure ${{ matrix.bits }} ${{ matrix.flags }} ${{ env.WAF_FLAGS }} |
| 105 | + - name: Build ${{ matrix.os }} |
| 106 | + run: ./waf install |
106 | 107 |
|
107 | | - steps: |
108 | | - - uses: actions/checkout@v2 |
109 | | - - name: Build dedicated macos-amd64 |
110 | | - run: | |
111 | | - scripts/build-macos-amd64.sh -d |
0 commit comments