-
-
Notifications
You must be signed in to change notification settings - Fork 9
89 lines (75 loc) · 2.91 KB
/
main.yml
File metadata and controls
89 lines (75 loc) · 2.91 KB
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
name: Compile and release
on:
push:
branches:
- master
env:
PLUGIN_NAME: prophunt
SCRIPTS_PATH: addons/sourcemod/scripting
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
sm-version: [ '1.12.x' ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Prepare include directory
run: mkdir -p ${{ env.SCRIPTS_PATH }}/include
- name: Download include files
run: |
includes=(
"https://raw.githubusercontent.com/FlaminSarge/tf2attributes/master/scripting/include/tf2attributes.inc"
"https://raw.githubusercontent.com/asherkin/TF2Items/master/pawn/tf2items.inc"
"https://raw.githubusercontent.com/nosoop/SM-TFUtils/master/scripting/include/tf2utils.inc"
"https://raw.githubusercontent.com/nosoop/SM-TFEconData/master/scripting/include/tf_econ_data.inc"
"https://raw.githubusercontent.com/DoctorMcKay/sourcemod-plugins/master/scripting/include/morecolors.inc"
"https://raw.githubusercontent.com/sigsegv-mvm/StaticProps/master/scripting/include/StaticProps.inc"
)
mkdir -p "${{ env.SCRIPTS_PATH }}/include"
for url in "${includes[@]}"; do
echo "Downloading $url"
curl -sSL -O --output-dir "${{ env.SCRIPTS_PATH }}/include" "$url"
done
- name: Setup SourcePawn Compiler ${{ matrix.sm-version }}
id: setup_sp
uses: rumblefrog/setup-sp@master
with:
version: ${{ matrix.sm-version }}
version-file: ${{ env.SCRIPTS_PATH }}/${{ env.PLUGIN_NAME }}.sp
define-name: PLUGIN_VERSION
- name: Compile plugin
run: |
mkdir -p ../plugins
spcomp -v2 -E -i "include" -o "../plugins/${{ env.PLUGIN_NAME }}.smx" "${{ env.PLUGIN_NAME }}.sp"
echo "=== OUT FILES ==="
ls ../plugins
echo "=== VERSION ==="
echo ${{ steps.setup_sp.outputs.plugin-version }}
working-directory: ${{ env.SCRIPTS_PATH }}
- name: Install zip utility
uses: montudor/action-zip@v1
- name: Zip output
run: |
zip -qq -r ${{ github.event.repository.name }}.zip addons/sourcemod
- name: List build outputs
run: |
echo "::group::Directory contents"
ls -R
echo "::endgroup::"
echo "::group::Zip contents"
unzip -l ${{ github.event.repository.name }}.zip
echo "::endgroup::"
- name: Create GitHub Release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.setup_sp.outputs.plugin-version }}
artifacts: ./${{ github.event.repository.name }}.zip
draft: true
allowUpdates: true
updateOnlyUnreleased: true
skipIfReleaseExists: true