12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- @echo off
-
- :=== Parameters ===
- python -c "import re,sys; print re.search('<addon.+?version=""([^""]+)""',open('addon.xml').read()).group(1)" >version.txt
- set /p ver=<version.txt
- python -c "import re,sys; print re.search('<addon.+?id=""([^""]+)""',open('addon.xml').read()).group(1)" >id.txt
- set /p pack_name=<id.txt
- echo %pack_name% %ver%
- pause
-
- set release_dir=release\
- set repo_dir=q:\web\repo\
- :set feed_dir=q:\web\repo\
-
- set AR=\MinGW\bin\ar.exe
- set TAR=\MinGW\msys\1.0\bin\tar.exe
- set CP=\MinGW\msys\1.0\bin\cp.exe
- set ZIP=
- rem set ZIP=\Program Files (x86)\Gow\bin\zip.exe
-
- :=== Create package zip file ===
- if exist "%pack_name%" rm -r -f "%pack_name%"
- mkdir "%pack_name%""
- if not exist %release_dir% mkdir %release_dir%
- echo Copying files to %pack_name%
-
- for %%f in (
- readme.md
- changelog.md
- addon.xml
- addon.py
- icon.png
- kodiswift\*.py
- resources\__init__.py
- resources\settings.xml
- resources\icon.png
- resources\language\English\*
- resources\lib\__init__.py
- resources\lib\photostation_api.py
- ) do echo f| xcopy %%f %pack_name%\%%f
- pause
-
- echo Creating %release_dir%%pack_name%-%ver%.zip
- if exist %release_dir%%pack_name%-%ver%.zip rm %release_dir%%pack_name%-%ver%.zip
- 7za a -r -tzip -bb0 -bsp1 -bso0 %release_dir%%pack_name%-%ver%.zip %pack_name%
- if exist %pack_name% rm -r -f %pack_name%
-
- if ()==(%1%) (
- GOTO :EOF
- )
- :=== Add to git ===
- echo Adding to git
- echo git add %release_dir%%pack_name%-%ver%.zip
- git add %release_dir%%pack_name%-%ver%.zip
- git commit -m %ver%
- git tag -d %ver%
- git tag %ver%
- git push
-
-
- :=== Copy package to repo ===
- echo Copying %release_dir%%pack_name%-%ver%.zip to %repo_dir%%pack_name%
- if not exist %repo_dir% mkdir %repo_dir%
- if not exist %repo_dir%%pack_name% mkdir %repo_dir%%pack_name%
- cp addon.xml %repo_dir%%pack_name%\addon.xml -fpv
- cp %release_dir%%pack_name%-%ver%.zip %repo_dir%%pack_name%\%pack_name%-%ver%.zip -fpv
- python -c "import hashlib; print hashlib.md5(open(r'%repo_dir%%pack_name%\%pack_name%-%ver%.zip','r').read()).hexdigest()" >%repo_dir%%pack_name%\%pack_name%-%ver%.zip.md5
- python ..\generate_repo.py %repo_dir%
- )
|