build Windows release #2
This file contains 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 Windows release' | |
on: | |
workflow_run: | |
workflows: ["create GitHub release"] | |
types: [completed] | |
jobs: | |
msvc: | |
permissions: | |
contents: write | |
runs-on: windows-latest | |
env: | |
VULKAN_SDK_VERSION: 1.3.250.1 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- tool: nope-viewer | |
tool_fullname: NopeViewer | |
- tool: nope-diff | |
tool_fullname: NopeDiff | |
defaults: | |
run: | |
shell: pwsh | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
iwr https://sdk.lunarg.com/sdk/download/${{env.VULKAN_SDK_VERSION}}/windows/VulkanSDK-${{env.VULKAN_SDK_VERSION}}-Installer.exe -OutFile VulkanSDK-Installer.exe | |
.\VulkanSDK-Installer.exe --accept-licenses --default-answer --confirm-command install | Out-Null | |
iwr https://sdk.lunarg.com/sdk/download/${{env.VULKAN_SDK_VERSION}}/windows/VulkanRT-${{env.VULKAN_SDK_VERSION}}-Installer.exe -OutFile VulkanRT-Installer.exe | |
.\VulkanRT-Installer.exe /S | Out-Null | |
- name: Build | |
run: | | |
.\scripts\msvc-env.ps1 | |
python.exe .\configure.py --debug-opts gpu_capture --build-backend ninja | |
nmake | |
- name: Build installer | |
run: | | |
.\scripts\msvc-env.ps1 | |
.\venv\Scripts\ngli-activate.ps1 | |
pip install pyinstaller | |
pyinstaller.exe ` | |
--collect-all pynopegl_utils ` | |
--add-binary "venv/Scripts/ffmpeg.exe;bin" ` | |
--add-binary "venv/Scripts/ffprobe.exe;bin" ` | |
-i scripts/pyinstaller/${{ matrix.tool }}.ico ` | |
scripts/pyinstaller/${{ matrix.tool }}.py | |
mv ./dist/${{ matrix.tool }} ./dist/${{ matrix.tool_fullname}} | |
Compress-Archive -Path ./dist/${{ matrix.tool_fullname }}/ ./dist/${{ matrix.tool_fullname }}.zip | |
- name: Upload installer | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
$version = $(Get-Content -TotalCount 1 .\VERSION) | |
$output_file = "dist/${{ matrix.tool_fullname }}-$version-x86_64.zip" | |
mv dist/${{ matrix.tool_fullname }}.zip $output_file | |
gh release upload "v$version" $output_file |