Build Windows DLL and open PR #7
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 Windows DLL and open PR | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- "c/windows/**" | |
- ".github/workflows/build-windows-and-pr.yml" | |
permissions: | |
contents: write | |
pull-requests: write | |
issues: write | |
concurrency: | |
group: windows-lib-${{ github.ref }} | |
cancel-in-progress: false | |
jobs: | |
win-x64: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up MSVC env | |
uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: x64 | |
- name: Configure (CMake, x64, Release) | |
run: > | |
cmake | |
-S c/windows | |
-B build | |
-G "Visual Studio 17 2022" | |
-A x64 | |
-D CMAKE_BUILD_TYPE=Release | |
- name: Build | |
run: cmake --build build --config Release --parallel | |
- name: Stage to lib/win/x64 | |
shell: pwsh | |
run: | | |
New-Item -ItemType Directory -Path lib/win/x64 -Force | Out-Null | |
Copy-Item build/dist/webview.dll lib/win/x64/ | |
if (Test-Path build/dist/webview.lib) { Copy-Item build/dist/webview.lib lib/win/x64/ } | |
if (Test-Path build/dist/webview.pdb) { Copy-Item build/dist/webview.pdb lib/win/x64/ } | |
- name: Check if there are changes under lib/win/x64 | |
id: diff | |
shell: bash | |
run: | | |
set -euo pipefail | |
git add -N lib/win/x64 >/dev/null 2>&1 || true | |
if ! git diff --quiet -- lib/win/x64; then | |
echo "changed=true" >> "$GITHUB_OUTPUT" | |
else | |
echo "changed=false" >> "$GITHUB_OUTPUT" | |
fi | |
- name: Create Pull Request | |
if: steps.diff.outputs.changed == 'true' | |
uses: peter-evans/create-pull-request@v7 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Add/Update Windows x64 webview binaries in lib/win/x64" | |
title: "Windows: update lib/win/x64 (webview.dll/.lib/.pdb)" | |
body: | | |
This PR updates the Windows x64 binaries generated from c/windows (CMake). | |
- Built with MSVC (x64), Release | |
- Copied files: | |
- webview.dll (required) | |
- webview.lib (if generated) | |
- webview.pdb (if generated) | |
CI run: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
branch: ci/windows-lib-${{ github.run_id }} | |
delete-branch: true | |
add-paths: | | |
lib/win/x64/** | |
labels: | | |
automated | |
windows | |
signoff: false | |
- name: No changes — nothing to PR | |
if: steps.diff.outputs.changed != 'true' | |
run: echo "No file changes under lib/win/x64. Skipping PR." |