-
-
Notifications
You must be signed in to change notification settings - Fork 17
215 lines (187 loc) · 7.41 KB
/
hook-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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
###
### Copyright (c) 2024 Carbon Community
### All rights reserved
###
name: Protocol Hooks Build
concurrency: build-protocol-hooks
on:
workflow_dispatch:
inputs:
protocol:
description: 'Carbon Protocol'
required: true
default: '2024.MM.DD.0'
type: string
carbon_branch:
description: 'Carbon Branch'
required: true
default: 'develop'
type: choice
options:
- develop
- preview
- production
- rust_beta/staging
- rust_beta/aux01
- rust_beta/aux02
rust_branch:
description: 'Rust Branch'
required: true
default: 'public'
type: choice
options:
- public
- release
- staging
- aux01
- aux02
debug:
description: 'Debug Hooks'
required: true
default: 'true'
type: boolean
release:
description: 'Release Hooks'
required: true
default: 'false'
type: boolean
oxide_hooks_override:
description: 'Oxide Hooks Override'
required: false
default: ''
type: string
env:
FTP_PWD: ${{ secrets.FTP_PWD }}
DISCORD_HOOK_WH: ${{ secrets.DISCORD_HOOK_WH }}
PROTOCOL: ${{ inputs.protocol }}
RUST_BRANCH: ${{ inputs.rust_branch }}
DEBUG_BUILD: ${{ inputs.debug }}
RELEASE_BUILD: ${{ inputs.release }}
OXIDE_HOOKS_OVERRIDE: ${{ inputs.oxide_hooks_override }}
ACTION_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
jobs:
bootstrap:
name: 🥾 Bootstrap
runs-on: ubuntu-latest
steps:
- name: 🔗 Checkout source code from github
uses: actions/checkout@v3
build-windows:
name: 💻 Windows
needs: bootstrap
runs-on: windows-latest
continue-on-error: false
steps:
- name: 🔗 Checkout source code from github
uses: actions/checkout@v3
with:
ref: ${{ inputs.carbon_branch }}
token: ${{ secrets.PAT_ALL_REPO }}
submodules: recursive
- name: 🛤️ Setup the dotnet build environment
uses: actions/setup-dotnet@v2
with:
dotnet-version: 8.0.x
- name: 🔨 Built Carbon Hooks on Windows
shell: cmd
run: |
set OXIDE_HOOKS=https://carbonmod.gg/redist/oxide/%RUST_BRANCH%.opj
if NOT "%OXIDE_HOOKS_OVERRIDE%" EQU "" (
set OXIDE_HOOKS=%OXIDE_HOOKS_OVERRIDE%
)
set ROOT=%GITHUB_WORKSPACE%\Carbon.Core\Carbon.Hooks\Carbon.Hooks.Internal\Buildroot\Scripts
call %GITHUB_WORKSPACE%\Tools\Build\win\bootstrap.bat %RUST_BRANCH%
if %DEBUG_BUILD% EQU true (
cd %ROOT%
echo Debug build is enabled.
call build.bat Debug %RUST_BRANCH% %PROTOCOL% %OXIDE_HOOKS%
) else (
echo Debug build is disabled.
)
if %RELEASE_BUILD% EQU true (
cd %ROOT%
echo Release build is enabled.
call build.bat Release %RUST_BRANCH% %PROTOCOL% %OXIDE_HOOKS%
) else (
echo Release build is disabled.
)
cd %ROOT%
call discord.bat %RUST_BRANCH% %PROTOCOL%
- name: ⬆️ Artifacts - Upload
uses: actions/upload-artifact@v3
with:
name: FTP Output
path: |
Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/*
- name: ⬆️ FTP - Upload Debug (Carbon.Hooks.Community)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.debug }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/debug/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
dest: "server/debug/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
- name: ⬆️ FTP - Upload DebugUnix (Carbon.Hooks.Community)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.debug }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/debugunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
dest: "server/debugunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
- name: ⬆️ FTP - Upload Debug (Carbon.Hooks.Oxide)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.debug }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/debug/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"
dest: "server/debug/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"
- name: ⬆️ FTP - Upload DebugUnix (Carbon.Hooks.Oxide)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.debug }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/debugunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"
dest: "server/debugunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"
- name: ⬆️ FTP - Upload Release (Carbon.Hooks.Community)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.release }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/release/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
dest: "server/release/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
- name: ⬆️ FTP - Upload ReleaseUnix (Carbon.Hooks.Community)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.release }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/releaseunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
dest: "server/releaseunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Community.dll"
- name: ⬆️ FTP - Upload Release (Carbon.Hooks.Oxide)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.release }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/release/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"
dest: "server/release/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"
- name: ⬆️ FTP - Upload ReleaseUnix (Carbon.Hooks.Oxide)
uses: tomasbkk/action-ftp-upload@v1.0
if: ${{ inputs.release }}
with:
user: redist@carbonmod.gg
password: ${{ secrets.FTP_PWD }}
host: 147.135.88.204
src: "Carbon.Core/Carbon.Hooks/Carbon.Hooks.Internal/FTP/server/releaseunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"
dest: "server/releaseunix/${{ inputs.protocol }}/carbon/managed/hooks/Carbon.Hooks.Oxide.dll"