-
Notifications
You must be signed in to change notification settings - Fork 72
132 lines (113 loc) · 6.25 KB
/
test_server.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
name: Compile test and upload
on:
push:
branches:
- dev
jobs:
workflow:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Get branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: get_branch_name
- name: Set environment variables
run: |
git fetch --unshallow
echo "COMMIT=$(git rev-list --count HEAD)" >> $GITHUB_ENV
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
SOURCEMOD_PATH=$GITHUB_WORKSPACE/addons/sourcemod
echo "SOURCEMOD_PATH=$SOURCEMOD_PATH" >> $GITHUB_ENV
echo "PLUGINS_PATH=$SOURCEMOD_PATH/plugins" >> $GITHUB_ENV
echo "GAMEDATA_PATH=$SOURCEMOD_PATH/gamedata" >> $GITHUB_ENV
echo "SCRIPTING_PATH=$SOURCEMOD_PATH/scripting" >> $GITHUB_ENV
echo "INCLUDE_PATH=$SOURCEMOD_PATH/scripting/include" >> $GITHUB_ENV
echo "TRANSLATIONS_PATH=$SOURCEMOD_PATH/translations" >> $GITHUB_ENV
- name: Setup SourcePawn Compiler 1.11
uses: rumblefrog/setup-sp@master
with:
version: "1.11"
- name: Fetch plugin dependencies
run: |
wget https://raw.githubusercontent.com/peace-maker/DHooks2/dynhooks/sourcemod_files/scripting/include/dhooks.inc -P $INCLUDE_PATH
wget https://raw.githubusercontent.com/Impact123/AutoExecConfig/development/autoexecconfig.inc -P $INCLUDE_PATH
wget https://raw.githubusercontent.com/c0rp3n/colorlib-sm/master/addons/sourcemod/scripting/include/colorlib.inc -P $INCLUDE_PATH
- name: Replace version with git commit number
run: |
sed -i "s/1.0.dev/1.0.dev${{ env.COMMIT }}-${{ env.SHORT_SHA }}-${{ steps.get_branch_name.outputs.branch }}/g" $SCRIPTING_PATH/SurfTimer.sp
- name: Download EndTouchFix source and gamedata file
run: |
wget https://github.com/rumourA/End-Touch-Fix/raw/master/scripting/EndTouchFix.sp -P $SCRIPTING_PATH
wget https://github.com/rumourA/End-Touch-Fix/raw/master/gamedata/endtouch.games.txt -P $GAMEDATA_PATH
- name: Download EndTouchFix source and gamedata file
run: |
wget https://github.com/rumourA/End-Touch-Fix/raw/master/scripting/EndTouchFix.sp -P $SCRIPTING_PATH
wget https://github.com/rumourA/End-Touch-Fix/raw/master/gamedata/endtouch.games.txt -P $GAMEDATA_PATH
- name: Download SurfTimer Mapchooser source and translations file
run: |
wget https://github.com/surftimer/SurfTimer-Mapchooser/raw/master/addons/sourcemod/scripting/st-mapchooser.sp -P $SCRIPTING_PATH
wget https://github.com/surftimer/SurfTimer-Mapchooser/raw/master/addons/sourcemod/scripting/st-nominations.sp -P $SCRIPTING_PATH
wget https://github.com/surftimer/SurfTimer-Mapchooser/raw/master/addons/sourcemod/scripting/st-rockthevote.sp -P $SCRIPTING_PATH
wget https://github.com/surftimer/SurfTimer-Mapchooser/raw/master/addons/sourcemod/scripting/st-voteextend.sp -P $SCRIPTING_PATH
wget https://github.com/surftimer/SurfTimer-Mapchooser/raw/master/addons/sourcemod/translations/st-mapchooser.phrases.txt -P $TRANSLATIONS_PATH
wget https://github.com/surftimer/SurfTimer-Mapchooser/raw/master/addons/sourcemod/translations/st-nominations.phrases.txt -P $TRANSLATIONS_PATH
wget https://github.com/surftimer/SurfTimer-Mapchooser/raw/master/addons/sourcemod/translations/st-rockthevote.phrases.txt -P $TRANSLATIONS_PATH
wget https://github.com/surftimer/SurfTimer-Mapchooser/raw/master/addons/sourcemod/translations/st-voteextend.phrases.txt -P $TRANSLATIONS_PATH
- name: Create upload directories
run: |
mkdir -p ./upload/csgo/addons/sourcemod/plugins/SurfTimer
mkdir -p ./upload/csgo/addons/sourcemod/translations
mkdir -p ./upload/csgo/addons/sourcemod/gamedata
- name: Move gamedata and translation files
run: |
mv ./addons/sourcemod/translations/surftimer.phrases.txt ./upload/csgo/addons/sourcemod/translations
mv ./addons/sourcemod/translations/st-{mapchooser,nominations,rockthevote,voteextend}.phrases.txt ./upload/csgo/addons/sourcemod/translations
mv ./addons/sourcemod/gamedata/endtouch.games.txt ./upload/csgo/addons/sourcemod/gamedata
- name: Compile plugins
run: |
mkdir -p $PLUGINS_PATH
for file in *.sp
do
echo -e "\nCompiling $file..."
spcomp -w234 -O2 -v2 -i $includePath -i $INCLUDE_PATH -o $GITHUB_WORKSPACE/upload/csgo/addons/sourcemod/plugins/SurfTimer/$file $file
done
working-directory: ${{ env.SCRIPTING_PATH }}
# - name: Upload files to EU
# uses: SamKirkland/[email protected]
# env:
# FTP_SERVER: ${{ secrets.SFTP_HOST_EU }}
# FTP_USERNAME: ${{ secrets.SFTP_USER_EU }}
# FTP_PASSWORD: ${{ secrets.SFTP_PASS_EU }}
# LOCAL_DIR: upload
# METHOD: sftp
# PORT: ${{ secrets.SFTP_PORT_EU }}
# ARGS: --no-empty-dirs
- name: Upload files to NA
uses: SamKirkland/[email protected]
env:
FTP_SERVER: ${{ secrets.SFTP_HOST }}
FTP_USERNAME: ${{ secrets.SFTP_USER }}
FTP_PASSWORD: ${{ secrets.SFTP_PASS }}
LOCAL_DIR: upload
METHOD: sftp
PORT: ${{ secrets.SFTP_PORT }}
ARGS: --no-empty-dirs
# - name: Restart EU test server
# shell: bash
# run: |
# curl --request POST \
# --url ${{ secrets.BASE_URL_EU }}api/client/servers/${{ secrets.SERVER_ID_EU }}/power \
# --header 'Accept: application/json' \
# --header 'Authorization: Bearer ${{ secrets.API_KEY_EU }}' \
# --header 'Content-Type: application/json' \
# --data '{ "signal": "restart" }'
- name: Restart NA test server
shell: bash
run: |
curl --request POST \
--url ${{ secrets.BASE_URL }}api/client/servers/${{ secrets.SERVER_ID }}/power \
--header 'Accept: application/json' \
--header 'Authorization: Bearer ${{ secrets.API_KEY }}' \
--header 'Content-Type: application/json' \
--data '{ "signal": "restart" }'