Skip to content

Commit

Permalink
CI: Remove vcvaralls.bat call in GHA. Done by package.py instead.
Browse files Browse the repository at this point in the history
  • Loading branch information
mario4tier committed Jan 15, 2025
1 parent 2772a7c commit 7ca2c7d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/dev-nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,10 @@ jobs:
if: runner.os == 'Windows'
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe > msbuild_path.txt
set /p MSBUILD_PATH=<msbuild_path.txt
set VCVARSALL=%MSBUILD_PATH%\..\..\..\..\VC\Auxiliary\Build\vcvarsall.bat
echo VCVARSALL=%VCVARSALL% >> %GITHUB_ENV%
:: call "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe > msbuild_path.txt
:: set /p MSBUILD_PATH=<msbuild_path.txt
:: set VCVARSALL=%MSBUILD_PATH%\..\..\..\..\VC\Auxiliary\Build\vcvarsall.bat
:: echo VCVARSALL=%VCVARSALL% >> %GITHUB_ENV%
echo PYTHON=python >> %GITHUB_ENV%
- name: Build dist assets (Windows x64)
Expand All @@ -68,7 +68,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: cmd
run: |
call "%VCVARSALL%" x64
:: call "%VCVARSALL%" x64
dotnet tool install --global wix
set PATH=%PATH%;%USERPROFILE%\.dotnet\tools
wix extension add --global WixToolset.UI.wixext
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/main-nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ jobs:
if: runner.os == 'Windows'
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe > msbuild_path.txt
set /p MSBUILD_PATH=<msbuild_path.txt
set VCVARSALL=%MSBUILD_PATH%\..\..\..\..\VC\Auxiliary\Build\vcvarsall.bat
echo VCVARSALL=%VCVARSALL% >> %GITHUB_ENV%
:: call "C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe > msbuild_path.txt
:: set /p MSBUILD_PATH=<msbuild_path.txt
:: set VCVARSALL=%MSBUILD_PATH%\..\..\..\..\VC\Auxiliary\Build\vcvarsall.bat
:: echo VCVARSALL=%VCVARSALL% >> %GITHUB_ENV%
echo PYTHON=python >> %GITHUB_ENV%
- name: Build dist assets (Windows x64)
Expand All @@ -70,7 +70,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: cmd
run: |
call "%VCVARSALL%" x64
:: call "%VCVARSALL%" x64
dotnet tool install --global wix
set PATH=%PATH%;%USERPROFILE%\.dotnet\tools
wix extension add --global WixToolset.UI.wixext
Expand Down
11 changes: 10 additions & 1 deletion scripts/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,13 @@ def update_package_digest(root_dir: str, results: dict, sources_digest: str, bui
print(f"Error: {asset_file_name} not successfully build.")
fatal_error = True


# If a github action, then reflect that the bot user did process that digest.
# The behavior is different for local devs for which we prefer to minimize rebuilds...
git_user_name = get_git_user_name()
if os.getenv('GITHUB_ACTIONS') == 'true':
pdigest.builder_id = git_user_name

# Double check with some simple rules:
# - tests should never be "pass" if the build was not successful.
# - If a digest says the build was successful, then the md5 and sources_digest should always match.
Expand Down Expand Up @@ -741,7 +748,9 @@ def update_package_digest(root_dir: str, results: dict, sources_digest: str, bui
pdigest.clear_tests()

if pdigest != pdigest_copy:
print(f"Info: {asset_file_name} digest file updated.")
# Writing a change, and keep track of the user that made it.
pdigest.builder_id = git_user_name
print(f"Info: {asset_file_name} digest file updated by {git_user_name}")
pdigest.write()

if fatal_error:
Expand Down

0 comments on commit 7ca2c7d

Please sign in to comment.