Skip to content

Commit 5d4d56f

Browse files
authored
chore: add windows x64 release (leejet#21)
1 parent cb01ade commit 5d4d56f

File tree

1 file changed

+53
-1
lines changed

1 file changed

+53
-1
lines changed

.github/workflows/build.yml

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
name: CI
22

33
on:
4+
workflow_dispatch: # allows manual triggering
5+
inputs:
6+
create_release:
7+
description: 'Create new release'
8+
required: true
9+
type: boolean
410
push:
511
branches:
612
- master
13+
- ci
714
paths: ['.github/workflows/**', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu']
815
pull_request:
916
types: [opened, synchronize, reopened]
@@ -75,6 +82,18 @@ jobs:
7582
windows-latest-cmake:
7683
runs-on: windows-latest
7784

85+
strategy:
86+
matrix:
87+
include:
88+
- build: 'noavx'
89+
defines: '-DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF'
90+
- build: 'avx2'
91+
defines: '-DGGML_AVX2=ON'
92+
- build: 'avx'
93+
defines: '-DGGML_AVX2=OFF'
94+
- build: 'avx512'
95+
defines: '-DGGML_AVX512=ON'
96+
7897
steps:
7998
- name: Clone
8099
id: checkout
@@ -87,12 +106,45 @@ jobs:
87106
run: |
88107
mkdir build
89108
cd build
90-
cmake ..
109+
cmake .. ${{ matrix.defines }}
91110
cmake --build . --config Release
92111
112+
- name: Check AVX512F support
113+
id: check_avx512f
114+
if: ${{ matrix.build == 'avx512' }}
115+
continue-on-error: true
116+
run: |
117+
cd build
118+
$vcdir = $(vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath)
119+
$msvc = $(join-path $vcdir $('VC\Tools\MSVC\'+$(gc -raw $(join-path $vcdir 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt')).Trim()))
120+
$cl = $(join-path $msvc 'bin\Hostx64\x64\cl.exe')
121+
echo 'int main(void){unsigned int a[4];__cpuid(a,7);return !(a[1]&65536);}' >> avx512f.c
122+
& $cl /O2 /GS- /kernel avx512f.c /link /nodefaultlib /entry:main
123+
.\avx512f.exe && echo "AVX512F: YES" && ( echo HAS_AVX512F=1 >> $env:GITHUB_ENV ) || echo "AVX512F: NO"
124+
93125
#- name: Test
94126
#id: cmake_test
95127
#run: |
96128
#cd build
97129
#ctest -C Release --verbose --timeout 900
98130

131+
- name: Get commit hash
132+
id: commit
133+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
134+
uses: pr-mpt/actions-commit-hash@v2
135+
136+
- name: Pack artifacts
137+
id: pack_artifacts
138+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
139+
run: |
140+
Copy-Item ggml/LICENSE .\build\bin\Release\ggml.txt
141+
Copy-Item LICENSE .\build\bin\Release\stable-diffusion.cpp.txt
142+
7z a sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip .\build\bin\Release\*
143+
144+
- name: Upload artifacts
145+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
146+
uses: actions/upload-artifact@v3
147+
with:
148+
path: |
149+
sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip
150+

0 commit comments

Comments
 (0)