forked from ErikMinekus/sm-ripext
-
Notifications
You must be signed in to change notification settings - Fork 1
127 lines (111 loc) · 3.35 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
name: Build and release
on:
push:
branches:
- main
- master
tags:
- 'v*.*.*'
pull_request:
branches:
- main
- master
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2019, macos-11]
sourcemod-version: [1.11-dev]
python-version: ['3.10']
include:
- os: ubuntu-20.04
target-archs: x86,x86_64
platform: linux
compiler_cc: clang
compiler_cxx: clang++
- os: windows-2019
target-archs: x86,x86_64
platform: windows
compiler_cc: clang
compiler_cxx: clang++
- os: macos-11
target-archs: x86_64
platform: macos
compiler_cc: clang
compiler_cxx: clang++
steps:
- name: Install Linux packages
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install -yq --no-install-recommends g++-multilib ${{ matrix.compiler_cc }}
- name: Select 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: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Checkout
uses: actions/checkout@v4
with:
path: extension
- name: Checkout SourceMod ${{ matrix.sourcemod-version }}
uses: actions/checkout@v4
with:
repository: alliedmodders/sourcemod
ref: ${{ matrix.sourcemod-version }}
path: sourcemod
submodules: recursive
- name: Install AMBuild
run: |
python -m pip install wheel
pip install git+https://github.com/alliedmodders/ambuild
- name: Build
working-directory: extension
shell: bash
env:
BREAKPAD_SYMBOL_SERVER: ${{ secrets.BREAKPAD_SYMBOL_SERVER }}
run: |
mkdir build && cd build
perl ../curl/lib/mk-ca-bundle.pl
python ../configure.py --enable-optimize --targets=${{ matrix.target-archs }}
ambuild
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ github.event.repository.name }}-${{ matrix.platform }}
path: extension/build/package
release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Package
run: |
for folder in ./*; do
if [ -d "$folder" ]; then
echo "Processing folder: $folder"
cd $folder
tar -czf ../$folder.tar.gz -T <(\ls -1)
cd ..
sha256sum $folder.tar.gz > $folder.tar.gz.sha256
fi
done
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.tar.gz*'
tag: ${{ github.ref }}
file_glob: true