Build Voukoder #154
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: Build Voukoder | |
on: | |
workflow_dispatch: | |
inputs: | |
ffmpegLibs: | |
description: 'FFmpeg libraries' | |
required: true | |
default: 'https://github.com/vouk/voukoder-ffmpeg/releases/latest/download/ffmpeg-win64-static-release.tar.gz' | |
refId: | |
description: 'RefId' | |
required: true | |
default: 'master' | |
verMajor: | |
description: 'Major version' | |
required: true | |
default: '10' | |
verMinor: | |
description: 'Minor version' | |
required: true | |
default: '2' | |
verPatch: | |
description: 'Patch version' | |
required: true | |
default: '150' | |
verPublic: | |
description: 'Public version' | |
required: true | |
default: '10.3test' | |
env: | |
vsPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\ | |
jobs: | |
voukoder: | |
runs-on: windows-2022 | |
steps: | |
- name: Set up dependencies | |
run: | | |
Invoke-WebRequest ${{ github.event.inputs.ffmpegLibs }} -Headers @{"Cache-Control"="no-cache"} -OutFile temp.tar.gz | |
Invoke-WebRequest https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxWidgets-3.1.2.7z -OutFile wxWidgets-3.1.2.7z | |
md external | |
md project | |
& cmd.exe '/C 7z x "temp.tar.gz" -so | 7z x -aoa -si -ttar -o"external"' | |
md external\lib\release | |
move external\lib\*.lib external\lib\release\ | |
Get-ChildItem -Recurse .\external\ | |
- name: Set up MSBuild | |
uses: microsoft/[email protected] | |
- name: Checkout Voukoder | |
uses: actions/[email protected] | |
with: | |
path: project\voukoder | |
ref: ${{ github.event.inputs.refId }} | |
- name: Check cache for wxWidgets 3.1.2 | |
id: wxw-cache | |
uses: actions/cache@v3 | |
with: | |
path: project/voukoder/wxWidgets-3.1.2 | |
key: ${{ runner.os }}-${{ hashFiles('wxWidgets-3.1.2.7z') }} | |
- name: Compile wxWidgets 3.1.2 | |
if: steps.wxw-cache.outputs.cache-hit != 'true' | |
run: | | |
dir | |
md project\voukoder\wxWidgets-3.1.2 | |
cd project\voukoder\wxWidgets-3.1.2 | |
& 'C:\Program Files\7-Zip\7z.exe' x -y ..\..\..\wxWidgets-3.1.2.7z | |
"${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat" | |
cd build\msw | |
& '${{ env.vsPath }}MSBuild\Current\Bin\MSBuild.exe' -p:Configuration=release -p:Platform=x64 -p:PlatformToolset=v143 -m wx_vc15.sln | |
- name: Set version number | |
shell: cmd | |
run: | | |
echo ^<?xml version="1.0" encoding="UTF-8"?^>^<Include^>^<?define PrivateProductVersion = "${{ github.event.inputs.verMajor }}.${{ github.event.inputs.verMinor }}.${{ github.event.inputs.verPatch }}.0" ?^>^<?define PublicProductVersion = "${{ github.event.inputs.verPublic }}" ?^>^</Include^> > project\voukoder\Installer\Properties.wxi | |
echo #pragma once > project\voukoder\Core\include\Version.h | |
echo #define VKDR_VERSION_MAJOR ${{ github.event.inputs.verMajor }} >> project\voukoder\Core\include\Version.h | |
echo #define VKDR_VERSION_MINOR ${{ github.event.inputs.verMinor }} >> project\voukoder\Core\include\Version.h | |
echo #define VKDR_VERSION_PATCH ${{ github.event.inputs.verPatch }} >> project\voukoder\Core\include\Version.h | |
echo #define VKDR_VERSION_PUBLIC "${{ github.event.inputs.verPublic }}" >> project\voukoder\Core\include\Version.h | |
echo #define BINVERSION ${{ github.event.inputs.verMajor }}, ${{ github.event.inputs.verMinor }}, 0, ${{ github.event.inputs.verPatch }} >> project\voukoder\Core\include\Version.h | |
echo #define STRVERSION "${{ github.event.inputs.verMajor }}.${{ github.event.inputs.verMinor }}.0.${{ github.event.inputs.verPatch }}" >> project\voukoder\Core\include\Version.h | |
- name: Create PFX certificate | |
id: create-pfx | |
shell: pwsh | |
env: | |
PFX_CONTENT: ${{ secrets.CODESIGN_PFX }} | |
run: | | |
$pfxPath = Join-Path -Path $env:RUNNER_TEMP -ChildPath "cert.pfx"; | |
$encodedBytes = [System.Convert]::FromBase64String($env:PFX_CONTENT); | |
Set-Content $pfxPath -Value $encodedBytes -AsByteStream; | |
Write-Output "::set-output name=PFX_PATH::$pfxPath"; | |
- name: Build Installer | |
shell: cmd | |
env: | |
CODESIGN_PFX_FILE: ${{ steps.create-pfx.outputs.PFX_PATH }} | |
run: | | |
call "${{ env.vsPath }}VC\Auxiliary\Build\vcvars64.bat" | |
MSBuild.exe -t:Installer -maxCpuCount -p:Configuration=Release -m project\voukoder\Voukoder.sln | |
move project\voukoder\Installer\bin\x64\Release\voukoder.msi voukoder-${{ github.event.inputs.verPublic }}.msi | |
signtool sign /f "${{ steps.create-pfx.outputs.PFX_PATH }}" /fd SHA256 /tr http://ts.ssl.com /td sha256 /v voukoder-${{ github.event.inputs.verPublic }}.msi | |
- name: Delete PFX certificate | |
shell: pwsh | |
env: | |
PFX_PATH: ${{ steps.create-pfx.outputs.PFX_PATH }} | |
run: | | |
Remove-Item -Path $env:PFX_PATH; | |
- name: Publish artifact | |
uses: actions/upload-artifact@v2 | |
with: | |
name: Voukoder ${{ github.event.inputs.verPublic }} (${{ github.event.inputs.verMajor }}.${{ github.event.inputs.verMinor }}.${{ github.event.inputs.verPatch }}) | |
path: voukoder-${{ github.event.inputs.verPublic }}.msi |