diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 2209755..5c6343c 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -111,6 +111,9 @@ jobs: if (-not [Environment]::Is64BitOperatingSystem) { throw 'Windows x64 is required' } $vswhere = Join-Path ${env:ProgramFiles(x86)} 'Microsoft Visual Studio\Installer\vswhere.exe' $vs = & $vswhere -latest -products '*' -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath + if ($LASTEXITCODE -ne 0 -or -not $vs) { throw 'Visual Studio C++ x64 tools not found' } + Import-Module (Join-Path $vs 'Common7\Tools\Microsoft.VisualStudio.DevShell.dll') + Enter-VsDevShell -VsInstallPath $vs -SkipAutomaticLocation -DevCmdArguments '-arch=x64 -host_arch=x64' $nsis = Get-Command makensis.exe -ErrorAction SilentlyContinue if (-not $nsis) { $nsisDir = Join-Path ${env:ProgramFiles(x86)} 'NSIS' @@ -122,9 +125,12 @@ jobs: $dist = Join-Path $env:RUNNER_TEMP ('release-windows-' + [guid]::NewGuid()) $env:CARGO_TARGET_DIR = Join-Path $env:RUNNER_TEMP ('build-windows-' + [guid]::NewGuid()) New-Item -ItemType Directory -Path $dist | Out-Null - cargo build --release --features vendored-lua + cargo build --locked --release --features vendored-lua + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } $binary = Join-Path $env:CARGO_TARGET_DIR 'release\rusty-path-of-building.exe' + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } $imports = & dumpbin.exe /DEPENDENTS $binary + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } $dlls = @($imports | ForEach-Object { if ($_ -match '^\s+([\w.-]+\.dll)\s*$') { $Matches[1].ToLowerInvariant() } }) if ($dlls.Count -eq 0) { throw 'Could not inspect PE imports' } # API sets are virtual system DLLs. Other imports must resolve without the build tools.