-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.sh
More file actions
executable file
·54 lines (46 loc) · 1.65 KB
/
Copy pathpackage.sh
File metadata and controls
executable file
·54 lines (46 loc) · 1.65 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
52
53
54
#!/usr/bin/env bash
# Copyright 2026 OpenC3, Inc.
# All Rights Reserved.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See LICENSE.md for more details.
#
# This file may also be used under the terms of a commercial license
# if purchased from OpenC3, Inc.
#
# Build a NATIVE installer for the current host OS and architecture.
#
# Native installers must be produced on their own platform (a .dmg needs macOS,
# an .msi needs Windows, .deb/AppImage need Linux), so this script
# packages for whatever machine it runs on:
#
# macOS -> .app + .dmg (dist/installers/)
# Linux -> .deb, AppImage (run inside a Linux container for Linux)
# Windows -> use package.ps1
#
# The output architecture matches the host (e.g. arm64 on Apple Silicon).
set -euo pipefail
cd "$(dirname "$0")"
OS="$(uname -s)"
ARCH="$(uname -m)"
echo "Packaging OpenC3 COSMOS for ${OS} ${ARCH}"
# 1. Build the optimized release binary (GUI enabled).
echo "Building release binary..."
cargo build --release
# 2. Ensure the packaging tool is available.
if ! cargo packager --version >/dev/null 2>&1; then
echo "Installing cargo-packager..."
cargo install cargo-packager --locked
fi
# 3. Produce the host-native installer(s).
OUT="dist/installers"
mkdir -p "$OUT"
echo "Building installer(s) into ${OUT}/ ..."
cargo packager --release --out-dir "$OUT"
echo
echo "Done. Installers:"
find "$OUT" -maxdepth 1 -type f \
\( -name '*.dmg' -o -name '*.deb' -o -name '*.AppImage' \
-o -name '*.msi' -o -name '*.exe' \) -print 2>/dev/null || true