Change setup images #13
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Windows Build | |
on: [push, pull_request] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build_mingw: | |
name: CLI / LibHB | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Cargo-C Toolchain Cache | |
id: windows-cargo-c-toolchain | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/cargo-capi | |
~/.cargo/bin/cargo-cbuild | |
~/.cargo/bin/cargo-cinstall | |
key: windows-cargo-c-toolchain | |
- name: Setup Environment | |
run: | | |
sudo apt-get purge cmake -y | |
sudo apt-get install automake autoconf build-essential libtool libtool-bin make nasm patch tar yasm zlib1g-dev ninja-build gzip pax cmake libssl-dev | |
sudo pip3 install meson | |
rustup target add x86_64-pc-windows-gnu | |
- name: Setup Toolchain | |
run: | | |
wget https://github.com/bradleysepos/mingw-w64-build/releases/download/10.0.0/mingw-w64-toolchain-10.0.0-msvcrt-linux-x86_64.tar.gz | |
SHA=$(sha1sum mingw-w64-toolchain-10.0.0-msvcrt-linux-x86_64.tar.gz) | |
EXPECTED="f7250d140a72bdfdda2d4cd01d84e9a3938132b1 mingw-w64-toolchain-10.0.0-msvcrt-linux-x86_64.tar.gz" | |
if [ "$SHA" == "$EXPECTED" ]; | |
then | |
echo "Toolchain Verified. Extracting ..." | |
mkdir toolchains | |
mv mingw-w64-toolchain-10.0.0-msvcrt-linux-x86_64.tar.gz toolchains | |
cd toolchains | |
tar xvf mingw-w64-toolchain-10.0.0-msvcrt-linux-x86_64.tar.gz | |
cd mingw-w64-toolchain-10.0.0-msvcrt-linux-x86_64/mingw-w64-x86_64/ | |
pwd | |
else | |
echo "Toolchain Verification FAILED. Exiting!" | |
return -1 | |
fi | |
- name: Setup Cargo-C Toolchain | |
if: steps.windows-cargo-c-toolchain.outputs.cache-hit != 'true' | |
run: | | |
cargo install cargo-c | |
- name: Build CLI and LibHB | |
run: | | |
export PATH="/home/runner/work/StickShift/StickShift/toolchains/mingw-w64-toolchain-10.0.0-msvcrt-linux-x86_64/mingw-w64-x86_64/bin:${PATH}" | |
export PATH=/usr/bin:$PATH | |
./configure --cross=x86_64-w64-mingw32 --enable-qsv --enable-vce --enable-nvenc --enable-nvdec --launch-jobs=0 --launch | |
cd build | |
make pkg.create.zip | |
- name: Upload HandBrakeCLI | |
uses: actions/upload-artifact@v3 | |
with: | |
name: HandBrakeCLI | |
path: ./build/HandBrakeCLI.exe | |
- name: Upload LibHB | |
uses: actions/upload-artifact@v3 | |
with: | |
name: LibHandBrake | |
path: ./build/libhb/hb.dll | |
build_gui: | |
name: Windows UI | |
runs-on: windows-2022 | |
needs: build_mingw | |
env: | |
SigningCertificate: ${{ secrets.HandBrakeTeam_SignFile }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download LibHandBrake | |
uses: actions/download-artifact@v3 | |
with: | |
name: LibHandBrake | |
path: win/CS/HandBrakeWPF/bin/publish | |
- name: Import the Signing Cert | |
run: | | |
$ErrorView = "NormalView" | |
if (-NOT ($env:SigningCertificate -eq '')) { | |
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.HandBrakeTeam_Pfx }}") | |
$currentDirectory = Get-Location | |
$certificatePath = Join-Path -Path $currentDirectory -ChildPath $env:SigningCertificate | |
$certPassword = ConvertTo-SecureString -String ${{ secrets.HandBrakeTeam_pfx_pwd }} -Force –AsPlainText | |
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte) | |
cp $certificatePath win\cs\ | |
} | |
- name: Build Windows GUI | |
run: | | |
$env:Path += ";C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" | |
msbuild win\cs\build.xml /t:x64 /p:PfxFile=$env:SigningCertificate /p:PfxPwd=${{ secrets.HandBrakeTeam_pfx_pwd }} /p:SignTimestampServer=http://time.certum.pl/ | |
- name: Upload StickShift exe Installer | |
uses: actions/upload-artifact@v3 | |
with: | |
name: StickShift-1.7.4-x86_64-Win_GUI-EXE | |
path: win/CS/HandBrakeWPF/bin/publish/StickShift-1.7.4-x86_64-Win_GUI.exe | |
- name: Upload StickShift msi Installer | |
uses: actions/upload-artifact@v3 | |
with: | |
name: StickShift-1.7.4-x86_64-Win_GUI-MSI | |
path: win/CS/HandBrakeWPF/bin/publish/StickShift-1.7.4-x86_64-Win_GUI.msi |