-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (98 loc) · 3.29 KB
/
ci.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
name: CI
on:
push:
branches:
- "main"
tags:
- 'v*.*.*'
jobs:
build:
strategy:
matrix:
os: [ubuntu-18.04, windows-latest]
include:
- os: windows-latest
os_short: win
compiler_cc: msvc
rust-target: i686-pc-windows-msvc
packaging: Compress-Archive -Path ./package/* -DestinationPath timerex-win.zip
- os: ubuntu-18.04
os_short: linux
compiler_cc: clang-3.9
compiler_cxx: clang++-3.9
rust-target: i686-unknown-linux-gnu
packaging: cd package && zip -r ../timerex-linux.zip addons
runs-on: ${{ matrix.os }}
name: ${{ matrix.os_short }}-${{ matrix.compiler_cc }}
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
path: timerex
- name: Install nightly Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
target: ${{ matrix.rust-target }}
override: true
default: true
- uses: Swatinem/rust-cache@v1
with:
working-directory: timerex
- uses: actions/checkout@v2
name: Checkout sourcemod
with:
repository: alliedmodders/sourcemod
submodules: recursive
path: sourcemod
- uses: actions/checkout@v2
name: Checkout metamod-source
with:
repository: alliedmodders/metamod-source
path: mmsource
- uses: actions/checkout@v2
name: Checkout ambuild
with:
repository: alliedmodders/ambuild
path: ambuild
# Setup Python for AMBuild
- uses: actions/setup-python@v2
name: Setup Python 3.8
with:
python-version: 3.8
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
- name: Install ambuild
run: pip install ./ambuild
- name: Install Linux dependencies
if: startsWith(runner.os, 'Linux')
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gcc-multilib g++-multilib libstdc++6 lib32stdc++6 \
libc6-dev libc6-dev-i386 linux-libc-dev \
linux-libc-dev:i386 lib32z1-dev ${{ matrix.compiler_cc }}
- name: Select clang compiler
if: startsWith(runner.os, 'Linux')
run: |
echo "CC=${{ matrix.compiler_cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.compiler_cxx }}" >> $GITHUB_ENV
${{ matrix.compiler_cc }} --version
${{ matrix.compiler_cxx }} --version
- name: Build
working-directory: timerex
run: |
cargo build --target ${{ matrix.rust-target }} --release
mkdir -p build && cd build
python ../configure.py --enable-optimize --sm-path=${{ github.workspace }}/sourcemod/ --mms-path=${{ github.workspace }}/mmsource/
ambuild
${{ matrix.packaging }}
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: timerex/build/timerex-${{ matrix.os_short }}.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}