Skip to content

Commit 5116141

Browse files
committed
fixup! release: create initial Windows installer build workflow
Add microsoft/git-specific components to Windows build
1 parent 7ee4203 commit 5116141

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

.github/workflows/build-git-installers.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,75 @@ jobs:
182182
echo -n "$CODESIGN_P12" | tr % '\n' | base64 -d >home/.sig/codesign.p12 &&
183183
echo -n "$CODESIGN_PASS" >home/.sig/codesign.pass &&
184184
git config --global alias.signtool '!sh "/usr/src/build-extra/signtool.sh"'
185+
- name: Retarget auto-update to microsoft/git
186+
shell: bash
187+
run: |
188+
set -x
189+
190+
b=/usr/src/build-extra &&
191+
192+
filename=$b/git-update-git-for-windows.config
193+
tr % '\t' >$filename <<-\EOF
194+
[update]
195+
%fromFork = microsoft/git
196+
EOF &&
197+
198+
sed -i -e '/^#include "file-list.iss"/a\
199+
Source: {#SourcePath}\\..\\'$filename'; DestDir: {app}\\mingw64\\bin; Flags: replacesameversion; AfterInstall: DeleteFromVirtualStore' \
200+
-e '/^Type: dirifempty; Name: {app}\\{#MINGW_BITNESS}$/i\
201+
Type: files; Name: {app}\\{#MINGW_BITNESS}\\bin\\git-update-git-for-windows.config\
202+
Type: dirifempty; Name: {app}\\{#MINGW_BITNESS}\\bin' \
203+
$b/installer/install.iss
204+
- name: Set the installer Publisher to the Git Fundamentals team
205+
shell: bash
206+
run: |
207+
b=/usr/src/build-extra &&
208+
sed -i -e 's/^\(AppPublisher=\).*/\1The Git Fundamentals Team at GitHub/' $b/installer/install.iss
209+
- name: Let the installer configure Visual Studio to use the installed Git
210+
shell: bash
211+
run: |
212+
set -x
213+
214+
b=/usr/src/build-extra &&
215+
216+
sed -i -e '/^ *InstallAutoUpdater();$/a\
217+
CustomPostInstall();' \
218+
-e '/^ *UninstallAutoUpdater();$/a\
219+
CustomPostUninstall();' \
220+
$b/installer/install.iss &&
221+
222+
cat >>$b/installer/helpers.inc.iss <<\EOF
223+
224+
procedure CustomPostInstall();
225+
begin
226+
if not RegWriteStringValue(HKEY_CURRENT_USER,'Software\Microsoft\VSCommon\15.0\TeamFoundation\GitSourceControl','GitPath',ExpandConstant('{app}')) or
227+
not RegWriteStringValue(HKEY_CURRENT_USER,'Software\Microsoft\VSCommon\16.0\TeamFoundation\GitSourceControl','GitPath',ExpandConstant('{app}')) or
228+
not RegWriteStringValue(HKEY_CURRENT_USER,'Software\Microsoft\VSCommon\17.0\TeamFoundation\GitSourceControl','GitPath',ExpandConstant('{app}')) then
229+
LogError('Could not register TeamFoundation\GitSourceControl');
230+
end;
231+
232+
procedure CustomPostUninstall();
233+
begin
234+
if not RegDeleteValue(HKEY_CURRENT_USER,'Software\Microsoft\VSCommon\15.0\TeamFoundation\GitSourceControl','GitPath') or
235+
not RegDeleteValue(HKEY_CURRENT_USER,'Software\Microsoft\VSCommon\16.0\TeamFoundation\GitSourceControl','GitPath') or
236+
not RegDeleteValue(HKEY_CURRENT_USER,'Software\Microsoft\VSCommon\17.0\TeamFoundation\GitSourceControl','GitPath') then
237+
LogError('Could not register TeamFoundation\GitSourceControl');
238+
end;
239+
EOF
240+
- name: Enable Scalar/C and the auto-updater in the installer by default
241+
shell: bash
242+
run: |
243+
set -x
244+
245+
b=/usr/src/build-extra &&
246+
247+
sed -i -e "/ChosenOptions:=''/a\\
248+
if (ExpandConstant('{param:components|/}')='/') then begin\n\
249+
WizardSelectComponents('autoupdate');\n\
250+
#ifdef WITH_SCALAR\n\
251+
WizardSelectComponents('scalar');\n\
252+
#endif\n\
253+
end;" $b/installer/install.iss
185254
- name: Build 64-bit ${{matrix.artifact.name}}
186255
shell: bash
187256
run: |

0 commit comments

Comments
 (0)