Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 47 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,6 @@ jobs:
os: ubuntu-22.04
generator: Unix Makefiles
vcpkg_root:
- id: macOS
triplet: arm64-osx
compiler: clang
os: macOS-latest
generator: Unix Makefiles
vcpkg_root: /usr/local/share/vcpkg
- id: windows-x64-vs
triplet: x64-windows
compiler: vs
Expand Down Expand Up @@ -87,12 +81,12 @@ jobs:
vcpkg_root: C:/vcpkg
cache: C:/Users/runneradmin/AppData/Local/vcpkg/archives

runs-on: ${{matrix.os}}
runs-on: &runs-on ${{matrix.os}}

env:
env: &env
VCPKG_ROOT: ${{matrix.vcpkg_root}}

steps:
steps: &build-steps
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
persist-credentials: false
Expand Down Expand Up @@ -135,11 +129,29 @@ jobs:
restore-keys: |
${{matrix.id}}-

# Use Visual Studio's own vcvarsall.bat: the StepSecurity action that
# wraps it requires a paid subscription in private repositories.
- name: Configure Visual Studio
if: matrix.compiler == 'vs'
uses: step-security/msvc-dev-cmd@22c98154b708dbd743e6f27a933cf6ceba3305c4 # v1
with:
arch: ${{matrix.arch}}
shell: pwsh
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vcvarsall = & $vswhere -latest -products * -find VC\Auxiliary\Build\vcvarsall.bat |
Select-Object -First 1
if (!$vcvarsall) { throw "vcvarsall.bat not found" }
$script = "$env:RUNNER_TEMP\vcvars.cmd"
"@call `"$vcvarsall`" ${{matrix.arch}} >&2 && set" | Set-Content -Encoding ascii $script
$vars = cmd.exe /d /c $script
if ($LASTEXITCODE -ne 0 -or !($vars -match '^VSCMD_ARG_TGT_ARCH=')) {
throw "vcvarsall.bat ${{matrix.arch}} failed"
}
foreach ($var in $vars) {
$name, $value = $var -split '=', 2
if ($name -and $null -ne $value -and
[Environment]::GetEnvironmentVariable($name) -cne $value) {
"$name=$value" >> $env:GITHUB_ENV
}
}

- name: Install MSYS2
if: matrix.compiler == 'mingw'
Expand Down Expand Up @@ -304,3 +316,26 @@ jobs:
with:
name: ${{env.version}}-${{matrix.id}}
path: ${{github.workspace}}/dist

# macOS minutes cost about six times as much as Windows minutes, which
# quickly exhausts the included usage of private repositories. Their
# portable changes are covered on other platforms, so private repositories
# build on macOS only when the workflow is run manually.
build-macos:
name: build
if: ${{ !github.event.repository.private || github.event_name == 'workflow_dispatch' }}
strategy:
matrix:
include:
- id: macOS
triplet: arm64-osx
compiler: clang
os: macOS-latest
generator: Unix Makefiles
vcpkg_root: /usr/local/share/vcpkg

runs-on: *runs-on

env: *env

steps: *build-steps
2 changes: 2 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
jobs:
analyze:
name: Analyze
# Code scanning of private repositories requires GitHub Code Security.
if: ${{ !github.event.repository.private }}
runs-on: ubuntu-latest
permissions:
actions: read
Expand Down
24 changes: 21 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,28 @@ jobs:
NASM_VERSION: "3.02"
NASM_SHA256: 161d0bfaff53c2f9e9f3e69fd0672323ebabafd1268976a5cec11be92a19aee7
steps:
# Use Visual Studio's own vcvarsall.bat: the StepSecurity action that
# wraps it requires a paid subscription in private repositories.
- name: Configure Visual Studio
uses: step-security/msvc-dev-cmd@22c98154b708dbd743e6f27a933cf6ceba3305c4 # v1
with:
arch: ${{matrix.vs_arch}}
shell: pwsh
run: |
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$vcvarsall = & $vswhere -latest -products * -find VC\Auxiliary\Build\vcvarsall.bat |
Select-Object -First 1
if (!$vcvarsall) { throw "vcvarsall.bat not found" }
$script = "$env:RUNNER_TEMP\vcvars.cmd"
"@call `"$vcvarsall`" ${{matrix.vs_arch}} >&2 && set" | Set-Content -Encoding ascii $script
$vars = cmd.exe /d /c $script
if ($LASTEXITCODE -ne 0 -or !($vars -match '^VSCMD_ARG_TGT_ARCH=')) {
throw "vcvarsall.bat ${{matrix.vs_arch}} failed"
}
foreach ($var in $vars) {
$name, $value = $var -split '=', 2
if ($name -and $null -ne $value -and
[Environment]::GetEnvironmentVariable($name) -cne $value) {
"$name=$value" >> $env:GITHUB_ENV
}
}

# Python setup
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7
Expand Down
Loading