File: release_macOS.sh

package info (click to toggle)
rclone-browser 1.8.0-6
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 1,192 kB
  • sloc: cpp: 4,327; sh: 161; xml: 50; python: 24; makefile: 5
file content (73 lines) | stat: -rwxr-xr-x 1,852 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh

set -e

QTDIR=/usr/local/opt/qt

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"/..
VERSION=$(cat "$ROOT"/VERSION)-$(git rev-parse --short HEAD)
BUILD="$ROOT"/build
TARGET=rclone-browser-$VERSION-macOS
DMG=rclone-browser-$VERSION
APP="$TARGET"/"Rclone Browser.app"

# clean from previous builds (if for the same version in releases)
if [ -d "$BUILD" ]; then
  rm -rf "$BUILD"
fi
if [ -d "$ROOT"/release/"$TARGET" ]; then
  rm -rf "$ROOT"/release/"$TARGET"*
fi
if [ -f "$ROOT"/release/"$DMG".dmg ]; then
  rm "$ROOT"/release/"$DMG".dmg
fi
if [ -d "$ROOT"/release/"Rclone Browser.app" ]; then
  rm -rf "$ROOT"/release/"Rclone Browser.app"
fi



mkdir -p "$BUILD"
cd "$BUILD"
# brew install cmake qt5
cmake .. -DCMAKE_PREFIX_PATH="$QTDIR" -DCMAKE_BUILD_TYPE=Release
# brew install coreutils
make --jobs=$(nproc --all)
cd build
"$QTDIR"/bin/macdeployqt rclone-browser.app -executable="rclone-browser.app/Contents/MacOS/rclone-browser" -qmldir=../src/
cd ../..


mkdir -p release
cd release
mkdir "$TARGET"
cp -R "$BUILD"/build/rclone-browser.app "$APP"
cp "$ROOT"/README.md "$APP"/Readme.md
cp "$ROOT"/CHANGELOG.md "$APP"/Changelog.md
cp "$ROOT"/LICENSE "$APP"/License.txt
mv "$APP"/Contents/MacOS/rclone-browser "$APP"/Contents/MacOS/"Rclone Browser"

sed -i .bak 's/rclone-browser/Rclone Browser/g' "$APP"/Contents/Info.plist
rm "$APP"/Contents/*.bak

cat >"$APP"/Contents/MacOS/qt.conf <<EOF
[Paths]
Plugins = Plugins
EOF

echo
echo "Preparing zip file"
# brew install p7zip
7za a -mx=9 -r -tzip "$TARGET".zip "$TARGET"

## gpg --detach-sign "$TARGET".zip.sig "$TARGET".zip

echo
echo "Preparing dmg file"
# brew install node && npm install -g appdmg
# https://github.com/LinusU/node-appdmg
cp -R "$TARGET"/"Rclone Browser.app" .
cd ../scripts
appdmg ../assets/appdmg.json ../release/"$DMG".dmg
cd ../release
rm -rf "Rclone Browser.app"