diff --git a/mapillary_tools_folder.spec b/mapillary_tools_folder.spec new file mode 100644 index 000000000..3c7e48beb --- /dev/null +++ b/mapillary_tools_folder.spec @@ -0,0 +1,38 @@ +# -*- mode: python ; coding: utf-8 -*- + + +block_cipher = None + + +a = Analysis(["./pyinstaller/main.py"], + pathex=[SPECPATH], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) +exe = EXE(pyz, + a.scripts, + [], + exclude_binaries=True, + name='mapillary_tools', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + console=True ) +coll = COLLECT(exe, + a.binaries, + a.zipfiles, + a.datas, + strip=False, + upx=True, + upx_exclude=[], + name='mapillary_tools_folder') diff --git a/script/build_linux b/script/build_linux index 50c117994..ac1d75dc4 100755 --- a/script/build_linux +++ b/script/build_linux @@ -8,6 +8,7 @@ mkdir -p dist rm -rf dist/${OS} pyinstaller --version pyinstaller --noconfirm --distpath dist/${OS} mapillary_tools.spec +pyinstaller --noconfirm --distpath dist/${OS} mapillary_tools_folder.spec # check SOURCE=dist/${OS}/mapillary_tools @@ -28,5 +29,26 @@ cd dist/releases shasum -a256 "$TARGET_BASENAME" | tee "${TARGET_BASENAME}.sha256.txt" cd ../../ +# check +FOLDER=dist/${OS}/mapillary_tools_folder +SOURCE=dist/${OS}/mapillary_tools_folder/mapillary_tools +$SOURCE --version +VERSION=$($SOURCE --version | awk '{print $3}') +ARCH=$(uname -m) +TARGET=dist/releases/mapillary_tools-folder-${VERSION}-${OS}-${ARCH} + +# package +mkdir -p dist/releases +cd dist/${OS}/ +zip -r ../../"$TARGET" mapillary_tools_folder +cd ../../ + +# sha256 +TARGET_BASENAME=$(basename "$TARGET") +# to produce "HASH mapillary_tools" instead of "HASH dist/releases/mapillary_tools" +cd dist/releases +shasum -a256 "$TARGET_BASENAME" | tee "${TARGET_BASENAME}.sha256.txt" +cd ../../ + # summary ls -l dist/releases diff --git a/script/build_osx b/script/build_osx index 81c670a79..258b23181 100755 --- a/script/build_osx +++ b/script/build_osx @@ -8,6 +8,7 @@ mkdir -p dist rm -rf dist/${OS} pyinstaller --version pyinstaller --noconfirm --distpath dist/${OS} mapillary_tools.spec +pyinstaller --noconfirm --distpath dist/${OS} mapillary_tools_folder.spec # check SOURCE=dist/${OS}/mapillary_tools.app/Contents/MacOS/mapillary_tools @@ -28,5 +29,26 @@ cd dist/releases shasum -a256 "$TARGET_BASENAME" | tee "${TARGET_BASENAME}.sha256.txt" cd ../../ +# check +FOLDER=dist/${OS}/mapillary_tools_folder +SOURCE=dist/${OS}/mapillary_tools_folder/mapillary_tools +$SOURCE --version +VERSION=$($SOURCE --version | awk '{print $3}') +ARCH=$(uname -m) +TARGET=dist/releases/mapillary_tools-folder-${VERSION}-${OS}-${ARCH}.zip + +# package +mkdir -p dist/releases +cd dist/${OS}/ +zip -r ../../"$TARGET" mapillary_tools_folder +cd ../../ + +# sha256 +TARGET_BASENAME=$(basename "$TARGET") +# to produce "HASH mapillary_tools" instead of "HASH dist/releases/mapillary_tools" +cd dist/releases +shasum -a256 "$TARGET_BASENAME" | tee "${TARGET_BASENAME}.sha256.txt" +cd ../../ + # summary ls -l dist/releases diff --git a/script/build_win.ps1 b/script/build_win.ps1 index 1194d17e5..3eb1cdf13 100644 --- a/script/build_win.ps1 +++ b/script/build_win.ps1 @@ -13,6 +13,7 @@ if ($MAXSIZE32 -ceq "True") { mkdir -Force dist pyinstaller --version pyinstaller --noconfirm --distpath dist\win mapillary_tools.spec +pyinstaller --noconfirm --distpath dist\win mapillary_tools_folder.spec # check $SOURCE="dist\win\mapillary_tools.exe" @@ -29,5 +30,22 @@ Copy-Item "$SOURCE" "$TARGET" # sha256 Get-FileHash $TARGET -Algorithm SHA256 | Select-Object Hash > "$TARGET.sha256.txt" +# check +$FOLDER="dist\win\mapillary_tools_folder" +$SOURCE="dist\win\mapillary_tools_folder\mapillary_tools.exe" +dist\win\mapillary_tools_folder\mapillary_tools.exe --version +$VERSION_OUTPUT=dist\win\mapillary_tools_folder\mapillary_tools.exe --version +$VERSION=$VERSION_OUTPUT.split(' ')[2] +$TARGET="dist\releases\mapillary_tools-folder-$VERSION-$OS-$ARCH.zip" + +# package +mkdir -Force dist\releases +cd dist\win +Compress-Archive -Path mapillary_tools_folder -DestinationPath ..\..\"$TARGET" +cd ..\..\ + +# sha256 +Get-FileHash $TARGET -Algorithm SHA256 | Select-Object Hash > "$TARGET.sha256.txt" + # summary Get-ChildItem dist\releases