-
Notifications
You must be signed in to change notification settings - Fork 40
145 lines (129 loc) · 5.12 KB
/
main.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
sm-version: [ '1.10.x', '1.11.x', '1.12.x', '1.13.x' ]
include:
- sm-version: '1.10.x'
sm-main-version: '1.10'
experimental: false
- sm-version: '1.11.x'
sm-main-version: '1.11'
experimental: true
- sm-version: '1.12.x'
sm-main-version: '1.12'
experimental: true
- sm-version: '1.13.x'
sm-main-version: '1.13'
experimental: true
fail-fast: false
continue-on-error: ${{ matrix.experimental }}
name: SM version ${{ matrix.sm-version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: smrpg
- name: Setup SP
uses: rumblefrog/[email protected]
with:
version: ${{ matrix.sm-version }}
# Checkout all dependencies
- uses: actions/checkout@v4
with:
repository: bcserv/smlib
ref: transitional_syntax
path: smlib
- uses: actions/checkout@v4
with:
repository: Impact123/AutoExecConfig
path: AutoExecConfig
- uses: actions/checkout@v4
with:
repository: Drifter321/DHooks2
path: DHooks2
- uses: actions/checkout@v4
with:
repository: Drixevel/Chat-Processor
path: Chat-Processor
- run: git clone https://bitbucket.org/minimoney1/simple-chat-processor.git
- uses: actions/checkout@v4
with:
repository: peace-maker/ColorVariables
ref: sm111
path: ColorVariables
- uses: actions/checkout@v4
with:
repository: peace-maker/mapzonelib
path: mapzonelib
- name: Setup package structure
shell: bash
run: |
mkdir -p package/plugins/upgrades
cp -R smrpg/configs package
cp -R smrpg/gamedata/ package/
cp -R smrpg/scripting/ package/
cp -R smrpg/translations/ package/
GITREVCOUNT=$(cd smrpg;git rev-list --count HEAD)
echo "GITREVCOUNT=$GITREVCOUNT" >> $GITHUB_ENV
echo -e "#if defined _smrpg_version_included\n#endinput\n#endif\n#define _smrpg_version_included\n\n" > smrpg/scripting/include/smrpg/smrpg_autoversion.inc
echo -e "#define SMRPG_VERSION \"1.0-$GITREVCOUNT\"\n" >> smrpg/scripting/include/smrpg/smrpg_autoversion.inc
- name: Compile plugins
shell: bash
env:
PACKAGE_PATH: ${{ github.workspace }}/package
INCLUDE_PATHS: -i${{ github.workspace }}/smrpg/scripting/include -i${{ github.workspace }}/smlib/scripting/include -i${{ github.workspace }}/AutoExecConfig -i${{ github.workspace }}/DHooks2/sourcemod/scripting/include -i${{ github.workspace }}/ColorVariables/addons/sourcemod/scripting/include -i${{ github.workspace }}/Chat-Processor/scripting/include -i${{ github.workspace }}/simple-chat-processor/scripting/include -i${{ github.workspace }}/mapzonelib/scripting/include
run: |
cd smrpg/scripting
# compile base plugins
for f in *.sp
do
if [ "$f" != "smrpg_chattags.sp" ]; then
echo -e "\nCompiling $f..."
smxfile="`echo $f | sed -e 's/\.sp$/\.smx/'`"
spcomp -E $INCLUDE_PATHS $f -o$PACKAGE_PATH/plugins/$smxfile
fi
done
# compile both versions of chattags for both chat processors..
echo -e "\nCompiling smrpg_chattags.sp for Chat Processor..."
spcomp -E $INCLUDE_PATHS smrpg_chattags.sp -o$PACKAGE_PATH/plugins/smrpg_chattags_cp.smx
echo -e "\nCompiling smrpg_chattags.sp for Simple Chat Processor..."
spcomp -E $INCLUDE_PATHS smrpg_chattags.sp -o$PACKAGE_PATH/plugins/smrpg_chattags_scp.smx USE_SIMPLE_PROCESSOR=
# compile all upgrades
for f in upgrades/*.sp
do
# skip the skeleton
if [ "$f" != "upgrades/smrpg_upgrade_example.sp" ]; then
echo -e "\nCompiling upgrade $f..."
smxfile="`echo $f | sed -e 's/\.sp$/\.smx/'`"
spcomp -E $INCLUDE_PATHS $f -o$PACKAGE_PATH/plugins/$smxfile
fi
done
rm include/smrpg/smrpg_autoversion.inc
# - name: Upload build
# if: github.event_name == 'push' && github.ref_type == 'branch' && github.ref_name == 'master'
# env:
# DROPURL: ${{ secrets.DROPURL }}
# UPLOADKEY: ${{ secrets.UPLOADKEY }}
# SMVERSION: ${{ matrix.sm-main-version }}
# shell: bash
# run: |
# ARCHIVE=smrpg-rev$GITREVCOUNT.tar.gz
# cd package
# tar -zcvf ../$ARCHIVE *
# cd ..
# if [ ! -z "$DROPURL" ]; then
# curl -F "sm=$SMVERSION" -F "key=$UPLOADKEY" -F "drop=@$ARCHIVE" $DROPURL
# fi
- uses: actions/upload-artifact@v4
with:
name: smrpg-rev${{ env.GITREVCOUNT }}-sm${{ matrix.sm-main-version }}
path: package