From b7985070ff1856a57089e0fffbad1beba0b1ec81 Mon Sep 17 00:00:00 2001 From: Gordon Pedersen Date: Wed, 2 Aug 2023 11:42:24 +1000 Subject: [PATCH] modify packaging and publishing slightly --- .dragonruby | 2 +- package.bat | 73 +---------------------------------------------------- publish.bat | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+), 73 deletions(-) create mode 100644 publish.bat diff --git a/.dragonruby b/.dragonruby index 7a5a15f..fc9659a 160000 --- a/.dragonruby +++ b/.dragonruby @@ -1 +1 @@ -Subproject commit 7a5a15f0f24536e57f7577ddbb45f9b3a3fc23ea +Subproject commit fc9659ac6c87245a0a979407f6e35cb35e571fb0 diff --git a/package.bat b/package.bat index 3377d7f..f5e70fd 100644 --- a/package.bat +++ b/package.bat @@ -1,72 +1 @@ -@echo off -chcp 65001 >NUL -cd /d %~dp0 - -set gamedir=🕹️cube-tube -for /F %%a IN ('powershell -command "$([guid]::NewGuid().ToString().toUpper())"') DO (set newProductCode=%%a) -for /F %%a IN ('powershell -command "$([guid]::NewGuid().ToString().toUpper())"') DO (set newPackageCode=%%a) - -@setlocal ENABLEEXTENSIONS - -@set version=0 -@for /F "tokens=*" %%A in (%gamedir%/metadata/game_metadata.txt) do @call :CheckForVersion "%%A" - -cd .dragonruby - -robocopy ../marketing-assets/AppIcon.appiconset ./dragonruby-ios.app/Assets.xcassets/AppIcon.appiconset /e -robocopy ../marketing-assets/AppIcon.appiconset ./dragonruby-ios-simulator.app/Assets.xcassets/AppIcon.appiconset /e -robocopy ../%gamedir% ./%gameid% /e - -@echo on -dragonruby-publish --only-package %gameid% -@echo off -rd /s /q %gameid% - -cd builds - -if exist ./%gameid%-windows-amd64.exe ( -if exist ../../installer/installer.vdproj ( - echo "Building windows installer..." - for /F "tokens=* USEBACKQ" %%t IN (`findstr /c:"%version%" ..\..\installer\installer.vdproj`) do (SET OldVersion=%%t) - if defined OldVersion ( - echo "version already the same" - ) else ( - echo "need to update version & product/package codes (%version%, %newProductCode%, %newPackageCode%)" - powershell -Command "(Get-Content ../../installer/installer.vdproj) | Foreach-Object { $_ -replace '""""ProductCode"""" = """"8:\{.*\}""""$', '""""ProductCode"""" = """"8:{%newProductCode%}""""' -replace '""""PackageCode"""" = """"8:\{.*\}""""$', '""""PackageCode"""" = """"8:{%newPackageCode%}""""' -replace '""""ProductVersion"""" = """"8:.+""""$', '""""ProductVersion"""" = """"8:%version%""' } | Out-File -encoding UTF8 ../../installer/installer.vdproj" - ) - call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe" ..\..\installer\installer.sln /build Release -) else ( - ECHO "no installer project?" - ECHO ../../installer/installer.vdproj -) -) else ( - ECHO "no exe?" - ECHO ./%gameid%-windows-amd64.exe -) - -if not exist ../../%gameid%.keystore ( - echo "no keystore, generating keys" - keytool -genkey -v -keystore ../../%gameid%.keystore -alias %gameid% -keyalg RSA -keysize 2048 -validity 10000 -) -if exist ./%gameid%-android.apk ( - echo "Signing apk..." - call "C:\Program Files (x86)\Android\android-sdk\build-tools\32.0.0\apksigner.bat" sign -ks ../../%gameid%.keystore %gameid%-android.apk - echo "Signing aab..." - call jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore ../../%gameid%.keystore %gameid%-googleplay.aab %gameid% -) else ( - ECHO "no apk?" - ECHO ./%gameid%-android.apk -) - -ECHO "All done!" -explorer.exe %cd% -PAUSE -@exit /b 0 - -:CheckForVersion -@set _line=%~1 -@set _linePrefeix=%_line:~0,8% -@if "%_linePrefeix%" equ "version=" (@set version="%_line:~8%") -@set _linePrefeix=%_line:~0,7% -@if "%_linePrefeix%" equ "gameid=" (@set gameid="%_line:~7%") -@exit /b 0 \ No newline at end of file +call publish.bat --only-package \ No newline at end of file diff --git a/publish.bat b/publish.bat new file mode 100644 index 0000000..dba8029 --- /dev/null +++ b/publish.bat @@ -0,0 +1,72 @@ +@echo off +chcp 65001 >NUL +cd /d %~dp0 + +set gamedir=🕹️cube-tube +for /F %%a IN ('powershell -command "$([guid]::NewGuid().ToString().toUpper())"') DO (set newProductCode=%%a) +for /F %%a IN ('powershell -command "$([guid]::NewGuid().ToString().toUpper())"') DO (set newPackageCode=%%a) + +@setlocal ENABLEEXTENSIONS + +@set version=0 +@for /F "tokens=*" %%A in (%gamedir%/metadata/game_metadata.txt) do @call :CheckForVersion "%%A" + +cd .dragonruby + +robocopy ../marketing-assets/AppIcon.appiconset ./dragonruby-ios.app/Assets.xcassets/AppIcon.appiconset /e +robocopy ../marketing-assets/AppIcon.appiconset ./dragonruby-ios-simulator.app/Assets.xcassets/AppIcon.appiconset /e +robocopy ../%gamedir% ./%gameid% /e + +@echo on +dragonruby-publish %* %gameid% +@echo off +rd /s /q %gameid% + +cd builds + +if exist ./%gameid%-windows-amd64.exe ( +if exist ../../installer/installer.vdproj ( + echo "Building windows installer..." + for /F "tokens=* USEBACKQ" %%t IN (`findstr /c:"%version%" ..\..\installer\installer.vdproj`) do (SET OldVersion=%%t) + if defined OldVersion ( + echo "version already the same" + ) else ( + echo "need to update version & product/package codes (%version%, %newProductCode%, %newPackageCode%)" + powershell -Command "(Get-Content ../../installer/installer.vdproj) | Foreach-Object { $_ -replace '""""ProductCode"""" = """"8:\{.*\}""""$', '""""ProductCode"""" = """"8:{%newProductCode%}""""' -replace '""""PackageCode"""" = """"8:\{.*\}""""$', '""""PackageCode"""" = """"8:{%newPackageCode%}""""' -replace '""""ProductVersion"""" = """"8:.+""""$', '""""ProductVersion"""" = """"8:%version%""' } | Out-File -encoding UTF8 ../../installer/installer.vdproj" + ) + call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe" ..\..\installer\installer.sln /build Release +) else ( + ECHO "no installer project?" + ECHO ../../installer/installer.vdproj +) +) else ( + ECHO "no exe?" + ECHO ./%gameid%-windows-amd64.exe +) + +if not exist ../../%gameid%.keystore ( + echo "no keystore, generating keys" + keytool -genkey -v -keystore ../../%gameid%.keystore -alias %gameid% -keyalg RSA -keysize 2048 -validity 10000 +) +if exist ./%gameid%-android.apk ( + echo "Signing apk..." + call "C:\Program Files (x86)\Android\android-sdk\build-tools\32.0.0\apksigner.bat" sign -ks ../../%gameid%.keystore %gameid%-android.apk + echo "Signing aab..." + call jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore ../../%gameid%.keystore %gameid%-googleplay.aab %gameid% +) else ( + ECHO "no apk?" + ECHO ./%gameid%-android.apk +) + +ECHO "All done!" +explorer.exe %cd% +PAUSE +@exit /b 0 + +:CheckForVersion +@set _line=%~1 +@set _linePrefeix=%_line:~0,8% +@if "%_linePrefeix%" equ "version=" (@set version="%_line:~8%") +@set _linePrefeix=%_line:~0,7% +@if "%_linePrefeix%" equ "gameid=" (@set gameid="%_line:~7%") +@exit /b 0 \ No newline at end of file