forked from ChesterSmitty/dodhooks
-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (156 loc) · 4.95 KB
/
build-dodhooks.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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
name: build_dodhooks
on:
push:
branches: [ master ]
tags: [ v**]
paths:
- '**'
- '!README.md'
- '!LICENSE'
- '!.github/workflows/build-dodhooks.yml'
pull_request:
branches: [ master ]
tags: [ v**]
paths:
- '**'
- '!README.md'
- '!LICENSE'
- '!.github/workflows/build-dodhooks.yml'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
# os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
# os: [windows-latest]
include:
# - os: windows-latest
# os_short: win
# compiler_cc: msvc
- os: ubuntu-latest
os_short: linux
compiler_cc: clang
compiler_cxx: clang++
fail-fast: false
runs-on: ${{ matrix.os }}
env:
SDKS: '["dods"]'
ARCH: x86,x86_64
SMVERSION: '1.10'
MMVERSION: '1.10'
steps:
# checkout everything
- uses: actions/checkout@v2
name: get dodhooks
with:
path: 'dodhooks'
- uses: actions/checkout@v2
name: get ambuild
with:
repository: 'alliedmodders/ambuild'
path: 'ambuild'
- uses: actions/checkout@v2
name: get souremod
with:
repository: 'alliedmodders/sourcemod'
path: 'sourcemod'
ref: "${{ env.SMVERSION }}-dev"
submodules: 'recursive'
# Setup Python for AMBuild
- uses: actions/setup-python@v2
name: Setup Python 3.8
with:
python-version: 3.8
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
- name: Install ambuild
shell: bash
run: pip install ./ambuild
- name: Install linux sm dependencies
shell: bash
if: startsWith(runner.os, 'Linux')
run: ./sourcemod/tools/checkout-deps.sh -s ${{ join(fromJSON(env.SDKS)) }}
- name: Install windows sm dependencies
shell: pwsh
if: startsWith(runner.os, 'Windows')
run: ./sourcemod/tools/checkout-deps.ps1 -SDKs ${{ join(fromJSON(env.SDKS)) }}
- name: Install Linux dependencies
if: startsWith(runner.os, 'Linux')
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gcc-multilib g++-multilib libstdc++6 lib32stdc++6 \
libc6-dev libc6-dev-i386 linux-libc-dev \
linux-libc-dev:i386 lib32z1-dev ${{ matrix.compiler_cc }}
- uses: ilammy/msvc-dev-cmd@v1
name: Install windows dependencies
if: startsWith(runner.os, 'Windows')
- name: Select clang compiler
if: startsWith(runner.os, 'Linux')
run: |
echo "CC=${{ matrix.compiler_cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.compiler_cxx }}" >> $GITHUB_ENV
${{ matrix.compiler_cc }} --version
${{ matrix.compiler_cxx }} --version
- name: create dodhooks build folder
shell: bash
working-directory: ./dodhooks
run: mkdir build
- name: comfigure dodhooks build
shell: bash
working-directory: ./dodhooks/build
run: python3 ../configure.py --hl2sdk-root=../../ --sm-path=../../sourcemod/ --mms-path=../../mmsource-$MMVERSION/
- name: run dodhooks build
shell: bash
working-directory: ./dodhooks/build
run: ambuild
- name: list build
shell: bash
working-directory: ./dodhooks/build
run: ls
- name: upload artifact web client
uses: actions/upload-artifact@v2
with:
name: "${{ matrix.os }}"
path: ./dodhooks/build
retention-days: 1
release:
name: Release
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
needs: build
runs-on: ubuntu-latest
steps:
- name: get artifacts
uses: actions/download-artifact@v2
- name: Display structure of downloaded files
run: ls -R
- uses: actions/checkout@v2
name: get dodhooks
with:
path: 'dodhooks'
- name: Display structure of downloaded files
run: ls -R
- name: copy release files
run: mkdir -p release/addons/sourcemod && cp -rf dodhooks/sourcemod/* release/addons/sourcemod/ && cp -rf ubuntu-latest/package/addons/sourcemod/* release/addons/sourcemod/
- name: make release file
run: zip -r dodhooks.zip release/addons/
- name: Display structure of downloaded files
run: ls -R
- name: Release
if: ${{ !(contains(github.ref, '-beta')) }}
uses: softprops/action-gh-release@v1
with:
files: dodhooks.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: pre Release
if: ${{ (contains(github.ref, '-beta')) }}
uses: softprops/action-gh-release@v1
with:
prerelease: true
files: dodhooks.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}