|
1 | | -name: CI |
2 | | - |
3 | | -on: |
4 | | - push: |
5 | | - branches: |
6 | | - - "main" |
7 | | - tags: |
8 | | - - 'v*.*.*' |
9 | | - |
10 | | -jobs: |
11 | | - build: |
12 | | - strategy: |
13 | | - matrix: |
14 | | - os: [ubuntu-latest, windows-latest] |
15 | | - arch: [x86, x86_64] |
16 | | - include: |
17 | | - - os: windows-latest |
18 | | - arch: x86 |
19 | | - os_short: win |
20 | | - compiler_cc: msvc |
21 | | - rust-target: i686-pc-windows-msvc |
22 | | - packaging: Compress-Archive -Path ./package/* -DestinationPath timerex-win-x86.zip |
23 | | - - os: windows-latest |
24 | | - arch: x86_64 |
25 | | - os_short: win |
26 | | - compiler_cc: msvc |
27 | | - rust-target: x86_64-pc-windows-msvc |
28 | | - packaging: Compress-Archive -Path ./package/* -DestinationPath timerex-win-x86_64.zip |
29 | | - - os: ubuntu-latest |
30 | | - arch: x86 |
31 | | - os_short: linux |
32 | | - compiler_cc: clang |
33 | | - compiler_cxx: clang++ |
34 | | - rust-target: i686-unknown-linux-gnu |
35 | | - packaging: cd package && zip -r ../timerex-linux-x86.zip addons |
36 | | - - os: ubuntu-latest |
37 | | - arch: x86_64 |
38 | | - os_short: linux |
39 | | - compiler_cc: clang |
40 | | - compiler_cxx: clang++ |
41 | | - rust-target: x86_64-unknown-linux-gnu |
42 | | - packaging: cd package && zip -r ../timerex-linux-x86_64.zip addons |
43 | | - runs-on: ${{ matrix.os }} |
44 | | - name: ${{ matrix.os_short }}-${{ matrix.compiler_cc }}-${{ matrix.arch }} |
45 | | - steps: |
46 | | - - uses: actions/checkout@v4 |
47 | | - with: |
48 | | - submodules: recursive |
49 | | - path: timerex |
50 | | - |
51 | | - - name: Install Rust |
52 | | - uses: actions-rust-lang/setup-rust-toolchain@v1 |
53 | | - with: |
54 | | - toolchain: nightly |
55 | | - target: ${{ matrix.rust-target }} |
56 | | - override: true |
57 | | - |
58 | | - - uses: Swatinem/rust-cache@v1 |
59 | | - with: |
60 | | - working-directory: timerex |
61 | | - |
62 | | - - uses: actions/checkout@v4 |
63 | | - name: Checkout sourcemod |
64 | | - with: |
65 | | - repository: alliedmodders/sourcemod |
66 | | - submodules: recursive |
67 | | - path: sourcemod |
68 | | - |
69 | | - - uses: actions/checkout@v4 |
70 | | - name: Checkout metamod-source |
71 | | - with: |
72 | | - repository: alliedmodders/metamod-source |
73 | | - path: mmsource |
74 | | - |
75 | | - - uses: actions/checkout@v4 |
76 | | - name: Checkout ambuild |
77 | | - with: |
78 | | - repository: alliedmodders/ambuild |
79 | | - path: ambuild |
80 | | - |
81 | | - # Setup Python for AMBuild |
82 | | - - uses: actions/setup-python@v5 |
83 | | - name: Setup Python 3.13 |
84 | | - with: |
85 | | - python-version: 3.13 |
86 | | - - name: Install Python dependencies |
87 | | - run: | |
88 | | - python -m pip install --upgrade pip setuptools wheel |
89 | | -
|
90 | | - - name: Install ambuild |
91 | | - run: pip install ./ambuild |
92 | | - |
93 | | - - name: Install Linux 64-bit dependencies |
94 | | - if: startsWith(runner.os, 'Linux') && matrix.arch == 'x86_64' |
95 | | - run: | |
96 | | - sudo apt-get update |
97 | | - sudo apt-get install -y \ |
98 | | - libstdc++6 libc6-dev linux-libc-dev \ |
99 | | - ${{ matrix.compiler_cc }} |
100 | | -
|
101 | | - - name: Install Linux 32-bit dependencies |
102 | | - if: startsWith(runner.os, 'Linux') && matrix.arch == 'x86' |
103 | | - run: | |
104 | | - sudo dpkg --add-architecture i386 |
105 | | - sudo apt-get update |
106 | | - sudo apt-get install -y \ |
107 | | - gcc-multilib g++-multilib libstdc++6 lib32stdc++6 \ |
108 | | - libc6-dev libc6-dev-i386 linux-libc-dev linux-libc-dev:i386 \ |
109 | | - lib32z1-dev ${{ matrix.compiler_cc }} |
110 | | -
|
111 | | - - name: Select clang compiler |
112 | | - if: startsWith(runner.os, 'Linux') |
113 | | - run: | |
114 | | - echo "CC=${{ matrix.compiler_cc }}" >> $GITHUB_ENV |
115 | | - echo "CXX=${{ matrix.compiler_cxx }}" >> $GITHUB_ENV |
116 | | - ${{ matrix.compiler_cc }} --version |
117 | | - ${{ matrix.compiler_cxx }} --version |
118 | | -
|
119 | | - - name: Build |
120 | | - working-directory: timerex |
121 | | - run: | |
122 | | - cargo build --target ${{ matrix.rust-target }} --release |
123 | | - mkdir -p build && cd build |
124 | | - python ../configure.py --enable-optimize --sm-path=${{ github.workspace }}/sourcemod/ --mms-path=${{ github.workspace }}/mmsource/ --targets ${{ matrix.arch }} |
125 | | - ambuild |
126 | | - ${{ matrix.packaging }} |
127 | | -
|
128 | | - - name: Release |
129 | | - uses: softprops/action-gh-release@v1 |
130 | | - if: startsWith(github.ref, 'refs/tags/') |
131 | | - with: |
132 | | - files: timerex/build/timerex-${{ matrix.os_short }}-${{ matrix.arch }}.zip |
133 | | - env: |
134 | | - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - "main" |
| 7 | + tags: |
| 8 | + - 'v*.*.*' |
| 9 | + |
| 10 | +jobs: |
| 11 | + build: |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + os: [ubuntu-22.04, windows-latest] |
| 15 | + arch: [x86, x86_64] |
| 16 | + include: |
| 17 | + - os: windows-latest |
| 18 | + arch: x86 |
| 19 | + os_short: win |
| 20 | + compiler_cc: msvc |
| 21 | + rust-target: i686-pc-windows-msvc |
| 22 | + packaging: Compress-Archive -Path ./package/* -DestinationPath timerex-win-x86.zip |
| 23 | + - os: windows-latest |
| 24 | + arch: x86_64 |
| 25 | + os_short: win |
| 26 | + compiler_cc: msvc |
| 27 | + rust-target: x86_64-pc-windows-msvc |
| 28 | + packaging: Compress-Archive -Path ./package/* -DestinationPath timerex-win-x86_64.zip |
| 29 | + - os: ubuntu-22.04 |
| 30 | + arch: x86 |
| 31 | + os_short: linux |
| 32 | + compiler_cc: clang |
| 33 | + compiler_cxx: clang++ |
| 34 | + rust-target: i686-unknown-linux-musl |
| 35 | + packaging: cd package && zip -r ../timerex-linux-x86.zip addons |
| 36 | + - os: ubuntu-22.04 |
| 37 | + arch: x86_64 |
| 38 | + os_short: linux |
| 39 | + compiler_cc: clang |
| 40 | + compiler_cxx: clang++ |
| 41 | + rust-target: x86_64-unknown-linux-musl |
| 42 | + packaging: cd package && zip -r ../timerex-linux-x86_64.zip addons |
| 43 | + runs-on: ${{ matrix.os }} |
| 44 | + name: ${{ matrix.os_short }}-${{ matrix.compiler_cc }}-${{ matrix.arch }} |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@v4 |
| 47 | + with: |
| 48 | + submodules: recursive |
| 49 | + path: timerex |
| 50 | + |
| 51 | + - name: Install Rust |
| 52 | + uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 53 | + with: |
| 54 | + toolchain: nightly |
| 55 | + target: ${{ matrix.rust-target }} |
| 56 | + override: true |
| 57 | + |
| 58 | + - uses: Swatinem/rust-cache@v1 |
| 59 | + with: |
| 60 | + working-directory: timerex |
| 61 | + |
| 62 | + - uses: actions/checkout@v4 |
| 63 | + name: Checkout sourcemod |
| 64 | + with: |
| 65 | + repository: alliedmodders/sourcemod |
| 66 | + submodules: recursive |
| 67 | + path: sourcemod |
| 68 | + |
| 69 | + - uses: actions/checkout@v4 |
| 70 | + name: Checkout metamod-source |
| 71 | + with: |
| 72 | + repository: alliedmodders/metamod-source |
| 73 | + path: mmsource |
| 74 | + |
| 75 | + - uses: actions/checkout@v4 |
| 76 | + name: Checkout ambuild |
| 77 | + with: |
| 78 | + repository: alliedmodders/ambuild |
| 79 | + path: ambuild |
| 80 | + |
| 81 | + # Setup Python for AMBuild |
| 82 | + - uses: actions/setup-python@v5 |
| 83 | + name: Setup Python 3.13 |
| 84 | + with: |
| 85 | + python-version: 3.13 |
| 86 | + - name: Install Python dependencies |
| 87 | + run: | |
| 88 | + python -m pip install --upgrade pip setuptools wheel |
| 89 | +
|
| 90 | + - name: Install ambuild |
| 91 | + run: pip install ./ambuild |
| 92 | + |
| 93 | + - name: Install Linux 64-bit dependencies |
| 94 | + if: startsWith(runner.os, 'Linux') && matrix.arch == 'x86_64' |
| 95 | + run: | |
| 96 | + sudo apt-get update |
| 97 | + sudo apt-get install -y \ |
| 98 | + libstdc++6 libc6-dev linux-libc-dev \ |
| 99 | + ${{ matrix.compiler_cc }} |
| 100 | +
|
| 101 | + - name: Install Linux 32-bit dependencies |
| 102 | + if: startsWith(runner.os, 'Linux') && matrix.arch == 'x86' |
| 103 | + run: | |
| 104 | + sudo dpkg --add-architecture i386 |
| 105 | + sudo apt-get update |
| 106 | + sudo apt-get install -y \ |
| 107 | + gcc-multilib g++-multilib libstdc++6 lib32stdc++6 \ |
| 108 | + libc6-dev libc6-dev-i386 linux-libc-dev linux-libc-dev:i386 \ |
| 109 | + lib32z1-dev ${{ matrix.compiler_cc }} |
| 110 | +
|
| 111 | + - name: Select clang compiler |
| 112 | + if: startsWith(runner.os, 'Linux') |
| 113 | + run: | |
| 114 | + echo "CC=${{ matrix.compiler_cc }}" >> $GITHUB_ENV |
| 115 | + echo "CXX=${{ matrix.compiler_cxx }}" >> $GITHUB_ENV |
| 116 | + ${{ matrix.compiler_cc }} --version |
| 117 | + ${{ matrix.compiler_cxx }} --version |
| 118 | +
|
| 119 | + - name: Build |
| 120 | + working-directory: timerex |
| 121 | + run: | |
| 122 | + cargo build --target ${{ matrix.rust-target }} --release |
| 123 | + mkdir -p build && cd build |
| 124 | + python ../configure.py --enable-optimize --sm-path=${{ github.workspace }}/sourcemod/ --mms-path=${{ github.workspace }}/mmsource/ --targets ${{ matrix.arch }} |
| 125 | + ambuild |
| 126 | + ${{ matrix.packaging }} |
| 127 | +
|
| 128 | + - name: Release |
| 129 | + uses: softprops/action-gh-release@v1 |
| 130 | + if: startsWith(github.ref, 'refs/tags/') |
| 131 | + with: |
| 132 | + files: timerex/build/timerex-${{ matrix.os_short }}-${{ matrix.arch }}.zip |
| 133 | + env: |
| 134 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments