Skip to content

Commit 0a293b6

Browse files
authored
Merge pull request #742 from mapillary/feat-folder-build
Create folder builds with Pyinstaller
2 parents a8713d8 + f511e7b commit 0a293b6

4 files changed

Lines changed: 100 additions & 0 deletions

File tree

mapillary_tools_folder.spec

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
3+
4+
block_cipher = None
5+
6+
7+
a = Analysis(["./pyinstaller/main.py"],
8+
pathex=[SPECPATH],
9+
binaries=[],
10+
datas=[],
11+
hiddenimports=[],
12+
hookspath=[],
13+
runtime_hooks=[],
14+
excludes=[],
15+
win_no_prefer_redirects=False,
16+
win_private_assemblies=False,
17+
cipher=block_cipher,
18+
noarchive=False)
19+
pyz = PYZ(a.pure, a.zipped_data,
20+
cipher=block_cipher)
21+
exe = EXE(pyz,
22+
a.scripts,
23+
[],
24+
exclude_binaries=True,
25+
name='mapillary_tools',
26+
debug=False,
27+
bootloader_ignore_signals=False,
28+
strip=False,
29+
upx=True,
30+
console=True )
31+
coll = COLLECT(exe,
32+
a.binaries,
33+
a.zipfiles,
34+
a.datas,
35+
strip=False,
36+
upx=True,
37+
upx_exclude=[],
38+
name='mapillary_tools_folder')

script/build_linux

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ mkdir -p dist
88
rm -rf dist/${OS}
99
pyinstaller --version
1010
pyinstaller --noconfirm --distpath dist/${OS} mapillary_tools.spec
11+
pyinstaller --noconfirm --distpath dist/${OS} mapillary_tools_folder.spec
1112

1213
# check
1314
SOURCE=dist/${OS}/mapillary_tools
@@ -28,5 +29,26 @@ cd dist/releases
2829
shasum -a256 "$TARGET_BASENAME" | tee "${TARGET_BASENAME}.sha256.txt"
2930
cd ../../
3031

32+
# check
33+
FOLDER=dist/${OS}/mapillary_tools_folder
34+
SOURCE=dist/${OS}/mapillary_tools_folder/mapillary_tools
35+
$SOURCE --version
36+
VERSION=$($SOURCE --version | awk '{print $3}')
37+
ARCH=$(uname -m)
38+
TARGET=dist/releases/mapillary_tools-folder-${VERSION}-${OS}-${ARCH}
39+
40+
# package
41+
mkdir -p dist/releases
42+
cd dist/${OS}/
43+
zip -r ../../"$TARGET" mapillary_tools_folder
44+
cd ../../
45+
46+
# sha256
47+
TARGET_BASENAME=$(basename "$TARGET")
48+
# to produce "HASH mapillary_tools" instead of "HASH dist/releases/mapillary_tools"
49+
cd dist/releases
50+
shasum -a256 "$TARGET_BASENAME" | tee "${TARGET_BASENAME}.sha256.txt"
51+
cd ../../
52+
3153
# summary
3254
ls -l dist/releases

script/build_osx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ mkdir -p dist
88
rm -rf dist/${OS}
99
pyinstaller --version
1010
pyinstaller --noconfirm --distpath dist/${OS} mapillary_tools.spec
11+
pyinstaller --noconfirm --distpath dist/${OS} mapillary_tools_folder.spec
1112

1213
# check
1314
SOURCE=dist/${OS}/mapillary_tools.app/Contents/MacOS/mapillary_tools
@@ -28,5 +29,26 @@ cd dist/releases
2829
shasum -a256 "$TARGET_BASENAME" | tee "${TARGET_BASENAME}.sha256.txt"
2930
cd ../../
3031

32+
# check
33+
FOLDER=dist/${OS}/mapillary_tools_folder
34+
SOURCE=dist/${OS}/mapillary_tools_folder/mapillary_tools
35+
$SOURCE --version
36+
VERSION=$($SOURCE --version | awk '{print $3}')
37+
ARCH=$(uname -m)
38+
TARGET=dist/releases/mapillary_tools-folder-${VERSION}-${OS}-${ARCH}.zip
39+
40+
# package
41+
mkdir -p dist/releases
42+
cd dist/${OS}/
43+
zip -r ../../"$TARGET" mapillary_tools_folder
44+
cd ../../
45+
46+
# sha256
47+
TARGET_BASENAME=$(basename "$TARGET")
48+
# to produce "HASH mapillary_tools" instead of "HASH dist/releases/mapillary_tools"
49+
cd dist/releases
50+
shasum -a256 "$TARGET_BASENAME" | tee "${TARGET_BASENAME}.sha256.txt"
51+
cd ../../
52+
3153
# summary
3254
ls -l dist/releases

script/build_win.ps1

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ if ($MAXSIZE32 -ceq "True") {
1313
mkdir -Force dist
1414
pyinstaller --version
1515
pyinstaller --noconfirm --distpath dist\win mapillary_tools.spec
16+
pyinstaller --noconfirm --distpath dist\win mapillary_tools_folder.spec
1617

1718
# check
1819
$SOURCE="dist\win\mapillary_tools.exe"
@@ -29,5 +30,22 @@ Copy-Item "$SOURCE" "$TARGET"
2930
# sha256
3031
Get-FileHash $TARGET -Algorithm SHA256 | Select-Object Hash > "$TARGET.sha256.txt"
3132

33+
# check
34+
$FOLDER="dist\win\mapillary_tools_folder"
35+
$SOURCE="dist\win\mapillary_tools_folder\mapillary_tools.exe"
36+
dist\win\mapillary_tools_folder\mapillary_tools.exe --version
37+
$VERSION_OUTPUT=dist\win\mapillary_tools_folder\mapillary_tools.exe --version
38+
$VERSION=$VERSION_OUTPUT.split(' ')[2]
39+
$TARGET="dist\releases\mapillary_tools-folder-$VERSION-$OS-$ARCH.zip"
40+
41+
# package
42+
mkdir -Force dist\releases
43+
cd dist\win
44+
Compress-Archive -Path mapillary_tools_folder -DestinationPath ..\..\"$TARGET"
45+
cd ..\..\
46+
47+
# sha256
48+
Get-FileHash $TARGET -Algorithm SHA256 | Select-Object Hash > "$TARGET.sha256.txt"
49+
3250
# summary
3351
Get-ChildItem dist\releases

0 commit comments

Comments
 (0)