Skip to content

Commit

Permalink
update build
Browse files Browse the repository at this point in the history
  • Loading branch information
exeldro committed May 31, 2022
1 parent f1c0edb commit ee4804c
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 27 deletions.
102 changes: 77 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,22 @@ jobs:
with:
name: '${{ env.FILE_NAME }}'
path: '*.tar.gz'
windows:
name: Windows
windows-build:
name: 'Windows Build'
runs-on: [windows-latest]
strategy:
fail-fast: true
matrix:
target: [x64, x86]
include:
- target: x64
cmake_build: 'x64'
qt_ext: '_64'
deps_ext: '64'
- target: x86
cmake_build: 'Win32'
qt_ext: ''
deps_ext: '32'
env:
QT_VERSION: '5.15.2'
CMAKE_GENERATOR: "Visual Studio 17 2022"
Expand Down Expand Up @@ -261,27 +274,66 @@ jobs:
- name: Configure
run: |
mkdir ./package
mkdir ./build32
cd ./build32
cmake -G"${{ env.CMAKE_GENERATOR }}" -A"Win32" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=false -DBUILD_VST=false -DBUILD_VIRTUALCAM=false -DBUILD_CAPTIONS=false -DCOMPILE_D3D12_HOOK=false -DENABLE_SCRIPTING=false -DDepsPath="${{ github.workspace }}/cmbuild/deps/win32" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2019" -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE ..
cd ..
mkdir ./build64
cd ./build64
cmake -G"${{ env.CMAKE_GENERATOR }}" -A"x64" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=false -DBUILD_VST=false -DBUILD_VIRTUALCAM=false -DBUILD_CAPTIONS=false -DCOMPILE_D3D12_HOOK=false -DENABLE_SCRIPTING=false -DDepsPath="${{ github.workspace }}/cmbuild/deps/win64" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2019_64" -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE ..
- name: 'Build 32'
run: msbuild /m /p:Configuration=RelWithDebInfo .\build32\obs-studio.sln
- name: 'Build 64'
run: msbuild /m /p:Configuration=RelWithDebInfo .\build64\obs-studio.sln
mkdir ./installer
mkdir ./installer/media
mkdir ./build
cd ./build
cmake -G"${{ env.CMAKE_GENERATOR }}" -A"${{ matrix.cmake_build }}" -DCMAKE_SYSTEM_VERSION="${{ env.CMAKE_SYSTEM_VERSION }}" -DBUILD_BROWSER=false -DBUILD_VST=false -DBUILD_VIRTUALCAM=false -DBUILD_CAPTIONS=false -DCOMPILE_D3D12_HOOK=false -DENABLE_SCRIPTING=false -DDepsPath="${{ github.workspace }}/cmbuild/deps/win${{ matrix.deps_ext }}" -DQTDIR="${{ github.workspace }}/cmbuild/QT/${{ env.QT_VERSION }}/msvc2019${{ matrix.qt_ext }}" -DCOPIED_DEPENDENCIES=FALSE -DCOPY_DEPENDENCIES=TRUE ..
- name: 'Build'
run: msbuild /m /p:Configuration=RelWithDebInfo .\build\obs-studio.sln
- name: Package
if: success()
run: |
$env:FILE_NAME="${{ env.PLUGIN_NAME }}-${{ github.sha }}-windows-${{ matrix.target }}"
echo "FILE_NAME=${env:FILE_NAME}" >> ${env:GITHUB_ENV}
robocopy .\build\rundir\RelWithDebInfo\obs-plugins\${{ matrix.deps_ext }}bit\ .\package\obs-plugins\${{ matrix.deps_ext }}bit ${{ env.PLUGIN_NAME }}.* /E /XF .gitignore
robocopy .\build\rundir\RelWithDebInfo\data\obs-plugins\${{ env.PLUGIN_NAME }}\ .\package\data\obs-plugins\${{ env.PLUGIN_NAME }}\ /E /XF .gitignore
copy .\build\UI\frontend-plugins\${{ env.PLUGIN_NAME }}\installer.iss .\installer\installer.iss
robocopy .\UI\frontend-plugins\${{ env.PLUGIN_NAME}}\media\ .\installer\media\ /E /XF .gitignore
exit 0
- name: Publish zip
if: success()
uses: actions/upload-artifact@v2.2.0
with:
name: '${{ env.FILE_NAME }}'
path: package/*
- name: Publish Installer Files
if: success()
uses: actions/upload-artifact@v2.2.0
with:
name: 'installer-files'
path: installer/*
windows-package:
name: 'Windows Package'
runs-on: [windows-latest]
needs: [windows-build]
steps:
- name: Init
if: success()
run: |
mkdir ./package
$env:FILE_DATE=(Get-Date -UFormat "%F")
$env:FILE_NAME="${{ env.PLUGIN_NAME }}-${env:FILE_DATE}-${{ github.sha }}-windows"
echo "FILE_NAME=${env:FILE_NAME}" >> ${env:GITHUB_ENV}
robocopy .\build32\rundir\RelWithDebInfo\obs-plugins\32bit\ .\package\obs-plugins\32bit ${{ env.PLUGIN_NAME }}.* /E /XF .gitignore
robocopy .\build64\rundir\RelWithDebInfo\obs-plugins\64bit\ .\package\obs-plugins\64bit ${{ env.PLUGIN_NAME }}.* /E /XF .gitignore
robocopy .\build64\rundir\RelWithDebInfo\data\obs-plugins\${{ env.PLUGIN_NAME }}\ .\package\data\obs-plugins\${{ env.PLUGIN_NAME }}\ /E /XF .gitignore
exit 0
$env:FILE_NAME_X86="${{ env.PLUGIN_NAME }}-${{ github.sha }}-windows-x86"
echo "FILE_NAME_X86=${env:FILE_NAME_X86}" >> ${env:GITHUB_ENV}
$env:FILE_NAME_X64="${{ env.PLUGIN_NAME }}-${{ github.sha }}-windows-x64"
echo "FILE_NAME_X64=${env:FILE_NAME_X64}" >> ${env:GITHUB_ENV}
- name: Retrieve x86 build
uses: actions/download-artifact@v2
with:
name: '${{ env.FILE_NAME_X86 }}'
path: ./package
- name: Retrieve x64 build
uses: actions/download-artifact@v2
with:
name: '${{ env.FILE_NAME_X64 }}'
path: ./package
- name: Retrieve installer files
uses: actions/download-artifact@v2
with:
name: 'installer-files'
path: .
- name: Create Code Signing Certificate
if: success() && github.event_name != 'pull_request'
run: |
Expand All @@ -291,11 +343,11 @@ jobs:
- name: Code Sign 32
if: success() && github.event_name != 'pull_request'
run: |
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x86/signtool.exe' sign /fd SHA256 /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\obs-plugins\32bit\${{ env.PLUGIN_NAME }}.dll
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x86/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\obs-plugins\32bit\${{ env.PLUGIN_NAME }}.dll
- name: Code Sign 64
if: success() && github.event_name != 'pull_request'
run: |
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64/signtool.exe' sign /fd SHA256 /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\obs-plugins\64bit\${{ env.PLUGIN_NAME }}.dll
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\obs-plugins\64bit\${{ env.PLUGIN_NAME }}.dll
- name: Publish zip
if: success()
uses: actions/upload-artifact@v2.2.0
Expand All @@ -304,23 +356,23 @@ jobs:
path: package/*
- name: "Package Installer (Prereqs)"
run: |
echo "download msvc redist helper"
curl "-kL" "https://github.com/Xaymar/msvc-redist-helper/releases/download/0.1/msvc-redist-helper-64.exe" "-f" "--retry" "5" "-o" "msvc-redist-helper.exe"
echo "download innosetup"
curl "-kL" "https://files.jrsoftware.org/is/6/innosetup-6.0.3.exe" "-f" "--retry" "5" "-o" "inno.exe"
echo "install innosetup"
.\inno.exe /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART
echo "innosetup install done"
- name: "Package Installer (Compile)"
run: |
& 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' /Qp ".\build64\UI\frontend-plugins\${{ env.PLUGIN_NAME }}\installer.iss"
& 'C:\Program Files (x86)\Inno Setup 6\ISCC.exe' /Qp ".\installer.iss"
- name: Code Sign Installer
if: success() && github.event_name != 'pull_request'
run: |
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64/signtool.exe' sign /fd SHA256 /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\${{ env.PLUGIN_NAME }}-installer.exe
& 'C:/Program Files (x86)/Windows Kits/10/bin/10.0.20348.0/x64/signtool.exe' sign /f certificate\certificate.pfx /p '${{ secrets.CERTIFICATE_PASS }}' /t http://timestamp.comodoca.com/authenticode .\package\${{ env.PLUGIN_NAME }}-installer.exe
- name: Publish installer
if: success()
uses: actions/upload-artifact@v2.2.0
with:
name: '${{ env.FILE_NAME }}-installer'
path: package/*.exe
- name: Remove temp artifacts
uses: geekyeggo/delete-artifact@v1
with:
name: "${{ env.FILE_NAME_X86 }}\n${{ env.FILE_NAME_X64 }}\ninstaller-files"
5 changes: 3 additions & 2 deletions installer.iss.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ LZMAAlgorithm=1
DefaultDirName={code:GetDirName}
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
OutputDir="@ISS_FILES_DIR@"
OutputDir="package"
OutputBaseFilename=@PROJECT_NAME@-installer
DirExistsWarning=no
; Wizard Information
WizardStyle=modern
WizardResizable=yes
SetupIconFile="@PROJECT_SOURCE_DIR@/media/icon.ico"
SetupIconFile="media/icon.ico"

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Expand Down

0 comments on commit ee4804c

Please sign in to comment.