Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Release Windows (Ninja + Clang) | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| branches: | |
| - main # 建议加上这个,方便你在推送分支时直接测试 | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: intel-oneapi | |
| # You may pin to the exact commit or the version. | |
| # uses: neelravi/intel-oneapi-github-actions@039989107ca74a15e25a0a6f40354eaf20bb71e9 | |
| uses: neelravi/intel-oneapi-github-actions@latest | |
| with: | |
| # Comma-separated list of Intel OneAPI components to install (e.g., fortran, cpp, mpi, mkl, basekit, hpckit) | |
| components: cpp # default is fortran,cpp,mpi,mkl | |
| - name: Setup Ninja | |
| uses: llvm/actions/install-ninja@main | |
| - name: Set up MSVC Environment | |
| # 必须在 Configure 之前运行,确保 clang-cl 能找到系统头文件 | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Configure CMake | |
| shell: pwsh | |
| run: | | |
| # 手动指定 IPP 的 CMake 配置文件路径,确保 CMake 能找到它 | |
| $ipp_cmake_dir = "C:/Program Files (x86)/Intel/oneAPI/ipp/latest/lib/cmake/ipp" | |
| cmake -B build -G Ninja ` | |
| -DCMAKE_C_COMPILER=clang-cl ` | |
| -DCMAKE_CXX_COMPILER=clang-cl ` | |
| -DCMAKE_BUILD_TYPE=Release ` | |
| -DIPP_DIR="$ipp_cmake_dir" ` | |
| -DCMAKE_PREFIX_PATH="C:/Program Files (x86)/Intel/oneAPI" | |
| - name: Build | |
| run: cmake --build build --config Release --parallel | |
| - name: Collect and Zip VST3 Plugins | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path "./vst3_release" | |
| # 仅从 build 目录下寻找,排除脚本下载的第三方库目录 | |
| Get-ChildItem -Path "./build" -Filter "*.vst3" -Recurse | Where-Object { $_.Attributes -match "Directory" } | ForEach-Object { | |
| Write-Host "Found plugin: $($_.FullName)" | |
| Copy-Item -Path $_.FullName -Destination "./vst3_release/" -Recurse | |
| } | |
| if ((Get-ChildItem "./vst3_release/").Count -eq 0) { | |
| Write-Error "No VST3 plugins found! Check your build output." | |
| exit 1 | |
| } | |
| Compress-Archive -Path "./vst3_release/*" -DestinationPath "./Plugins_Windows_VST3.zip" | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-vst3-zip | |
| path: Plugins_Windows_VST3.zip | |
| release: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download Artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: windows-vst3-zip | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: Plugins_Windows_VST3.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |