forked from FarGroup/FarManager
-
Notifications
You must be signed in to change notification settings - Fork 0
331 lines (292 loc) · 12.9 KB
/
build-release-vc.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
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
# 2024-09-02 00:40
# soft_fast_search patch
name: Build release VC
on:
# push:
# branches: [ master ]
# pull_request:
# branches: [ master ]
workflow_dispatch:
inputs:
extra_plugins_profile:
default: true
type: boolean
code-style-checks:
default: true
type: boolean
hlf-checks:
default: true
type: boolean
msbuild_cl_x64_release_input:
default: true
type: boolean
msbuild_cl_x86_release_input:
default: true
type: boolean
msbuild_cl_ARM64_release_input:
default: true
type: boolean
soft_fast_search_patch:
default: true
type: boolean
env:
PROG_NAME: "Far3"
TAG_NAME: "Far3"
Far_version: "3.0."
jobs:
#------------------------------------------------------------------------------
code-style-checks:
runs-on: ubuntu-latest
if: ${{ inputs.code-style-checks }}
steps:
- name: Checkout source
uses: deep-soft/checkout@v4
- name: Setup Python
uses: deep-soft/setup-python@v5
- name: Run checks
working-directory: far
run: python tools/source_validator.py
#------------------------------------------------------------------------------
hlf-checks:
runs-on: windows-2022
if: ${{ inputs.hlf-checks }}
steps:
- name: Checkout source
uses: deep-soft/checkout@v4
- uses: deep-soft/setup-dotnet@v4
with:
dotnet-version: '6.0'
- name: Build and run ChangelogChecker
working-directory: misc/build-checks/ChangelogChecker
run: dotnet run --project ./ChangelogChecker.csproj --configuration Release --property UseSharedCompilation=false
- name: Build and run HlfChecker
working-directory: misc/build-checks/HlfChecker
run: dotnet run --project ./HlfChecker.csproj --configuration Release --property UseSharedCompilation=false -- Verbose
#------------------------------------------------------------------------------
build-msbuild:
runs-on: windows-2022
strategy:
fail-fast: false
matrix:
build: [
msbuild_cl_x64_release,
msbuild_cl_x86_release,
msbuild_cl_ARM64_release,
# msbuild_cl_x64_debug,
# msbuild_cl_x86_debug,
]
include:
- { build: msbuild_cl_x64_release, compiler: msbuild_cl, arch: amd64, platform_sln: x64, platform_name: x64, build_config: Release }
- { build: msbuild_cl_x86_release, compiler: msbuild_cl, arch: amd64_x86, platform_sln: Win32, platform_name: x86, build_config: Release }
- { build: msbuild_cl_ARM64_release, compiler: msbuild_cl, arch: amd64_arm64, platform_sln: ARM64, platform_name: ARM64, build_config: Release }
# - { build: msbuild_cl_x64_debug, compiler: msbuild_cl, arch: amd64, platform_sln: x64, platform_name: x64, build_config: Debug }
# - { build: msbuild_cl_x86_debug, compiler: msbuild_cl, arch: amd64_x86, platform_sln: Win32, platform_name: x86, build_config: Debug }
# exclude:
# - { build: msbuild_cl_x64_release }: ${{ inputs.msbuild_cl_x64_release_input != true }}
# - { build: msbuild_cl_x86_release }: ${{ inputs.msbuild_cl_x86_release_input != true }}
# - { build: msbuild_cl_ARM64_release }: ${{ inputs.msbuild_cl_ARM64_release_input != true }}
steps:
- name: test var
if: always() && inputs.extra_plugins_profile && matrix.platform_sln == 'x64'
run: |
echo " if: always() && inputs.extra_plugins_profile && matrix.platform_sln == 'x64'"
- name: Checkout source
uses: deep-soft/checkout@v4
- name: soft_fast_search_patch
if: ${{ inputs.soft_fast_search_patch }}
continue-on-error: true
shell: bash
run: |
ls -la patch/filelist.diff || true;
if [[ -f patch/filelist.diff ]]; then
git apply --verbose patch/filelist.diff
fi
- name: Get program version
continue-on-error: false
shell: bash
run: |
Far_version=${{ env.Far_Version}}
Far_build=$(cat "far/vbuild.m4")
echo $Far_version$Far_build
echo "VERSION=$Far_version$Far_build.0" >> $GITHUB_ENV
- name: Print program version
continue-on-error: false
shell: bash
run: |
echo "Print program version"
echo ${{ env.VERSION }}
- name: Initialize CodeQL
if: matrix.build == 'msbuild_cl_x64_debug'
uses: github/codeql-action/init@v2
with:
languages: cpp
- name: Set MSVC environment
uses: deep-soft/msvc-dev-cmd@v1
with:
arch: ${{ matrix.arch }}
- name: Set environment for debug build
if: matrix.build_config == 'Debug'
run: |
Add-Content -Path $env:GITHUB_ENV -Value "DEBUG=1"
- name: Build (cl)
working-directory: _build/vc
run: |
msbuild -m /property:Configuration=${{ matrix.build_config }} /property:Platform=${{ matrix.platform_sln }} all.sln
- name: Perform CodeQL Analysis
if: matrix.build == 'msbuild_cl_x64_debug'
uses: github/codeql-action/analyze@v2
# - name: Create zip
# continue-on-error: true
# working-directory: _build/vc/_output/product/${{ matrix.build_config }}.${{ matrix.platform_sln }}
# run: |
# dir ./
# Compress-Archive . ../${{ env.PROG_NAME }}.${{ matrix.build_config }}.${{ matrix.platform_sln }}.${{ env.VERSION }}.zip
# dir ../
- name: Add extra plugins NetBox and Colorer
continue-on-error: true
shell: bash
run: |
pushd '_build/vc/_output/product/${{ matrix.build_config }}.${{ matrix.platform_sln }}/Plugins'
for extra_plug in Far-NetBox Far-Colorer ; do
mkdir $extra_plug
cd $extra_plug
curl -LOJ "https://github.com/deep-soft/$extra_plug/releases/download/$extra_plug-latest/$extra_plug.${{ matrix.platform_name }}.7z"
7z x $extra_plug.${{ matrix.platform_name }}.7z
rm $extra_plug.${{ matrix.platform_name }}.7z
cd ..
done
popd
- name: Sign Windows exe and dll files
continue-on-error: true
uses: deep-soft/code-sign-action@v9
with:
certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}'
password: '${{ secrets.WINDOWS_PFX_PASSWORD }}'
certificatesha1: '${{ secrets.WINDOWS_PFX_SHA1_THUMBPRINT }}'
# certificatename: '${{ secrets.CERTNAME }}'
folder: '_build/vc/_output/product/${{ matrix.build_config }}.${{ matrix.platform_sln }}'
recursive: true
- name: Create Zip Archive Release
if: matrix.build_config == 'Release'
uses: deep-soft/zip-release@v2
with:
type: 'zip'
filename: '${{ env.PROG_NAME }}.${{ matrix.platform_sln }}.${{ env.VERSION }}.zip'
directory: '_build/vc/_output/product/${{ matrix.build_config }}.${{ matrix.platform_sln }}'
exclusions: '*.map *.pdb'
recursive_exclusions: '*.map *.pdb changelog *Bel.lng *Cze.lng *Ger.lng *Hun.lng *Ita.lng *Lit.lng *Pol.lng *Rus.lng *Sky.lng *Spa.lng *Ukr* *Bel.hlf *Cze.hlf *Ger.hlf *Hun.hlf *Ita.hlf *Lit.hlf *Pol.hlf *Rus.hlf *Sky.hlf *Spa.hlf *Ukr*'
path: '.'
- name: Upload zip
if: matrix.build_config == 'Release'
continue-on-error: true
uses: deep-soft/upload-artifact@v4
with:
name: ${{ env.PROG_NAME }}.${{ matrix.platform_name }}.${{ env.VERSION }}.zip
#path: _build/vc/_output/product/${{ matrix.build_config }}.${{ matrix.platform_sln }}/${{ env.PROG_NAME }}.${{ matrix.build_config }}.${{ matrix.platform_sln }}.${{ env.VERSION }}.zip
path: ${{ env.ZIP_RELEASE_ARCHIVE }}
- name: Upload folder
if: matrix.build_config == 'Debug'
continue-on-error: true
uses: deep-soft/upload-artifact@v4
with:
name: ${{ env.PROG_NAME }}.${{ matrix.build_config }}.${{ matrix.platform_name }}
path: _build/vc/_output/product/${{ matrix.build_config }}.${{ matrix.platform_sln }}
# - name: Create list file
# continue-on-error: true
# shell: bash
# run: |
# list_file="${{ env.PROG_NAME }}.${{ matrix.build }}-${{ matrix.compiler }}-${{ matrix.arch }}-${{ matrix.platform_sln }}-${{ matrix.platform_name }}-${{ matrix.build_config }}.txt"
# ls -lR > $list_file
# echo "LIST_File=$list_file" >> $GITHUB_ENV
- name: Publish
if: matrix.build_config == 'Release'
continue-on-error: true
uses: deep-soft/[email protected]
with:
tag_name: ${{ env.TAG_NAME }}-${{ env.VERSION }}
# files: |
# ${{ env.LIST_File }}
files: |
${{ env.ZIP_RELEASE_ARCHIVE }}
- name: Prepare latest Release
if: matrix.build_config == 'Release'
continue-on-error: false
shell: bash
run: |
mv ${{ env.ZIP_RELEASE_ARCHIVE }} ${{ env.PROG_NAME }}.${{ matrix.platform_name }}.zip
echo "${{ env.VERSION }}" > ${{ env.PROG_NAME }}-latest.txt
- name: Publish latest Release
if: matrix.build_config == 'Release'
continue-on-error: false
uses: deep-soft/[email protected]
with:
draft: false
tag_name: ${{ env.PROG_NAME }}-latest
body: "${{ env.PROG_NAME }} latest: v${{ env.VERSION }}"
files: |
${{ env.PROG_NAME }}.${{ matrix.platform_name }}.zip
${{ env.PROG_NAME }}-latest.txt
# add extra plugins and Profile - begin
# if: ${{ matrix.platform_sln == 'x64' && inputs.extra_plugins_profile == 'true' }}
# if: ${{ inputs.extra_plugins_profile }} && ${{ matrix.platform_sln == 'x64' }}
- name: extra - Add plugins and Profile
if: always() && inputs.extra_plugins_profile && matrix.platform_sln == 'x64'
continue-on-error: true
shell: bash
run: |
pushd '_build/vc/_output/product/${{ matrix.build_config }}.${{ matrix.platform_sln }}'
curl -LOJ "https://github.com/deep-soft/DS-Progs/raw/main/bin/Far3-Plugins-Extra.zip"
curl -LOJ "https://github.com/deep-soft/DS-Progs/raw/main/bin/Far3-Profile.zip"
7z x Far3-Plugins-Extra.zip
7z x Far3-Profile.zip
rm Far3-Plugins-Extra.zip
rm Far3-Profile.zip
popd
- name: extra - Sign Windows exe and dll files
if: always() && inputs.extra_plugins_profile && matrix.platform_sln == 'x64'
continue-on-error: true
uses: deep-soft/code-sign-action@v9
with:
certificate: '${{ secrets.WINDOWS_PFX_BASE64 }}'
password: '${{ secrets.WINDOWS_PFX_PASSWORD }}'
certificatesha1: '${{ secrets.WINDOWS_PFX_SHA1_THUMBPRINT }}'
# certificatename: '${{ secrets.CERTNAME }}'
folder: '_build/vc/_output/product/${{ matrix.build_config }}.${{ matrix.platform_sln }}'
recursive: true
- name: extra - Create Zip Archive Release
if: always() && inputs.extra_plugins_profile && matrix.platform_sln == 'x64'
uses: deep-soft/zip-release@v2
with:
type: 'zip'
filename: '${{ env.PROG_NAME }}.${{ matrix.platform_sln }}.${{ env.VERSION }}-extra.zip'
directory: '_build/vc/_output/product/${{ matrix.build_config }}.${{ matrix.platform_sln }}'
exclusions: '*.map *.pdb'
recursive_exclusions: '*.map *.pdb changelog *Bel.lng *Cze.lng *Ger.lng *Hun.lng *Ita.lng *Lit.lng *Pol.lng *Rus.lng *Sky.lng *Spa.lng *Ukr* *Bel.hlf *Cze.hlf *Ger.hlf *Hun.hlf *Ita.hlf *Lit.hlf *Pol.hlf *Rus.hlf *Sky.hlf *Spa.hlf *Ukr*'
path: '.'
- name: extra - Publish
if: always() && inputs.extra_plugins_profile && matrix.platform_sln == 'x64'
continue-on-error: true
uses: deep-soft/[email protected]
with:
tag_name: ${{ env.TAG_NAME }}-${{ env.VERSION }}
files: |
${{ env.ZIP_RELEASE_ARCHIVE }}
- name: extra - Prepare latest Release
if: always() && inputs.extra_plugins_profile && matrix.platform_sln == 'x64'
continue-on-error: false
shell: bash
run: |
mv ${{ env.ZIP_RELEASE_ARCHIVE }} ${{ env.PROG_NAME }}.${{ matrix.platform_name }}-extra.zip
echo "${{ env.VERSION }}" > ${{ env.PROG_NAME }}-extra-latest.txt
- name: extra - Publish latest Release
if: always() && inputs.extra_plugins_profile && matrix.platform_sln == 'x64'
continue-on-error: false
uses: deep-soft/[email protected]
with:
draft: false
tag_name: ${{ env.PROG_NAME }}-latest
body: "${{ env.PROG_NAME }} latest: v${{ env.VERSION }}"
files: |
${{ env.PROG_NAME }}.${{ matrix.platform_name }}-extra.zip
${{ env.PROG_NAME }}-extra-latest.txt
# add extra plugins and Profile - end