2023-05-08 05:28:12 +00:00
|
|
|
|
@echo off
|
|
|
|
|
cd /d %~dp0
|
|
|
|
|
|
2023-07-11 02:34:03 +00:00
|
|
|
|
set CurrDirName=🕹️cube-tube
|
2023-05-23 04:01:52 +00:00
|
|
|
|
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 (./metadata/game_metadata.txt) do @call :CheckForVersion "%%A"
|
2023-05-08 05:28:12 +00:00
|
|
|
|
|
2023-07-11 02:34:03 +00:00
|
|
|
|
cd .dragonruby
|
2023-05-08 05:28:12 +00:00
|
|
|
|
@echo on
|
2023-07-11 02:34:03 +00:00
|
|
|
|
dragonruby-publish --only-package ../%CurrDirName%
|
2023-05-08 07:03:13 +00:00
|
|
|
|
@echo off
|
|
|
|
|
cd builds
|
2023-05-23 04:01:52 +00:00
|
|
|
|
|
|
|
|
|
if exist ./%CurrDirName%-windows-amd64.exe (
|
2023-07-11 02:34:03 +00:00
|
|
|
|
if exist ../../%CurrDirName%/installer/installer.vdproj (
|
2023-05-23 04:01:52 +00:00
|
|
|
|
echo "Building windows installer..."
|
2023-07-11 02:34:03 +00:00
|
|
|
|
for /F "tokens=* USEBACKQ" %%t IN (`findstr /c:"%version%" ..\..\%CurrDirName%\installer\installer.vdproj`) do (SET OldVersion=%%t)
|
2023-05-23 04:01:52 +00:00
|
|
|
|
if defined OldVersion (
|
|
|
|
|
echo "version already the same"
|
|
|
|
|
) else (
|
|
|
|
|
echo "need to update version & product/package codes (%version%, %newProductCode%, %newPackageCode%)"
|
2023-07-11 02:34:03 +00:00
|
|
|
|
powershell -Command "(Get-Content ../../%CurrDirName%/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 ../../%CurrDirName%/installer/installer.vdproj"
|
2023-05-23 04:01:52 +00:00
|
|
|
|
)
|
2023-07-11 02:34:03 +00:00
|
|
|
|
call "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\devenv.exe" ..\..\%CurrDirName%\installer\installer.sln /build Release
|
2023-05-23 04:01:52 +00:00
|
|
|
|
) else (
|
|
|
|
|
ECHO "no installer project?"
|
2023-07-11 02:34:03 +00:00
|
|
|
|
ECHO ../../%CurrDirName%/installer/installer.vdproj
|
2023-05-23 04:01:52 +00:00
|
|
|
|
)
|
|
|
|
|
) else (
|
|
|
|
|
ECHO "no exe?"
|
|
|
|
|
ECHO ./%CurrDirName%-windows-amd64.exe
|
|
|
|
|
)
|
|
|
|
|
|
2023-05-08 07:03:13 +00:00
|
|
|
|
if not exist ./%CurrDirName%.keystore (
|
|
|
|
|
echo "no keystore, generating keys"
|
|
|
|
|
keytool -genkey -v -keystore %CurrDirName%.keystore -alias %CurrDirName% -keyalg RSA -keysize 2048 -validity 10000
|
|
|
|
|
)
|
|
|
|
|
if exist ./%CurrDirName%-android.apk (
|
|
|
|
|
echo "Signing apk..."
|
|
|
|
|
call "C:\Program Files (x86)\Android\android-sdk\build-tools\32.0.0\apksigner.bat" sign -ks %CurrDirName%.keystore %CurrDirName%-android.apk
|
2023-05-22 23:32:35 +00:00
|
|
|
|
echo "Signing aab..."
|
|
|
|
|
call jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore %CurrDirName%.keystore %CurrDirName%-googleplay.aab %CurrDirName%
|
2023-05-08 07:03:13 +00:00
|
|
|
|
) else (
|
|
|
|
|
ECHO "no apk?"
|
|
|
|
|
ECHO ./%CurrDirName%-android.apk
|
|
|
|
|
)
|
2023-05-23 04:01:52 +00:00
|
|
|
|
|
2023-05-08 07:03:13 +00:00
|
|
|
|
ECHO "All done!"
|
|
|
|
|
explorer.exe %cd%
|
2023-05-23 04:01:52 +00:00
|
|
|
|
PAUSE
|
|
|
|
|
@exit /b 0
|
|
|
|
|
|
|
|
|
|
:CheckForVersion
|
|
|
|
|
@set _line=%~1
|
|
|
|
|
@set _linePrefeix=%_line:~0,8%
|
|
|
|
|
@if "%_linePrefeix%" equ "version=" (@set version="%_line:~8%")
|
|
|
|
|
@exit /b 0
|