-
Notifications
You must be signed in to change notification settings - Fork 117
280 lines (274 loc) · 11.5 KB
/
release.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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
name: Release
on:
push:
branches:
- development-build
- release-build
workflow_dispatch:
inputs:
path:
description: 'Path of upload (after <ftp>/test/)'
required: true
default: 'acre2'
label:
description: 'Label to attach to the archive name (with leading underscore)'
jobs:
build:
if: github.repository == 'IDI-Systems/acre2' && ! contains(github.event.head_commit.message, '[ci skip]')
runs-on: windows-latest
outputs:
VERSION: ${{ env.VERSION }}
SHA_SHORT: ${{ env.SHA_SHORT }}
steps:
- name: Checkout the source code
uses: actions/checkout@v4
- name: Setup HEMTT
uses: arma-actions/hemtt@v1
- name: Setup Binarize
run: |
C:\msys64\usr\bin\wget.exe ${{ secrets.FTP_SERVER }}/tools/acre2_tools.zip --user ${{ secrets.FTP_USERNAME }} --password ${{ secrets.FTP_PASSWORD }} -q
Expand-Archive acre2_tools.zip -DestinationPath ci
echo "Check Binarize: $(Test-Path .\\ci\\binarize\\binarize_x64.exe)"
hemtt --version
echo "Install Binarize dependencies"
cp .\ci\binarize\X3DAudio1_7.dll,.\ci\binarize\XAPOFX1_5.dll C:\Windows\System32\
echo "::group::Set Binarize registry path"
New-Item "HKCU:\\Software\\Bohemia Interactive\\binarize" -Force | New-ItemProperty -Name path -Value "${{ github.workspace }}\ci\binarize"
echo "::endgroup::"
$version = Select-String -Path "addons\\main\\script_version.hpp" -Pattern '#define (MAJOR|MINOR|PATCHLVL|BUILD) (\d+)' | ForEach-Object { $_.Matches.Groups[2].Value } | Join-String -Separator "."
echo "VERSION=$version" >> $env:GITHUB_ENV
echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $env:GITHUB_ENV
- name: Test Binarize
run: |
echo "::group::Run Binarize without arguments (look for missing DLLs)"
./ci/binarize/binarize_x64.exe || true # binarize exits with 1 if no file given
echo "::endgroup::"
shell: bash # outputs missing dll information
- name: Build (HEMTT)
run: |
echo "ACRE2 v${{ env.VERSION }} (${{ env.SHA_SHORT }})"
hemtt release --no-archive
- name: Rename build folder
run: mv .hemttout/release .hemttout/@acre2
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: acre2
path: .hemttout/@*
retention-days: 1
include-hidden-files: true # Because .hemttout is a hidden directory
compile:
if: github.repository == 'IDI-Systems/acre2' && ! contains(github.event.head_commit.message, '[ci skip]')
runs-on: windows-latest
strategy:
matrix:
arch: [x86, x64]
env:
DXSDK_DIR: "${{ github.workspace }}\\ci\\directx-sdk" # CMake FindDirectX
steps:
- name: Checkout the source code
uses: actions/checkout@v4
- name: Setup BattlEye and DirectX SDK
run: |
C:\msys64\usr\bin\wget.exe ${{ secrets.FTP_SERVER }}/tools/acre2_tools.zip --user ${{ secrets.FTP_USERNAME }} --password ${{ secrets.FTP_PASSWORD }} -q
Expand-Archive acre2_tools.zip -DestinationPath ci
echo "Check BattlEye: $(Test-Path .\\ci\\battleye\\signtool.exe,.\\ci\\battleye\\idi-systems.pfx)"
echo "Check DirectX SDK: $(Test-Path .\\ci\\directx-sdk\\Include,.\\ci\\directx-sdk\\Lib\\${{ matrix.arch }})"
echo "DXSDK_DIR: ${{ env.DXSDK_DIR }}"
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Build Extensions (x86)
if: matrix.arch == 'x86'
run: |
cd extensions\\vcproj
cmake .. -A Win32
msbuild ACRE.sln /m '/t:ACRE2Arma\acre;ACRE2Arma\arma2ts;ACRE2\ACRE2Steam;ACRE2\ACRE2TS;Extras\Wav2B64' /p:Configuration=RelWithDebInfo
- name: Build Extensions (x64)
if: matrix.arch == 'x64'
run: |
cd extensions\\vcproj64
cmake .. -A x64
msbuild ACRE.sln /m '/t:ACRE2Arma\acre;ACRE2Arma\arma2ts;ACRE2\ACRE2Steam;ACRE2\ACRE2TS' /p:Configuration=RelWithDebInfo
- name: Sign (BattlEye)
run: |
.\ci\battleye\signtool.exe sign /f .\ci\battleye\idi-systems.pfx /p ${{ secrets.BE_CRED_PASSWORD }} /t http://timestamp.digicert.com *.dll
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: acre2-extensions-${{ matrix.arch }}
path: |
*.dll
extras/*.exe
plugin
symbols
retention-days: 1
publish-test:
needs: [build, compile]
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Prepare Archives
run: |
echo "Organize"
mv acre2/* .
mv acre2-extensions-*/*.dll @acre2/
mv acre2-extensions-*/extras/*.exe @acre2/extras/
mkdir @acre2/plugin && cp -r acre2-extensions-*/plugin/* @acre2/plugin/ # mv can't merge directories
mkdir symbols && mv acre2-extensions-*/symbols/* .
echo "::group::Archive build"
zip -r acre2_${{ needs.build.outputs.VERSION }}${{ github.event.inputs.label }}.zip @acre2
echo "::endgroup::"
echo "::group::Archive symbols"
zip -r acre2_${{ needs.build.outputs.VERSION }}${{ github.event.inputs.label }}_symbols.zip x86 x64
echo "::endgroup::"
ls *.zip
- name: Upload to FTP (ACRE2)
uses: appleboy/[email protected]
with:
host: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
source: "acre2_${{ needs.build.outputs.VERSION }}${{ github.event.inputs.label }}.zip"
target: "${{ secrets.FTP_SERVER }}/test/${{ github.event.inputs.path }}"
- name: Upload to FTP (Symbols)
uses: appleboy/[email protected]
with:
host: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
source: "acre2_${{ needs.build.outputs.VERSION }}${{ github.event.inputs.label }}_symbols.zip"
target: "${{ secrets.FTP_SERVER }}/test/${{ github.event.inputs.path }}"
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: Publisher
SLACK_ICON_EMOJI: ":package:"
SLACK_MESSAGE: 'Test-Build uploaded! https://${{ secrets.FTP_SERVER }}/dev/acre2_${{ needs.build.outputs.VERSION }}${{ github.event.inputs.label }}.zip'
SLACK_TITLE: Release Status
MSG_MINIMAL: actions url
publish-dev:
needs: [build, compile]
if: github.ref == 'refs/heads/development-build'
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Prepare Archives
run: |
echo "Organize"
mv acre2/* .
mv acre2-extensions-*/*.dll @acre2/
mv acre2-extensions-*/extras/*.exe @acre2/extras/
mkdir @acre2/plugin && cp -r acre2-extensions-*/plugin/* @acre2/plugin/ # mv can't merge directories
mkdir symbols && mv acre2-extensions-*/symbols/* .
echo "::group::Archive build"
zip -r acre2_${{ needs.build.outputs.VERSION }}.zip @acre2
echo "::endgroup::"
echo "::group::Archive symbols"
zip -r acre2_${{ needs.build.outputs.VERSION }}_symbols.zip x86 x64
echo "::endgroup::"
ls *.zip
- name: Upload to FTP (ACRE2)
uses: appleboy/[email protected]
with:
host: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
source: "acre2_${{ needs.build.outputs.VERSION }}.zip"
target: "${{ secrets.FTP_SERVER }}/dev"
- name: Upload to FTP (Symbols)
uses: appleboy/[email protected]
with:
host: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
source: "acre2_${{ needs.build.outputs.VERSION }}_symbols.zip"
target: "${{ secrets.FTP_SERVER }}/symbols"
- name: Upload to Steam (ACRE2 Dev Builds)
uses: arma-actions/workshop-upload@v1
with:
appId: '107410'
itemId: '774084145' # Dev Builds
contentPath: '@acre2'
changelog: 'Version ${{ needs.build.outputs.VERSION }} - See changelog on GitHub: https://github.com/IDI-Systems/acre2/compare/release-build...development-build'
env:
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: Publisher
SLACK_ICON_EMOJI: ":package:"
SLACK_MESSAGE: 'Dev-Build uploaded! https://${{ secrets.FTP_SERVER }}/dev/acre2_${{ needs.build.outputs.VERSION }}.zip'
SLACK_TITLE: Release Status
MSG_MINIMAL: actions url
publish-release:
needs: [build, compile]
if: github.ref == 'refs/heads/release-build'
runs-on: ubuntu-latest
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Prepare Archives
run: |
echo "Organize"
mv acre2/* .
mv acre2-extensions-*/*.dll @acre2/
mv acre2-extensions-*/extras/*.exe @acre2/extras/
mkdir @acre2/plugin && cp -r acre2-extensions-*/plugin/* @acre2/plugin/ # mv can't merge directories
mkdir symbols && mv acre2-extensions-*/symbols/* .
echo "::group::Archive build"
zip -r acre2_${{ needs.build.outputs.VERSION }}.zip @acre2
echo "::endgroup::"
echo "::group::Archive symbols"
zip -r acre2_${{ needs.build.outputs.VERSION }}_symbols.zip x86 x64
echo "::endgroup::"
ls *.zip
- name: Upload to FTP (ACRE2)
uses: appleboy/[email protected]
with:
host: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
source: "acre2_${{ needs.build.outputs.VERSION }}.zip"
target: "${{ secrets.FTP_SERVER }}/release"
- name: Upload to FTP (Symbols)
uses: appleboy/[email protected]
with:
host: ${{ secrets.FTP_SERVER }}
username: ${{ secrets.FTP_USERNAME }}
password: ${{ secrets.FTP_PASSWORD }}
source: "acre2_${{ needs.build.outputs.VERSION }}_symbols.zip"
target: "${{ secrets.FTP_SERVER }}/symbols"
- name: Upload to Steam (ACRE2)
uses: arma-actions/workshop-upload@v1
with:
appId: '107410'
itemId: '751965892' # Release
contentPath: '@acre2'
changelog: 'Version ${{ needs.build.outputs.VERSION }} - See changelog on GitHub: https://github.com/IDI-Systems/acre2/releases'
env:
STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
STEAM_PASSWORD: ${{ secrets.STEAM_PASSWORD }}
- name: Upload to GitHub
id: github_release
uses: softprops/action-gh-release@v1
with:
draft: true
files: acre2_${{ needs.build.outputs.VERSION }}.zip
name: 'ACRE2 v${{ needs.build.outputs.VERSION }}'
tag_name: v${{ needs.build.outputs.VERSION }}
target_commitish: ${{ github.sha }}
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACK_USERNAME: Publisher
SLACK_ICON_EMOJI: ":package:"
SLACK_MESSAGE: 'Release uploaded and published! Go to ${{ steps.github_release.outputs.url }} to finalize release notes and publish on GitHub.'
SLACK_TITLE: Release Status
MSG_MINIMAL: actions url