-
Notifications
You must be signed in to change notification settings - Fork 9
52 lines (44 loc) · 1.73 KB
/
build-windows.yml
File metadata and controls
52 lines (44 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Build Windows
on:
workflow_call:
jobs:
build:
name: Build Windows x86_64
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build release binary
run: cargo build --release
- name: Download mpv
shell: bash
run: |
# Get the latest mpv Windows build from shinchiro's releases via GitHub API
DOWNLOAD_URL=$(curl -s https://api.github.com/repos/shinchiro/mpv-winbuild-cmake/releases/latest \
| grep "browser_download_url.*mpv-x86_64-[0-9].*\.7z" \
| grep -v "dev\|v3" \
| head -1 \
| cut -d'"' -f4)
echo "Downloading mpv from: ${DOWNLOAD_URL}"
curl -L -o mpv.7z "${DOWNLOAD_URL}"
7z x mpv.7z -ompv_extracted
# mpv extracts into a subdirectory, find mpv.exe
find mpv_extracted -name "mpv.exe" -type f
- name: Package binary
shell: bash
run: |
TAG="${GITHUB_REF#refs/tags/}"
mkdir -p "AetherTune-${TAG}-windows-x86_64"
cp target/release/AetherTune.exe "AetherTune-${TAG}-windows-x86_64/"
# mpv extracts into a dated subdirectory, find and copy mpv.exe
MPV_EXE=$(find mpv_extracted -name "mpv.exe" -type f | head -1)
echo "Found mpv at: ${MPV_EXE}"
cp "${MPV_EXE}" "AetherTune-${TAG}-windows-x86_64/"
cp README.md LICENSE "AetherTune-${TAG}-windows-x86_64/"
7z a "AetherTune-${TAG}-windows-x86_64.zip" "AetherTune-${TAG}-windows-x86_64"
- name: Upload artifact
uses: actions/upload-artifact@v6
with:
name: windows-x86_64
path: AetherTune-*.zip