Skip to content

Commit ab7b5c7

Browse files
author
FreezyLemon
committed
Create workflow for Windows builds
1 parent dfdc2c6 commit ab7b5c7

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

.github/workflows/windows-build.yml

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: Build Av1an (Windows x64)
2+
on: workflow_dispatch
3+
4+
jobs:
5+
build:
6+
runs-on: windows-2022
7+
8+
env:
9+
vsynth_ver: R58
10+
vsynth_path: C:\Program Files\Vapoursynth
11+
12+
steps:
13+
- name: Python 3.10 setup
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: '~3.10'
17+
architecture: x64
18+
19+
- name: NASM setup
20+
uses: ilammy/setup-nasm@v1
21+
with:
22+
version: 2.15.05
23+
from-source: false
24+
25+
- name: PowerShell module installation
26+
uses: potatoqualitee/[email protected]
27+
with:
28+
modules-to-cache: 7Zip4Powershell
29+
30+
- name: FFmpeg hashsum
31+
run: |
32+
$hashSum = (Invoke-WebRequest 'https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z.sha256').Content
33+
echo "ff_hash=$hashSum" | Out-File $env:GITHUB_ENV -Append
34+
Write-Output "Latest release: $hashSum"
35+
36+
- name: FFmpeg cache check
37+
id: cache-ff
38+
uses: actions/cache@v3
39+
with:
40+
path: C:\ffmpeg
41+
key: ff-${{ env.ff_hash }}
42+
43+
- if: steps.cache-ff.outputs.cache-hit != 'true'
44+
name: FFmpeg installation
45+
run: |
46+
$tempFile = New-TemporaryFile
47+
Invoke-WebRequest 'https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-full-shared.7z' -OutFile $tempFile -TimeoutSec 10
48+
Expand-7Zip $tempFile 'C:\ffmpeg'
49+
50+
- name: FFmpeg environment variable
51+
run: |
52+
$ffDir = Get-Item "C:\ffmpeg\ffmpeg*shared" | Select-Object -First 1 -ExpandProperty FullName
53+
echo "FFMPEG_DIR=$ffDir" | Out-File $env:GITHUB_ENV -Append
54+
55+
- name: VapourSynth cache check
56+
id: cache-vsynth
57+
uses: actions/cache@v3
58+
with:
59+
path: ${{ env.vsynth_path }}
60+
key: vsynth-${{ env.vsynth_ver }}
61+
62+
- if: steps.cache-vsynth.outputs.cache-hit != 'true'
63+
name: VapourSynth installation
64+
run: |
65+
$tempFile = New-TemporaryFile
66+
$uri = 'https://github.com/vapoursynth/vapoursynth/releases/download/VER/VapourSynth64-Portable-VER.7z'.Replace('VER', "${{ env.vsynth_ver }}")
67+
Invoke-WebRequest $uri -OutFile $tempFile -TimeoutSec 10
68+
Expand-7Zip $tempFile $env:vsynth_path
69+
70+
- uses: actions/checkout@v3
71+
72+
- name: Package cache check
73+
uses: actions/cache@v3
74+
with:
75+
path: |
76+
~\.cargo\git
77+
~\.cargo\registry
78+
key: cargo-${{ hashFiles('**\Cargo.toml', '**\Cargo.lock') }}
79+
restore-keys: cargo-
80+
81+
- name: Av1an build
82+
env:
83+
CARGO_TERM_COLOR: always
84+
run: cargo build -rv
85+
86+
- name: Upload artifacts
87+
uses: actions/upload-artifact@v3
88+
with:
89+
name: av1an
90+
path: target/release/av1an.exe

0 commit comments

Comments
 (0)