Import vsdevcmd environment variables if missing during build
Rob Mensching committed
Oct 19, 2021 at 19:30 UTC
4ca1a77e321c48078a0060ac116db4e755dff417
2 files changed
+21
-9
.github/workflows/build.yml
+5
-9
@@ -24,17 +24,13 @@ jobs:
24
- name: Checkout code
25
uses: actions/checkout@v2
26
27
- - name: Setup dotnet
28
- uses: actions/setup-dotnet@v1
29
- with:
30
- dotnet-version: '5.0.x'
31
-
32
- - name: Add MSBuild to PATH
33
- uses: microsoft/setup-msbuild@v1.0.3
34
-
27
- name: Build wix4
28
shell: cmd
37
- run: ./build.cmd
29
+ run: ./src/build_official.cmd
30
+ env:
31
+ RuntimeTestsEnabled: ${{ github.ref == 'refs/heads/master' }}
32
+ SigningUser: ${{ github.ref == 'refs/heads/master' && secrets.WIX_SIGNING_USER || '' }}
33
+ SigningSecret: ${{ github.ref == 'refs/heads/master' && secrets.WIX_SIGNING_SECRET || '' }}
34
35
- name: Save build
36
uses: actions/upload-artifact@v2
src/build_all.cmd
+16
@@ -6,6 +6,8 @@
6
@if /i "%1"=="release" set _C=Release
7
@if not "%1"=="" shift & goto parse_args
8
9
+@if "%VCToolsVersion%"=="" call :StartDeveloperCommandPrompt
10
+
11
@echo build %_C%
12
13
:: Initialize required files/folders
@@ -56,5 +58,19 @@ call ext\ext.cmd %_C% || exit /b
58
59
call test\test.cmd %_C% || exit /b
60
61
+goto LExit
62
+
63
+:StartDeveloperCommandPrompt
64
+echo Initializing developer command prompt
65
+for /f "usebackq delims=" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationPath`) do (
66
+ if exist "%%i\Common7\Tools\vsdevcmd.bat" (
67
+ call "%%i\Common7\Tools\vsdevcmd.bat" -no_logo
68
+ exit /b
69
+ )
70
+)
71
+
72
+exit /b 2
73
+
74
+:LExit
75
@popd
76
@endlocal