-
-
Notifications
You must be signed in to change notification settings - Fork 19
171 lines (148 loc) · 5.69 KB
/
ci-cd.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
name: FlexBridge CI/CD
on:
push:
branches: ["develop", "master"]
pull_request:
branches: ["develop", "master"]
workflow_dispatch:
inputs:
releaseType:
description: 'Alpha, Beta, Stable used to stamp release artifacts'
required: true
default: 'Alpha'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build_and_test:
env:
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
FILESTOSIGNLATER: "${{ github.workspace }}\\filesToSign"
teamcity_build_checkoutDir: ${{ github.workspace }}
name: Build Debug and run Tests
runs-on: windows-latest
steps:
- name: Checkout Files
uses: actions/checkout@v4
id: checkout
with:
fetch-depth: 0
submodules: true
- name: Download 461 targeting pack
uses: suisei-cn/actions-download-file@818d6b7dc8fe73f2f924b6241f2b1134ca1377d9 # 1.6.0
id: downloadfile # Remember to give an ID if you need the output filename
with:
url: "https://download.microsoft.com/download/F/1/D/F1DEB8DB-D277-4EF9-9F48-3A65D4D8F965/NDP461-DevPack-KB3105179-ENU.exe"
target: public/
- name: Install targeting pack
shell: cmd
working-directory: public
run: NDP461-DevPack-KB3105179-ENU.exe /q
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
# We need the dotnet runtime to execute overcrowdin
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version:
8.0.x
if: github.event_name != 'pull_request'
- name: Downgrade Wix Toolset - remove when runner has 3.14.2
run: |
choco uninstall wixtoolset
choco install wixtoolset --version 3.11.2 --allow-downgrade --force
echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# If we are just doing a CI build we don't need real localizations, but the location must exist
- name: Add Fake Localizations for CI
shell: bash
run: echo > DistFiles/localizations/empty.xlf
if: github.event_name == 'pull_request'
- name: Install Latest Overcrowdin
shell: cmd
run: dotnet tool install -g overcrowdin
if: github.event_name != 'pull_request'
- name: Restore L10n Packages
shell: cmd
run: |
cd l10n
msbuild l10n.proj /t:restore
if: github.event_name != 'pull_request'
- name: Get Latest L10ns
shell: cmd
run: |
cd l10n
msbuild l10n.proj /t:GetLatestL10ns;CopyL10nsToDistFiles
if: github.event_name != 'pull_request'
- name: Restore Build Tasks & Packages
id: package_restore
shell: cmd
run: msbuild build\FLExBridge.proj /t:RestoreBuildTasks;RestorePackages
- name: Build & Test
id: build_and_test_step
shell: cmd
run: msbuild build\FLExBridge.proj /t:Test /p:Configuration=Release
# All the following are used only when building an installer after a merge
- name: Build Msi
id: build_msi
shell: cmd
run: |
msbuild build/FLExBridge.proj /t:CleanMasterOutputDir;PreparePublishingArtifactsInternal;BuildProductBaseMsi /p:UploadFolder=${{ inputs.environment || 'Alpha' }}
if: github.event_name != 'pull_request'
- name: Prepare for msi signing
shell: bash
run: |
echo "FILES_TO_SIGN=$(cat $FILESTOSIGNLATER)" >> $GITHUB_OUTPUT
id: gathered_files
if: github.event_name != 'pull_request'
- name: upload-msi
id: upload
uses: actions/upload-artifact@v4
with:
name: FlexBridge.msi
path: ${{ steps.gathered_files.outputs.FILES_TO_SIGN }}
if-no-files-found: error
overwrite: true
if: github.event_name != 'pull_request'
sign-msi:
name: Sign FlexBridge Installer
needs: build_and_test
if: github.event_name != 'pull_request'
uses: sillsdev/codesign/.github/workflows/sign.yml@feature/enableDispatchCalls
with:
artifact: FlexBridge.msi
description: 'FLex Bridge Installer'
secrets:
certificate: ${{ secrets.CODESIGN_LSDEVSECTIGOEV }}
build-offline-bundle:
name: Build offline bundle
needs: sign-msi
if: github.event_name != 'pull_request'
runs-on: windows-latest
steps:
- name: Checkout Files
uses: actions/checkout@v4
id: checkout
with:
fetch-depth: 0
submodules: true
- name: Downgrade Wix Toolset - remove when runner has 3.14.2
run: |
choco uninstall wixtoolset
choco install wixtoolset --version 3.11.2 --allow-downgrade --force
echo "C:\Program Files (x86)\WiX Toolset v3.11\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Download FlexBridge artifact
uses: actions/download-artifact@v4
with:
name: FlexBridge.msi
path: src/WiXInstaller/BaseInstallerBuild # Target directory for the downloaded artifact
run: ls -R src/WiXInstaller/BaseInstallerBuild
# - name: Unzip FlexBridge artifact
# run: unzip src/WiXInstaller/BaseInstallerBuild/FlexBridge.msi.zip -d src/WiXInstaller/BaseInstallerBuild
# All the following are used only when building an installer after a merge
- name: Build Bundles
id: build_bundles
shell: cmd
run: |
msbuild build/FLExBridge.proj /t:BuildProductBaseBundles