-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrelease-shared.bash
More file actions
executable file
·51 lines (40 loc) · 1.73 KB
/
release-shared.bash
File metadata and controls
executable file
·51 lines (40 loc) · 1.73 KB
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
#!/usr/bin/env bash
function buildUbuntu() {
local SOURCE="$1"
local TARGET="$2"
local VERSION="$3"
local CONTAINER="tom-ubuntu"
# ubuntu packages
for name in "$SOURCE"/deployment/ubuntu/*.Dockerfile; do
(
cd "$(dirname "$name")"
UBUNTU_VERSION="$(basename -s ".Dockerfile" "$name")"
echo "Building deb for Ubuntu ${UBUNTU_VERSION}"
DEB_TARGET="$TARGET/$UBUNTU_VERSION"
mkdir -p "$DEB_TARGET"
docker stop "$CONTAINER" || true
docker build --rm -t "$CONTAINER" -f "$name" .
docker run -d -t -i --rm --name "$CONTAINER" -v "$DEB_TARGET:/dist" "$CONTAINER"
docker exec -e TOM_VERSION "$CONTAINER" bash /root/build-ubuntu-deb.sh
docker stop "$CONTAINER"
mv "$DEB_TARGET"/*.deb "$TARGET/tom-ui_${VERSION}-${UBUNTU_VERSION}.deb"
rm -rf "$DEB_TARGET"
)
done
}
function buildMacOS() {
local SOURCE="$1"
local TARGET="$2"
local VERSION="$3"
echo "Building DMG for macOS Mojave..."
ssh macIntel "mkdir -p dev; cd dev; rm -rf tom-ui; git clone https://github.com/jansorg/tom-ui; cd tom-ui; export TOM_VERSION=$VERSION; bash --login ./deployment/build-mac-dmg.sh" &&
scp macIntel:dev/tom-ui/build/Tom.dmg "$TARGET" && echo "Built Tom.dmg"
ssh macIntel "mkdir -p dev; cd dev; rm -rf tom-ui; git clone https://github.com/jansorg/tom-ui; cd tom-ui; export TOM_VERSION=$VERSION; bash --login ./deployment/build-mac-dmg.sh -DENABLE_REPORTS=OFF" &&
scp macIntel:dev/tom-ui/build/Tom.dmg "$TARGET/Tom_no-reporting.dmg" && echo "Built Tom_no-reporting.dmg"
}
function uploadAssets() {
local VERSION="$1"
local DIR="$2"
echo -e "Uploading files in $DIR..."
gh release create "v$VERSION" --title "Version $VERSION" --generate-notes "$DIR"/*.deb "$DIR"/*.dmg
}