fix: use GitHub API to fetch latest libmpv tag instead of redirect
Invoke-WebRequest fails on 302 redirects in newer PowerShell. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,9 +36,9 @@ jobs:
|
||||
- name: Fetch libmpv
|
||||
shell: pwsh
|
||||
run: |
|
||||
$mpvUrl = "https://github.com/shinchiro/mpv-winbuild-cmake/releases/latest"
|
||||
$release = Invoke-WebRequest $mpvUrl -MaximumRedirection 0 -ErrorAction SilentlyContinue
|
||||
$tag = ($release.Headers.Location -split '/')[-1]
|
||||
$apiUrl = "https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/releases/latest"
|
||||
$release = Invoke-RestMethod $apiUrl
|
||||
$tag = $release.tag_name
|
||||
$dlUrl = "https://github.com/shinchiro/mpv-winbuild-cmake/releases/download/$tag/mpv-dev-x86_64-v3-${tag}.7z"
|
||||
Invoke-WebRequest $dlUrl -OutFile mpv-dev.7z
|
||||
7z x mpv-dev.7z -ompv-dev
|
||||
|
||||
Reference in New Issue
Block a user