Skip to content

A lot of changes for 1.7.0 #42

A lot of changes for 1.7.0

A lot of changes for 1.7.0 #42

name: Windows native build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: windows-2019
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
submodules: true
ref: ${{ github.head_ref }}
- name: Check for submodule update
id: check_submodule
run: |
Set-Location whisper.cpp
$SubmoduleCommitId = git rev-parse HEAD
Write-Host "Submodule commit ID: $SubmoduleCommitId"
Set-Location $Env:GITHUB_WORKSPACE
$StoredCommitId = Get-Content native-commit-id-windows
Write-Host "Stored commit ID: $StoredCommitId"
if ($SubmoduleCommitId -ne $StoredCommitId) {
Write-Host "Submodule has new commits. Triggering build."
Write-Output "trigger_build=true" | Out-File -Append $Env:GITHUB_OUTPUT
Set-Content -Path native-commit-id-windows -Value $SubmoduleCommitId
} else {
Write-Host "No new commits in submodule."
Write-Output "trigger_build=false" | Out-File -Append $Env:GITHUB_OUTPUT
}
shell: pwsh
- name: Add msbuild to PATH
if: steps.check_submodule.outputs.trigger_build == 'true'
uses: microsoft/setup-msbuild@v1
- name: Install OpenCl with vcpkg
if: steps.check_submodule.outputs.trigger_build == 'true'
run: |
vcpkg --triplet=x64-windows install opencl
- name: Install CUDA Toolkit
if: steps.check_submodule.outputs.trigger_build == 'true'
uses: Jimver/cuda-toolkit@v0.2.11
with:
cuda: '12.1.0'
- name: Run Build
if: steps.check_submodule.outputs.trigger_build == 'true'
run: |
Import-Module ./windows-scripts.ps1
BuildWindowsIntel
shell: pwsh
- name: Remove CUDA installer
if: steps.check_submodule.outputs.trigger_build == 'true'
run: Remove-Item -Path 'cuda_installer-*' -Recurse -Force -ErrorAction Ignore
- name: Pull latest commits
if: steps.check_submodule.outputs.trigger_build == 'true'
run: git pull origin ${{ github.head_ref }}
- name: Commit and Push
if: steps.check_submodule.outputs.trigger_build == 'true'
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Add native changes windows