Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 3770272

Browse files
committed
fix(ci-windows): Update step name, remove cuda-toolkit installation, Add release job
1 parent 17a5d89 commit 3770272

File tree

1 file changed

+71
-14
lines changed

1 file changed

+71
-14
lines changed

.github/workflows/build.yml

Lines changed: 71 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ jobs:
229229
# asset_name: nitro-${{ steps.extract_commit_id.outputs.sha_short }}-mac-amd64.zip.zip
230230
# tag: ${{ steps.extract_branch.outputs.branch }}-${{ steps.extract_commit_id.outputs.sha_short }}
231231

232-
windows-latest-cmake:
232+
windows-amd64-build:
233233
runs-on: windows-latest
234234

235235
env:
@@ -240,12 +240,8 @@ jobs:
240240
strategy:
241241
matrix:
242242
include:
243-
- build: 'avx2'
244-
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DBUILD_SHARED_LIBS=ON'
245243
- build: 'avx512'
246244
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_AVX512=ON -DBUILD_SHARED_LIBS=ON'
247-
- build: 'clblast'
248-
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_CLBLAST=ON -DBUILD_SHARED_LIBS=ON -DCMAKE_PREFIX_PATH="$env:RUNNER_TEMP/clblast"'
249245
- build: 'openblas'
250246
defines: '-DLLAMA_NATIVE=OFF -DLLAMA_BUILD_SERVER=ON -DLLAMA_BLAS=ON -DBUILD_SHARED_LIBS=ON -DLLAMA_BLAS_VENDOR=OpenBLAS -DBLAS_INCLUDE_DIRS="$env:RUNNER_TEMP/openblas/include" -DBLAS_LIBRARIES="$env:RUNNER_TEMP/openblas/lib/openblas.lib"'
251247

@@ -343,12 +339,12 @@ jobs:
343339
path: |
344340
nitro-${{ steps.tag.outputs.name }}-bin-win-${{ matrix.build }}-x64.zip
345341
346-
windows-latest-cmake-cublas:
342+
windows-amd64-cuda-build:
347343
runs-on: windows-nvidia
348344

349345
strategy:
350346
matrix:
351-
cuda: ['12.2.0', '11.7.1']
347+
cuda: ['12.2.0']
352348
build: ['cublas']
353349

354350
steps:
@@ -358,12 +354,12 @@ jobs:
358354
with:
359355
submodules: recursive
360356

361-
- uses: Jimver/cuda-toolkit@v0.2.11
362-
id: cuda-toolkit
363-
with:
364-
cuda: ${{ matrix.cuda }}
365-
method: 'network'
366-
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
357+
# - uses: Jimver/cuda-toolkit@v0.2.11
358+
# id: cuda-toolkit
359+
# with:
360+
# cuda: ${{ matrix.cuda }}
361+
# method: 'network'
362+
# sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
367363

368364
- name: Build
369365
id: cmake_build
@@ -415,4 +411,65 @@ jobs:
415411
uses: actions/upload-artifact@v3
416412
with:
417413
path: |
418-
cudart-nitro-bin-win-cu${{ matrix.cuda }}-x64.zip
414+
cudart-nitro-bin-win-cu${{ matrix.cuda }}-x64.zip
415+
416+
release:
417+
runs-on: ubuntu-latest
418+
419+
needs:
420+
- windows-amd64-build
421+
- windows-amd64-cuda-build
422+
423+
steps:
424+
- name: Clone
425+
id: checkout
426+
uses: actions/checkout@v3
427+
with:
428+
fetch-depth: 0
429+
430+
- name: Determine tag name
431+
id: tag
432+
shell: bash
433+
run: |
434+
BUILD_NUMBER="$(git rev-list --count HEAD)"
435+
SHORT_HASH="$(git rev-parse --short=7 HEAD)"
436+
if [[ "${{ env.BRANCH_NAME }}" == "master" ]]; then
437+
echo "name=b${BUILD_NUMBER}" >> $GITHUB_OUTPUT
438+
else
439+
SAFE_NAME=$(echo "${{ env.BRANCH_NAME }}" | tr '/' '-')
440+
echo "name=${SAFE_NAME}-b${BUILD_NUMBER}-${SHORT_HASH}" >> $GITHUB_OUTPUT
441+
fi
442+
443+
- name: Download artifacts
444+
id: download-artifact
445+
uses: actions/download-artifact@v3
446+
447+
- name: Create release
448+
id: create_release
449+
uses: anzz1/action-create-release@v1
450+
env:
451+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
452+
with:
453+
tag_name: ${{ steps.tag.outputs.name }}
454+
455+
- name: Upload release
456+
id: upload_release
457+
uses: actions/github-script@v3
458+
with:
459+
github-token: ${{secrets.GITHUB_TOKEN}}
460+
script: |
461+
const path = require('path');
462+
const fs = require('fs');
463+
const release_id = '${{ steps.create_release.outputs.id }}';
464+
for (let file of await fs.readdirSync('./artifact')) {
465+
if (path.extname(file) === '.zip') {
466+
console.log('uploadReleaseAsset', file);
467+
await github.repos.uploadReleaseAsset({
468+
owner: context.repo.owner,
469+
repo: context.repo.repo,
470+
release_id: release_id,
471+
name: file,
472+
data: await fs.readFileSync(`./artifact/${file}`)
473+
});
474+
}
475+
}

0 commit comments

Comments
 (0)