-
Notifications
You must be signed in to change notification settings - Fork 9
139 lines (121 loc) · 4.82 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
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
name: Compile Plugin
on:
push:
branches: [ master ]
tags: [ '*' ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
SM_VERSION: ['1.11.x', '1.12.x']
steps:
- uses: actions/checkout@v3
- uses: benjlevesque/[email protected]
id: short-sha
- name: Set environment variables
run: |
SOURCEMOD_PATH=$GITHUB_WORKSPACE/addons/sourcemod
BUILD_PATH=$GITHUB_WORKSPACE/build
echo "SOURCEMOD_PATH=$SOURCEMOD_PATH" >> $GITHUB_ENV
echo "BUILD_PATH=$BUILD_PATH" >> $GITHUB_ENV
echo "SCRIPTS_PATH=$SOURCEMOD_PATH/scripting" >> $GITHUB_ENV
echo "INCLUDES_PATH=$SOURCEMOD_PATH/scripting/include" >> $GITHUB_ENV
echo "PLUGINS_PATH=$SOURCEMOD_PATH/plugins" >> $GITHUB_ENV
- name: Setup SourcePawn Compiler ${{ matrix.SM_VERSION }}
id: setup_sp
uses: rumblefrog/setup-sp@master
with:
version: ${{ matrix.SM_VERSION }}
- name: Make Folders
run: |
mkdir include
mkdir -p include/multicolors
working-directory: ${{ env.SCRIPTS_PATH }}
- name: Get Include Files
run: |
echo "Begin downloading include files"
wget https://raw.githubusercontent.com/sbpp/sourcebans-pp/v1.x/game/addons/sourcemod/scripting/include/sourcebanspp.inc -O sourcebanspp.inc
wget https://bitbucket.org/kztimerglobalteam/kztimerglobal/raw/3f46f14c1c47df6bce1af7051ab47edba9f52bd8/scripting/include/kztimer.inc -O kztimer.inc
wget "https://forums.alliedmods.net/attachment.php?attachmentid=168028&d=1516358726" -O afk_manager.inc
wget https://raw.githubusercontent.com/Bara/Multi-Colors/master/addons/sourcemod/scripting/include/multicolors.inc -O multicolors.inc
cd multicolors
wget https://raw.githubusercontent.com/Bara/Multi-Colors/master/addons/sourcemod/scripting/include/multicolors/colors.inc -O colors.inc
wget https://raw.githubusercontent.com/Bara/Multi-Colors/master/addons/sourcemod/scripting/include/multicolors/morecolors.inc -O morecolors.inc
echo "Done downloading include files."
ls -la
working-directory: ${{ env.INCLUDES_PATH }}
- name: Compile plugins
run: |
for file in customvotes.sp
do
echo -e "\nCompiling $file..."
spcomp -E -w234 -O2 -v2 -i include $file
done
echo "===OUT FILES==="
ls
working-directory: ${{ env.SCRIPTS_PATH }}
- name: Post Build
run: |
echo "Creating build folder"
mkdir build
mkdir -p build/addons/sourcemod/configs
mkdir -p build/addons/sourcemod/plugins
mkdir -p build/addons/sourcemod/translations
mv $SCRIPTS_PATH/customvotes.smx $BUILD_PATH/addons/sourcemod/plugins/customvotes.smx
mv $SOURCEMOD_PATH/configs/customvotes.cfg $BUILD_PATH/addons/sourcemod/configs/customvotes.cfg
mv $SOURCEMOD_PATH/translations/* $BUILD_PATH/addons/sourcemod/translations/
cd build
ls -la
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: cv-redux-${{ matrix.SM_VERSION }}-${{ steps.short-sha.outputs.sha }}
path: |
${{ env.BUILD_PATH }}/*
- name: Create Release Package
if: startsWith(github.ref, 'refs/tags/')
working-directory: build
run: |
7z a -bb3 -mx9 -r "cvredux-${{ matrix.SM_VERSION }}-${{ steps.short-sha.outputs.sha }}.zip" addons
ls -la
# Cache release package to be retreived by the create_release job
- name: Cache Release Package
if: startsWith(github.ref, 'refs/tags/')
uses: actions/[email protected]
id: cache
with:
path: |
build/*.zip
key: cvredux-${{ github.ref_name }}-${{ matrix.SM_VERSION }}
# Job for creating a release, waits for build_main to finish
create_release:
name: Upload Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [ build ]
steps:
- name: Retreive Release Package From Cache 1.11
uses: actions/[email protected]
id: cache2
with:
path: |
build/*.zip
key: cvredux-${{ github.ref_name }}-1.11.x
- name: Retreive Release Package From Cache 1.12
uses: actions/[email protected]
id: cache3
with:
path: |
build/*.zip
key: cvredux-${{ github.ref_name }}-1.12.x
- name: Create Release
uses: softprops/[email protected]
with:
name: "Custom Votes Redux Modified ${{ github.ref_name }}"
generate_release_notes: true
files: |
build/*.zip