This repository has been archived by the owner on Sep 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (110 loc) · 3.36 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- ubuntu-20.04
sourcemod-version:
- 1.11-dev
include:
- os: ubuntu-latest
target-archs: x86
compiler_cc: clang
compiler_cxx: clang++
- os: windows-latest
target-archs: x86
compiler_cc: msvc
- os: ubuntu-20.04
target-archs: x86
compiler_cc: clang-8
compiler_cxx: clang++-8
steps:
- name: Install ${{ matrix.os }} packages
if: 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 compiler
if: 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: Setup Python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
- name: Checkout
uses: actions/checkout@v3
with:
path: extension
- name: Checkout SourceMod
uses: actions/checkout@v3
with:
repository: alliedmodders/sourcemod
ref: ${{ matrix.sourcemod-version }}
path: sourcemod
submodules: recursive
- name: Checkout AMBuild
uses: actions/checkout@v3
with:
repository: alliedmodders/ambuild
path: ambuild
- name: Install AMBuild
uses: BSFishy/pip-action@v1
with:
packages: ./ambuild
- name: Build
working-directory: extension
shell: bash
run: |
echo ${{ github.run_number }}
mkdir build && cd build
python ../configure.py --enable-optimize --targets=${{ matrix.target-archs }}
ambuild
- name: Upload artifact ${{ matrix.os }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}
path: extension/build/package
release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- windows-latest
- ubuntu-20.04
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Package
run: |
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`
7z a clown-core-${version}.${{ github.run_number }}-${{ matrix.os }}.zip ./${{ matrix.os }}/*
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.zip'
tag: ${{ github.ref }}
file_glob: true