3838env :
3939 BRANCH_NAME : ${{ github.head_ref || github.ref_name }}
4040
41+ concurrency :
42+ group : ${{ github.workflow }}-${{ github.head_ref && github.ref || github.run_id }}
43+ cancel-in-progress : true
44+
4145jobs :
4246 ubuntu-latest-cmake :
4347 runs-on : ubuntu-latest
@@ -92,6 +96,123 @@ jobs:
9296 path : |
9397 sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}.zip
9498
99+ ubuntu-latest-cmake-vulkan :
100+ runs-on : ubuntu-latest
101+
102+ steps :
103+ - name : Clone
104+ id : checkout
105+ uses : actions/checkout@v3
106+ with :
107+ submodules : recursive
108+
109+ - name : Dependencies
110+ id : depends
111+ run : |
112+ sudo apt-get update
113+ sudo apt-get install build-essential libvulkan-dev glslc
114+
115+ - name : Build
116+ id : cmake_build
117+ run : |
118+ mkdir build
119+ cd build
120+ cmake .. -DSD_BUILD_SHARED_LIBS=ON -DSD_VULKAN=ON
121+ cmake --build . --config Release
122+
123+ - name : Get commit hash
124+ id : commit
125+ if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
126+ uses : pr-mpt/actions-commit-hash@v2
127+
128+ - name : Fetch system info
129+ id : system-info
130+ run : |
131+ echo "CPU_ARCH=`uname -m`" >> "$GITHUB_OUTPUT"
132+ echo "OS_NAME=`lsb_release -s -i`" >> "$GITHUB_OUTPUT"
133+ echo "OS_VERSION=`lsb_release -s -r`" >> "$GITHUB_OUTPUT"
134+ echo "OS_TYPE=`uname -s`" >> "$GITHUB_OUTPUT"
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+ cp ggml/LICENSE ./build/bin/ggml.txt
141+ cp LICENSE ./build/bin/stable-diffusion.cpp.txt
142+ zip -j sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}-vulkan.zip ./build/bin/*
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@v4
147+ with :
148+ name : sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}-vulkan.zip
149+ path : |
150+ sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}-vulkan.zip
151+
152+ build-and-push-docker-images :
153+ name : Build and push container images
154+ runs-on : ubuntu-latest
155+
156+ permissions :
157+ contents : read
158+ packages : write
159+ id-token : write
160+ attestations : write
161+ artifact-metadata : write
162+
163+ strategy :
164+ matrix :
165+ variant : [musa, sycl, vulkan]
166+
167+ env :
168+ REGISTRY : ghcr.io
169+ IMAGE_NAME : ${{ github.repository }}
170+
171+ steps :
172+ - name : Checkout
173+ uses : actions/checkout@v6
174+ with :
175+ submodules : recursive
176+
177+ - name : Get commit hash
178+ id : commit
179+ if : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
180+ uses : pr-mpt/actions-commit-hash@v2
181+
182+ - name : Set up Docker Buildx
183+ uses : docker/setup-buildx-action@v3
184+
185+ - name : Log in to the container registry
186+ uses : docker/login-action@v3
187+ with :
188+ registry : ${{ env.REGISTRY }}
189+ username : ${{ github.actor }}
190+ password : ${{ secrets.GITHUB_TOKEN }}
191+
192+ - name : Extract metadata for Docker
193+ id : meta
194+ uses : docker/metadata-action@v5
195+ with :
196+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
197+
198+ - name : Free Disk Space (Ubuntu)
199+ 200+ with :
201+ # this might remove tools that are actually needed,
202+ # if set to "true" but frees about 6 GB
203+ tool-cache : false
204+
205+ - name : Build and push Docker image
206+ id : build-push
207+ uses : docker/build-push-action@v6
208+ with :
209+ platforms : linux/amd64
210+ push : ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
211+ file : Dockerfile.${{ matrix.variant }}
212+ tags : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.BRANCH_NAME }}-${{ matrix.variant }}
213+ labels : ${{ steps.meta.outputs.labels }}
214+ annotations : ${{ steps.meta.outputs.annotations }}
215+
95216 macOS-latest-cmake :
96217 runs-on : macos-latest
97218
@@ -146,7 +267,7 @@ jobs:
146267 sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}.zip
147268
148269 windows-latest-cmake :
149- runs-on : windows-2025
270+ runs-on : windows-2022
150271
151272 env :
152273 VULKAN_VERSION : 1.4.328.1
@@ -164,7 +285,7 @@ jobs:
164285 defines : " -DGGML_NATIVE=OFF -DGGML_AVX512=ON -DGGML_AVX=ON -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON"
165286 - build : " cuda12"
166287 defines : " -DSD_CUDA=ON -DSD_BUILD_SHARED_LIBS=ON -DCMAKE_CUDA_ARCHITECTURES='61;70;75;80;86;89;90;100;120' -DCMAKE_CUDA_FLAGS='-Xcudafe \" --diag_suppress=177\" -Xcudafe \" --diag_suppress=550\" '"
167- - build : ' vulkan'
288+ - build : " vulkan"
168289 defines : " -DSD_VULKAN=ON -DSD_BUILD_SHARED_LIBS=ON"
169290 steps :
170291 - name : Clone
@@ -200,7 +321,7 @@ jobs:
200321 run : |
201322 mkdir build
202323 cd build
203- cmake .. -DCMAKE_CXX_FLAGS='/bigobj' -G Ninja -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe ${{ matrix.defines }}
324+ cmake .. -DCMAKE_CXX_FLAGS='/bigobj' -G Ninja -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe -DCMAKE_BUILD_TYPE=Release ${{ matrix.defines }}
204325 cmake --build .
205326
206327 - name : Check AVX512F support
@@ -371,6 +492,8 @@ jobs:
371492
372493 needs :
373494 - ubuntu-latest-cmake
495+ - ubuntu-latest-cmake-vulkan
496+ - build-and-push-docker-images
374497 - macOS-latest-cmake
375498 - windows-latest-cmake
376499 - windows-latest-cmake-hip
0 commit comments