Switch to GitHub Actions for Windows and macOS builds

This commit is contained in:
Cameron Gutman 2025-10-26 12:31:33 -05:00
commit 68aa04926e
8 changed files with 157 additions and 40 deletions

View file

@ -11,7 +11,12 @@ SOURCE_ROOT=$PWD
BUILD_FOLDER=$BUILD_ROOT/build-$BUILD_CONFIG
DEPLOY_FOLDER=$BUILD_ROOT/deploy-$BUILD_CONFIG
INSTALLER_FOLDER=$BUILD_ROOT/installer-$BUILD_CONFIG
VERSION=`cat $SOURCE_ROOT/app/version.txt`
if [ -n "$CI_VERSION" ]; then
VERSION=$CI_VERSION
else
VERSION=`cat $SOURCE_ROOT/app/version.txt`
fi
command -v qmake6 >/dev/null 2>&1 || fail "Unable to find 'qmake6' in your PATH!"
command -v linuxdeployqt >/dev/null 2>&1 || fail "Unable to find 'linuxdeployqt' in your PATH!"

View file

@ -96,7 +96,13 @@ set BUILD_FOLDER=%BUILD_ROOT%\build-%ARCH%-%BUILD_CONFIG%
set DEPLOY_FOLDER=%BUILD_ROOT%\deploy-%ARCH%-%BUILD_CONFIG%
set INSTALLER_FOLDER=%BUILD_ROOT%\installer-%ARCH%-%BUILD_CONFIG%
set SYMBOLS_FOLDER=%BUILD_ROOT%\symbols-%ARCH%-%BUILD_CONFIG%
set /p VERSION=<%SOURCE_ROOT%\app\version.txt
rem Allow CI to override the version.txt with an environment variable
if defined CI_VERSION (
set VERSION=%CI_VERSION%
) else (
set /p VERSION=<%SOURCE_ROOT%\app\version.txt
)
rem Use the correct VC tools for the specified architecture
if /I "%ARCH%" EQU "x64" (
@ -237,7 +243,7 @@ if "%ML_SYMBOL_STORE%" NEQ "" (
)
echo Building MSI
msbuild -Restore %SOURCE_ROOT%\wix\Moonlight\Moonlight.wixproj /p:Configuration=%BUILD_CONFIG% /p:Platform=%ARCH% /p:MSBuildProjectExtensionsPath=%BUILD_FOLDER%\
cmd /c "set VERSION= && msbuild -Restore %SOURCE_ROOT%\wix\Moonlight\Moonlight.wixproj /p:Configuration=%BUILD_CONFIG% /p:Platform=%ARCH% /p:MSBuildProjectExtensionsPath=%BUILD_FOLDER%\"
if !ERRORLEVEL! NEQ 0 goto Error
echo Copying application binary to deployment directory

View file

@ -16,7 +16,12 @@ SOURCE_ROOT=$PWD
BUILD_FOLDER=$BUILD_ROOT/build-$BUILD_CONFIG
DEPLOY_FOLDER=$BUILD_ROOT/deploy-$BUILD_CONFIG
INSTALLER_FOLDER=$BUILD_ROOT/installer-$BUILD_CONFIG
VERSION=`cat $SOURCE_ROOT/app/version.txt`
if [ -n "$CI_VERSION" ]; then
VERSION=$CI_VERSION
else
VERSION=`cat $SOURCE_ROOT/app/version.txt`
fi
echo Cleaning output directories
rm -rf $BUILD_FOLDER

View file

@ -38,7 +38,13 @@ set BUILD_ROOT=%cd%\build
set SOURCE_ROOT=%cd%
set BUILD_FOLDER=%BUILD_ROOT%\build-%BUILD_CONFIG%
set INSTALLER_FOLDER=%BUILD_ROOT%\installer-%BUILD_CONFIG%
set /p VERSION=<%SOURCE_ROOT%\app\version.txt
rem Allow CI to override the version.txt with an environment variable
if defined CI_VERSION (
set VERSION=%CI_VERSION%
) else (
set /p VERSION=<%SOURCE_ROOT%\app\version.txt
)
rem Ensure that all architectures have been built before the final bundle
if not exist "%BUILD_ROOT%\build-x64-%BUILD_CONFIG%\Moonlight.msi" (
@ -67,7 +73,7 @@ if !ERRORLEVEL! NEQ 0 goto Error
echo Building bundle
rem Bundles are always x86 binaries
msbuild -Restore %SOURCE_ROOT%\wix\MoonlightSetup\MoonlightSetup.wixproj /p:Configuration=%BUILD_CONFIG% /p:Platform=x86 /p:MSBuildProjectExtensionsPath=%BUILD_FOLDER%\
cmd /c "set VERSION= && msbuild -Restore %SOURCE_ROOT%\wix\MoonlightSetup\MoonlightSetup.wixproj /p:Configuration=%BUILD_CONFIG% /p:Platform=x86 /p:MSBuildProjectExtensionsPath=%BUILD_FOLDER%\"
if !ERRORLEVEL! NEQ 0 goto Error
rem Rename the installer to match the publishing convention

View file

@ -15,7 +15,12 @@ BUILD_ROOT=$PWD/build
SOURCE_ROOT=$PWD
BUILD_FOLDER=$BUILD_ROOT/build-$BUILD_CONFIG
INSTALLER_FOLDER=$BUILD_ROOT/installer-$BUILD_CONFIG
VERSION=`cat $SOURCE_ROOT/app/version.txt`
if [ -n "$CI_VERSION" ]; then
VERSION=$CI_VERSION
else
VERSION=`cat $SOURCE_ROOT/app/version.txt`
fi
if [ "$SIGNING_PROVIDER_SHORTNAME" == "" ]; then
SIGNING_PROVIDER_SHORTNAME=$SIGNING_IDENTITY
@ -65,9 +70,9 @@ fi
echo Creating DMG
if [ "$SIGNING_IDENTITY" != "" ]; then
create-dmg $BUILD_FOLDER/app/Moonlight.app $INSTALLER_FOLDER --identity="$SIGNING_IDENTITY" || fail "create-dmg failed!"
create-dmg $BUILD_FOLDER/app/Moonlight.app $INSTALLER_FOLDER --identity="$SIGNING_IDENTITY" --no-version-in-filename || fail "create-dmg failed!"
else
create-dmg $BUILD_FOLDER/app/Moonlight.app $INSTALLER_FOLDER
create-dmg $BUILD_FOLDER/app/Moonlight.app $INSTALLER_FOLDER --no-version-in-filename
case $? in
0) ;;
2) ;;
@ -77,11 +82,11 @@ fi
if [ "$NOTARY_KEYCHAIN_PROFILE" != "" ]; then
echo Uploading to App Notary service
xcrun notarytool submit --keychain-profile "$NOTARY_KEYCHAIN_PROFILE" --wait $INSTALLER_FOLDER/Moonlight\ $VERSION.dmg || fail "Notary submission failed"
xcrun notarytool submit --keychain-profile "$NOTARY_KEYCHAIN_PROFILE" --wait $INSTALLER_FOLDER/Moonlight.dmg || fail "Notary submission failed"
echo Stapling notary ticket to DMG
xcrun stapler staple -v $INSTALLER_FOLDER/Moonlight\ $VERSION.dmg || fail "Notary ticket stapling failed!"
xcrun stapler staple -v $INSTALLER_FOLDER/Moonlight.dmg || fail "Notary ticket stapling failed!"
fi
mv $INSTALLER_FOLDER/Moonlight\ $VERSION.dmg $INSTALLER_FOLDER/Moonlight-$VERSION.dmg
mv $INSTALLER_FOLDER/Moonlight.dmg $INSTALLER_FOLDER/Moonlight-$VERSION.dmg
echo Build successful