From 4c7a442fd9131743801fb9d8a5e116add2a3d0e6 Mon Sep 17 00:00:00 2001 From: izzy2lost Date: Fri, 8 Aug 2025 13:11:31 -0400 Subject: [PATCH 1/3] Update windows_build.yml --- .github/workflows/windows_build.yml | 44 ++++++----------------------- 1 file changed, 9 insertions(+), 35 deletions(-) diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index 81a20f9..a8e96de 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -1,48 +1,22 @@ name: Windows Compile on: - workflow_dispatch: + push: + branches: [ "*" ] + pull_request: + branches: [ "main" ] jobs: build: runs-on: windows-2022 - strategy: - matrix: - config: [Release, Debug] - toolchain: [windows-msvc, windows-clang-cl] - standalone: [OFF, ON] - generate: [Visual Studio 17 2022, Ninja] - arch: [x64, Win32] - isPR: - - ${{ github.event_name == 'pull_request' }} - exclude: - - toolchain: windows-clang-cl - arch: Win32 - - isPR: true - standalone: OFF - exclude: - - toolchain: windows-clang-cl - arch: Win32 steps: - uses: actions/checkout@v4 - - name: Build Visual Studio - if: ${{ matrix.generate == 'Visual Studio 17 2022' }} + - name: Build run: | - cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain/${{ matrix.toolchain }}.cmake" -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }} - cmake --build ./build/${{ matrix.arch }} - - name: Setup Variables - if: ${{ matrix.generate == 'Ninja' }} - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: ${{ matrix.arch }} - - name: Build Ninja - if: ${{ matrix.generate == 'Ninja' }} - run: | - cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain/${{ matrix.toolchain }}.cmake" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }} - cmake --build ./build/${{ matrix.arch }} + cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v142 -A x64 -DCMAKE_BUILD_TYPE:STRING=Release + cmake --build ./build/x64 - name: Publish packaged artifacts - if: ${{ matrix.config == 'Release' && matrix.generate == 'Visual Studio 17 2022' && matrix.standalone == 'ON' }} uses: actions/upload-artifact@v4 with: - name: torch-windows-${{ matrix.arch }}-${{ matrix.toolchain }} - path: build/${{ matrix.arch }}/Release/torch.exe + name: torch-windows-x64 + path: build/x64/Debug/torch.exe From 44c73b7a7d39a86406427d02ec70f4edb96551cb Mon Sep 17 00:00:00 2001 From: izzy2lost Date: Fri, 8 Aug 2025 13:16:17 -0400 Subject: [PATCH 2/3] Update windows_build.yml --- .github/workflows/windows_build.yml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index a8e96de..0148625 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -1,22 +1,31 @@ name: Windows Compile on: - push: - branches: [ "*" ] - pull_request: - branches: [ "main" ] + workflow_dispatch: jobs: build: runs-on: windows-2022 steps: - uses: actions/checkout@v4 - - name: Build + - name: Build Visual Studio + if: ${{ matrix.generate == 'Visual Studio 17 2022' }} run: | - cmake -S . -B "build/x64" -G "Visual Studio 17 2022" -T v142 -A x64 -DCMAKE_BUILD_TYPE:STRING=Release - cmake --build ./build/x64 + cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain/${{ matrix.toolchain }}.cmake" -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }} + cmake --build ./build/${{ matrix.arch }} + - name: Setup Variables + if: ${{ matrix.generate == 'Ninja' }} + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} + - name: Build Ninja + if: ${{ matrix.generate == 'Ninja' }} + run: | + cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain/${{ matrix.toolchain }}.cmake" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }} + cmake --build ./build/${{ matrix.arch }} - name: Publish packaged artifacts + if: ${{ matrix.config == 'Release' && matrix.generate == 'Visual Studio 17 2022' && matrix.standalone == 'ON' }} uses: actions/upload-artifact@v4 with: - name: torch-windows-x64 - path: build/x64/Debug/torch.exe + name: torch-windows-${{ matrix.arch }}-${{ matrix.toolchain }} + path: build/${{ matrix.arch }}/Release/torch.exe From d3f44a1b97e10f25e324c583ce8249ff9b444f63 Mon Sep 17 00:00:00 2001 From: izzy2lost Date: Fri, 8 Aug 2025 13:20:04 -0400 Subject: [PATCH 3/3] Update windows_build.yml --- .github/workflows/windows_build.yml | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/.github/workflows/windows_build.yml b/.github/workflows/windows_build.yml index 0148625..d696082 100644 --- a/.github/workflows/windows_build.yml +++ b/.github/workflows/windows_build.yml @@ -8,24 +8,17 @@ jobs: runs-on: windows-2022 steps: - uses: actions/checkout@v4 - - name: Build Visual Studio - if: ${{ matrix.generate == 'Visual Studio 17 2022' }} + + - name: Configure CMake (Visual Studio 17 2022, x64) run: | - cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain/${{ matrix.toolchain }}.cmake" -DCMAKE_GENERATOR_PLATFORM=${{ matrix.arch }} -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }} - cmake --build ./build/${{ matrix.arch }} - - name: Setup Variables - if: ${{ matrix.generate == 'Ninja' }} - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: ${{ matrix.arch }} - - name: Build Ninja - if: ${{ matrix.generate == 'Ninja' }} + cmake -S . -B build/x64 -G "Visual Studio 17 2022" -DCMAKE_GENERATOR_PLATFORM=x64 + + - name: Build torch.exe run: | - cmake -S . -B "build/${{ matrix.arch }}" -G "${{ matrix.generate }}" -DCMAKE_TOOLCHAIN_FILE="cmake/toolchain/${{ matrix.toolchain }}.cmake" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.config }} -DUSE_STANDALONE=${{ matrix.standalone }} - cmake --build ./build/${{ matrix.arch }} - - name: Publish packaged artifacts - if: ${{ matrix.config == 'Release' && matrix.generate == 'Visual Studio 17 2022' && matrix.standalone == 'ON' }} + cmake --build build/x64 --config Release + + - name: Publish packaged artifact uses: actions/upload-artifact@v4 with: - name: torch-windows-${{ matrix.arch }}-${{ matrix.toolchain }} - path: build/${{ matrix.arch }}/Release/torch.exe + name: torch-windows-x64 + path: build/x64/Release/torch.exe