@@ -254,15 +254,15 @@ jobs:
254254
255255 - name : Copy and pack Cuda runtime
256256 id : pack_cuda_runtime
257- if : ${{ ( github.event_name == 'push ' && github.ref == 'refs/heads/master ' && matrix.build == 'cuda12' ) || github.event.inputs.create_release == 'true' }}
257+ if : ${{ matrix.build == 'cuda12 ' && ( github.event_name == 'push ' && github.ref == 'refs/heads/master' || github.event.inputs.create_release == 'true') }}
258258 run : |
259259 echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
260260 $dst='.\build\bin\cudart\'
261261 robocopy "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
262262 7z a cudart-sd-bin-win-cu12-x64.zip $dst\*
263263
264264 - name : Upload Cuda runtime
265- if : ${{ ( github.event_name == 'push ' && github.ref == 'refs/heads/master ' && matrix.build == 'cuda12' ) || github.event.inputs.create_release == 'true' }}
265+ if : ${{ matrix.build == 'cuda12 ' && ( github.event_name == 'push ' && github.ref == 'refs/heads/master' || github.event.inputs.create_release == 'true') }}
266266 uses : actions/upload-artifact@v4
267267 with :
268268 name : sd-cudart-sd-bin-win-cu12-x64.zip
@@ -288,6 +288,11 @@ jobs:
288288 - windows-latest-cmake
289289
290290 steps :
291+ - name : Clone
292+ uses : actions/checkout@v3
293+ with :
294+ fetch-depth : 0
295+
291296 - name : Download artifacts
292297 id : download-artifact
293298 uses : actions/download-artifact@v4
@@ -298,25 +303,25 @@ jobs:
298303
299304 - name : Get commit count
300305 id : commit_count
301- run : echo "count=$(git rev-list --count HEAD)" >> $GITHUB_OUTPUT
306+ run : |
307+ echo "count=$(git rev-list --count HEAD)" >> $GITHUB_OUTPUT
302308
303309 - name : Get commit hash
304310 id : commit
305311 uses : pr-mpt/actions-commit-hash@v2
306312
307313 - name : Create release
308314 id : create_release
315+ if : ${{ github.event_name == 'workflow_dispatch' || github.ref_name == 'master' }}
309316 uses : anzz1/action-create-release@v1
310317 env :
311318 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
312319 with :
313- tag_name : >
314- ${{ github.ref_name == 'master' &&
315- format('release_{0}_{1}', steps.commit_count.outputs.count, steps.commit.outputs.short) ||
316- format('{0}-{1}', env.BRANCH_NAME, steps.commit.outputs.short) }}
320+ tag_name : ${{ format('{0}-{1}-{2}', env.BRANCH_NAME, steps.commit_count.outputs.count, steps.commit.outputs.short) }}
317321
318322 - name : Upload release
319323 id : upload_release
324+ if : ${{ github.event_name == 'workflow_dispatch' || github.ref_name == 'master' }}
320325 uses : actions/github-script@v3
321326 with :
322327 github-token : ${{secrets.GITHUB_TOKEN}}
0 commit comments