Created
February 1, 2021 19:27
-
-
Save ekhart/5074e616c9f6e89495fefd5b019f5e72 to your computer and use it in GitHub Desktop.
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
rem Ustawiamy ścieżkę do .exe edytora | |
set unity="C:\Program Files\Unity\Hub\Editor\2020.2.0f1\Editor\Unity.exe" | |
rem Ustawiamy ścieżkę do 7zipa | |
set zip="C:\Program Files\7-Zip\7z" | |
rem Ustawiamy nazwę platformy | |
set platform=Windows | |
rem ! Uruchamiamy metodę w klasie - pobieramy przez C# numer aktualnej rewizji, update'ujemy PlayerSetting.version i zapisujemy go w pliku version.log | |
%unity% -batchmode -projectPath ./ -executeMethod Project.Editor.Builder.SetVersionSVNRevision -logFile build.log -quit | |
rem nazwa projektu | |
set title=Projekt | |
rem Nazwę wersji możemy ustawić też przez zmiennej | |
rem set major=0 | |
rem set minor=2 | |
rem set patch=2 | |
rem set revision=1 | |
rem np Projekt-0.2.2.1-Windows | |
rem set name=%title%-%major%.%minor%.%patch%.%revision%-%platform% | |
rem Pobieramy wersję zapisaną w tymczasowym pliku version.log | |
set /p version= < version.log | |
set name=%title%-%version%-%platform% | |
rem Obok folderu assets tworzymy folder Builds, a w nim foldery Windows, Mac, Linux (per platforma) | |
set folder=Builds\%platform% | |
rem Uruchamiamy właściwe budowanie projektu | |
%unity% -batchmode -projectPath ./ -buildWindows64Player "%folder%\%title%\%title%.exe" -logFile build.log -debugCodeOptimization -quit | |
rem Usuwamy plik vesion.log | |
del version.log | |
rem Przechodzimy do folderu z zbudowaną grą | |
cd %folder% | |
rem Dodajemy zawartość folderu do zipa | |
%zip% a -tzip "%name%.zip" %title% | |
rem Odpalamy folder - pokazuje nam się Eksplorator plików | |
start . | |
rem Wracamy dwa foldery w górę - czyli do folderu Assets | |
cd ..\.. | |
rem archiwizacja projektu | |
xcodebuild clean archive -project "%folder%/%title%/Unity-iPhone.xcodeproj" -scheme Unity-iPhone -allowProvisioningUpdates CODE_SIGN_STYLE=Automatic DEVELOPMENT_TEAM=<id> -archivePath "%folder%/%title%/archive/Unity-iPhone" | |
rem export .ipa | |
xcodebuild -exportArchive -archivePath "%folder%/%title%/archive/Unity-iPhone.xcarchive" -exportOptionsPlist ExportOptions.plist -exportPath "%folder%/%title%/export/Unity-iPhone.ipa" | |
rem upload na TestFlight ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment