-
Notifications
You must be signed in to change notification settings - Fork 3
99 lines (76 loc) · 2.97 KB
/
build.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
name: Build C/C++
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
linux:
name: Linux Build
runs-on: ubuntu-latest
container: ubuntu:18.04
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION: node16
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node16
steps:
- name: Setup Checkout
uses: actions/checkout@v3
- name: Add i386 architecture
run: dpkg --add-architecture i386
- name: Update repository
run: apt-get update > /dev/null
- name: Install build dependencies
run: apt-get install -qq -y wget unzip build-essential gcc-4.8-multilib g++-4.8-multilib libgcc1:i386 libcurl4-openssl-dev:i386 zlib1g-dev:i386 libssl-dev:i386 > /dev/null
- name: Update alternatives
run: update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
- name: Run build
working-directory: ./LogApi
run: make
- name: Move release file to publish
run: |
# Make Accuracy Fix path
mkdir -p publish/addons/logapi/dlls
# Copy released file to dlls
cp ./LogApi/Release/logapi_mm.so publish/addons/logapi/dlls
# Move settings file to folder
cp ./cstrike/addons/logapi/logapi.cfg publish/addons/logapi/logapi.cfg
cp ./cstrike/addons/logapi/events.json publish/addons/logapi/events.json
cp ./cstrike/addons/logapi/LogApi.php publish/addons/logapi/LogApi.php
- name: Deploy artifacts
uses: actions/upload-artifact@v3
with:
name: linux32
path: publish/*
windows:
name: Windows Build
runs-on: windows-latest
env:
SOLUTION_FILE_PATH: .
BUILD_CONFIGURATION: Release
steps:
- uses: actions/checkout@v4
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Run Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
- name: Move release file to publish
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
# Make publish directory
mkdir publish\addons\logapi\dlls
# Move released dll to publish
move ${{env.BUILD_CONFIGURATION}}\*.dll publish\addons\logapi\dlls
# Copy settings file to folder
cp ${{env.SOLUTION_FILE_PATH}}\cstrike\addons\logapi\logapi.cfg publish\addons\logapi\logapi.cfg
cp ${{env.SOLUTION_FILE_PATH}}\cstrike\addons\logapi\events.json publish\addons\logapi\events.json
cp ${{env.SOLUTION_FILE_PATH}}\cstrike\addons\logapi\LogApi.php publish\addons\logapi\LogApi.php
- name: Deploy artifacts
uses: actions/upload-artifact@v4
with:
name: win32
path: publish/*