-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] Create build_wheels_windows.yml (#1101)
* Create build_wheels_windows.yml * Create vc_env_helper.bat * Update build_wheels_windows.yml * Update build_wheels_windows.yml * Update vc_env_helper.bat * Update vc_env_helper.bat * Update vc_env_helper.bat * Update build_wheels_windows.yml
- Loading branch information
Showing
2 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Build Windows Wheels | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- build/packaging/** | ||
- .github/workflows/build_wheels_windows.yml | ||
- setup.py | ||
push: | ||
branches: | ||
- nightly | ||
- main | ||
- release/* | ||
tags: | ||
# NOTE: Binary build pipelines should only get triggered on release candidate builds | ||
# Release candidate tags look like: v1.11.0-rc1 | ||
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+ | ||
schedule: | ||
- cron: '0 0 * * *' # Runs at midnight UTC every day | ||
workflow_dispatch: | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
generate-matrix: | ||
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main | ||
with: | ||
package-type: wheel | ||
os: windows | ||
test-infra-repository: pytorch/test-infra | ||
test-infra-ref: main | ||
with-xpu: enable | ||
with-cuda: disable | ||
|
||
build: | ||
needs: generate-matrix | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- repository: pytorch/ao | ||
pre-script: packaging/pre_build_script.sh | ||
env-script: packaging/vc_env_helper.bat | ||
# post-script: "python packaging/wheel/relocate.py" | ||
smoke-test-script: packaging/smoke_test.py | ||
package-name: torchao | ||
name: ${{ matrix.repository }} | ||
uses: pytorch/test-infra/.github/workflows/build_wheels_windows.yml@main | ||
with: | ||
repository: ${{ matrix.repository }} | ||
ref: "" | ||
test-infra-repository: pytorch/test-infra | ||
test-infra-ref: main | ||
build-matrix: ${{ needs.generate-matrix.outputs.matrix }} | ||
pre-script: ${{ matrix.pre-script }} | ||
env-script: ${{ matrix.env-script }} | ||
post-script: ${{ matrix.post-script }} | ||
package-name: ${{ matrix.package-name }} | ||
smoke-test-script: ${{ matrix.smoke-test-script }} | ||
trigger-event: ${{ github.event_name }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
@echo on | ||
|
||
set VC_VERSION_LOWER=17 | ||
set VC_VERSION_UPPER=18 | ||
if "%VC_YEAR%" == "2019" ( set VC_VERSION_LOWER=16 set VC_VERSION_UPPER=17) | ||
if "%VC_YEAR%" == "2017" ( set VC_VERSION_LOWER=15 set VC_VERSION_UPPER=16) | ||
|
||
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -legacy -products * -version [%VC_VERSION_LOWER%^,%VC_VERSION_UPPER%^) -property installationPath`) do ( | ||
if exist "%%i" if exist "%%i\VC\Auxiliary\Build\vcvarsall.bat" ( | ||
set "VS15INSTALLDIR=%%i" | ||
set "VS15VCVARSALL=%%i\VC\Auxiliary\Build\vcvarsall.bat" | ||
goto vswhere | ||
) | ||
) | ||
|
||
:vswhere | ||
if "%VSDEVCMD_ARGS%" == "" ( | ||
call "%VS15VCVARSALL%" x64 || exit /b 1 | ||
) else ( | ||
call "%VS15VCVARSALL%" x64 %VSDEVCMD_ARGS% || exit /b 1 | ||
) | ||
|
||
@echo on | ||
|
||
if "%CU_VERSION%" == "xpu" call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" | ||
|
||
set DISTUTILS_USE_SDK=1 | ||
|
||
set args=%1 | ||
shift | ||
:start | ||
if [%1] == [] goto done | ||
set args=%args% %1 | ||
shift | ||
goto start | ||
|
||
:done | ||
if "%args%" == "" ( | ||
echo Usage: vc_env_helper.bat [command] [args] | ||
echo e.g. vc_env_helper.bat cl /c test.cpp | ||
) | ||
|
||
%args% || exit /b 1 |