-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (95 loc) · 3.44 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
# Author: ProjectSky
# url: https://github.com/ProjectSky/sm-ext-yyjson/blob/main/.github/workflows/ci.yml
name: build
on:
workflow_dispatch:
jobs:
build:
name: build with sm${{ matrix.sm_version }} on ${{ matrix.os_short }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
# - windows-latest
sm_version:
- "1.11"
- "latest"
include:
- sm_version: latest
sm_branch: master
- sm_version: "1.11"
sm_branch: "1.11-dev"
# - os: windows-latest
# os_short: win
- os: ubuntu-latest
os_short: linux
steps:
- name: Prepare env
shell: bash
run: |
echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Install (Linux)
if: runner.os == 'Linux'
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y clang g++-multilib
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: Getting SourceMod ${{ matrix.sm_version }}
uses: actions/checkout@v4
with:
repository: alliedmodders/sourcemod
ref: ${{ matrix.sm_branch }}
path: sourcemod-${{ matrix.sm_version }}
submodules: recursive
- name: Getting AMBuild
uses: actions/checkout@v4
with:
repository: alliedmodders/ambuild
path: ambuild
- name: Setting up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Getting ambuild
run: |
python -m pip install wheel
pip install git+https://github.com/alliedmodders/ambuild
- name: Getting own repository
uses: actions/checkout@v4
with:
path: extension
submodules: true
# - name: Install v143 Toolset
# if: runner.os == 'Windows'
# shell: powershell
# run: |
# Set-Location "C:\Program Files (x86)\Microsoft Visual Studio\Installer\"
# $InstallPath = "C:\Program Files\Microsoft Visual Studio\2022\Enterprise"
# $WorkLoads = '--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64'
# $Arguments = ('/c', "vs_installer.exe", 'modify', '--installPath', "`"$InstallPath`"", $WorkLoads, '--quiet', '--norestart', '--nocache')
# $process = Start-Process -FilePath cmd.exe -ArgumentList $Arguments -Wait -PassThru -WindowStyle Hidden
# if ($process.ExitCode -eq 0) {
# Write-Host "components have been successfully added"
# } else {
# Write-Host "components were not installed"
# }
# - uses: microsoft/setup-msbuild@v2
# if: runner.os == 'Windows'
# with:
# msbuild-architecture: x64
# vs-version: '15'
- name: Compiling ${{ github.event.repository.name }} files
working-directory: extension
run: |
mkdir build && cd build
python ../configure.py --enable-optimize --symbol-files --sm-path="${{ github.workspace }}/sourcemod-${{ matrix.sm_version }}"
ambuild
- name: Uploading package
uses: actions/upload-artifact@v4
with:
name: sm-ext-log4sp-sm${{ matrix.sm_version }}-${{ matrix.os_short }}-${{ env.GITHUB_SHA_SHORT }}
path: extension/build/package