Skip to content

Commit 5c072d7

Browse files
WIP: Base build CD
1 parent f3663fc commit 5c072d7

1 file changed

Lines changed: 193 additions & 0 deletions

File tree

.github/workflows/Base-CD.yml

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
name: Base Installer
2+
on:
3+
push:
4+
branches: ["release/9.3", "feature/gha-cd"]
5+
workflow_dispatch:
6+
inputs:
7+
fw_ref:
8+
description: 'Commit-ish (branch, tag, SHA) to checkout for the main repository'
9+
required: false
10+
default: ''
11+
helps_ref:
12+
description: 'Commit-ish for helps repository'
13+
required: false
14+
default: 'develop'
15+
installer_ref:
16+
description: 'Commit-ish for PatchableInstaller repository'
17+
required: false
18+
default: 'master'
19+
localizations_ref:
20+
description: 'Commit-ish for localization repository'
21+
required: false
22+
default: 'develop'
23+
lcm_ref:
24+
description: 'Commit-ish for liblcm repository'
25+
required: false
26+
default: 'master'
27+
28+
concurrency:
29+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
30+
cancel-in-progress: true
31+
32+
jobs:
33+
debug_build_and_test:
34+
env:
35+
CROWDIN_API_KEY: ${{ secrets.FLEX_CROWDIN_API }}
36+
LcmRootDir: ${{ github.workspace }}/Localizations/LCM
37+
name: Build Debug and run Tests
38+
runs-on: windows-latest
39+
steps:
40+
- name: Checkout Files
41+
uses: actions/checkout@v4
42+
id: checkout
43+
with:
44+
ref: ${{ github.event.inputs.fw_ref || github.ref }}
45+
fetch-depth: 0
46+
- name: Checkout Helps
47+
uses: actions/checkout@v4
48+
id: helps-checkout
49+
with:
50+
repository: 'https://github.com/sillsdev/FwHelps'
51+
ref: ${{ github.event.inputs.helps_ref || 'develop' }}
52+
fetch-depth: 0
53+
path: 'DistFiles/Helps'
54+
- name: Checkout PatchableInstaller
55+
uses: actions/checkout@v4
56+
id: installer-checkout
57+
with:
58+
repository: 'https://github.com/sillsdev/genericinstaller'
59+
ref: ${{ github.event.inputs.installer_ref || 'master' }}
60+
fetch-depth: 0
61+
path: 'PatchableInstaller'
62+
- name: Checkout Localizations
63+
uses: actions/checkout@v4
64+
id: loc-checkout
65+
with:
66+
repository: 'https://github.com/sillsdev/FwLocalizations'
67+
ref: ${{ github.event.inputs.localizations_ref || 'develop' }}
68+
fetch-depth: 0
69+
path: 'Localizations'
70+
- name: Checkout liblcm
71+
uses: actions/checkout@v4
72+
id: liblcm-checkout
73+
with:
74+
repository: 'https://github.com/sillsdev/liblcm'
75+
ref: ${{ github.event.inputs.installer_ref || 'master' }}
76+
fetch-depth: 0
77+
path: 'Localizations/LCM'
78+
79+
- name: Download 461 targeting pack
80+
uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9 # 1.6.0
81+
id: downloadfile # Remember to give an ID if you need the output filename
82+
with:
83+
url: "https://download.microsoft.com/download/F/1/D/F1DEB8DB-D277-4EF9-9F48-3A65D4D8F965/NDP461-DevPack-KB3105179-ENU.exe"
84+
target: public/
85+
86+
- name: Install targeting pack
87+
shell: cmd
88+
working-directory: public
89+
run: NDP461-DevPack-KB3105179-ENU.exe /q
90+
91+
- name: Setup dotnet
92+
uses: actions/setup-dotnet@v4
93+
with:
94+
dotnet-version: |
95+
2.1.x
96+
3.1.x
97+
5.0.x
98+
- name: Install Overcrowdin
99+
shell: cmd
100+
run: |
101+
dotnet tool update -g overcrowdin || dotnet tool install -g overcrowdin
102+
overcrowdin exporttranslations -v
103+
- name: Prepare for build
104+
shell: cmd
105+
working-directory: Build
106+
run: build64.bat /t:WriteNonlocalDevelopmentPropertiesFile
107+
108+
- name: Build Debug and run tests
109+
id: build_installer
110+
shell: powershell
111+
run: |
112+
cd Build
113+
.\build64.bat /t:BuildBaseInstaller /property:config=release;action=test;desktopNotAvailable=true /v:d /bl ^| tee-object -FilePath build.log
114+
cd ..
115+
cd BuildDir
116+
md5sum *.exe > md5.txt
117+
118+
- name: Scan Debug Build Output
119+
shell: powershell
120+
working-directory: Build
121+
run: |
122+
$results = Select-String -Path "build.log" -Pattern "^\s*[1-9][0-9]* Error\(s\)"
123+
if ($results) {
124+
foreach ($result in $results) {
125+
Write-Host "Found errors in build.log $($result.LineNumber): $($result.Line)" -ForegroundColor red
126+
}
127+
exit 1
128+
} else {
129+
Write-Host "No errors found" -ForegroundColor green
130+
exit 0
131+
}
132+
133+
- name: Capture Test Results
134+
shell: powershell
135+
working-directory: Build
136+
run: .\NUnitReport /a ^| tee-object -FilePath test-results.log
137+
138+
- name: Report Test Results
139+
uses: sillsdev/fw-nunitreport-action@v2.0.0
140+
with:
141+
log-path: Build/test-results.log
142+
token: ${{ secrets.GITHUB_TOKEN }}
143+
144+
- name: Extract burn engines
145+
id: extract_engines
146+
if: github.event_name != 'pull_request'
147+
working-directory: BuildDir
148+
shell: cmd
149+
run: |
150+
insignia -ib FieldWorks_Offline.exe -o offline-engine.exe
151+
insignia -ib FieldWorks_Online.exe -o online-engine.exe
152+
153+
- name: Sign Engines
154+
if: github.event_name != 'pull_request'
155+
uses: sillsdev/codesign/trusted-signing-action@v3
156+
with:
157+
credentials: ${{ secrets.TRUSTED_SIGNING_CREDENTIALS }}
158+
files-folder: BuildDir
159+
files-folder-filter: '*-engine.exe'
160+
description: 'FieldWorks Installer'
161+
description-url: 'https://software.sil.org/fieldworks/'
162+
163+
- name: Reattach Engines
164+
if: github.event_name != 'pull_request'
165+
working-directory: BuildDir
166+
shell: cmd
167+
run: |
168+
insignia -ab online-engine.exe FlexBridge_Online.exe -o FlexBridge_Online.exe
169+
insignia -ab offline-engine.exe FlexBridge_Offline.exe -o FlexBridge_Offline.exe
170+
171+
- name: Sign Bundles
172+
if: github.event_name != 'pull_request'
173+
uses: sillsdev/codesign/trusted-signing-action@v3
174+
with:
175+
credentials: ${{ secrets.TRUSTED_SIGNING_CREDENTIALS }}
176+
files-folder: BuildDir
177+
files-folder-filter: FieldWorks_*.exe
178+
description: 'FieldWorks Installer'
179+
description-url: 'https://software.sil.org/fieldworks/'
180+
181+
- name: Upload Signed Installers
182+
uses: actions/upload-artifact@v4
183+
if: github.event_name != 'pull_request'
184+
with:
185+
name: FieldWorks-Installers
186+
path: BuildDir/FieldWorks_*.exe
187+
if-no-files-found: warn
188+
189+
- uses: actions/upload-artifact@v4
190+
with:
191+
name: build-logs
192+
path: Build/*.log
193+
path: Build/*.binlog

0 commit comments

Comments
 (0)