File tree Expand file tree Collapse file tree 10 files changed +77
-20
lines changed
Applications/NexaCLI.app/Contents Expand file tree Collapse file tree 10 files changed +77
-20
lines changed Original file line number Diff line number Diff line change 11# Build and binary files
22build /
3+ artifacts /
34* .exe
45* .exe~
56* .dll
Original file line number Diff line number Diff line change 11BRIDGE_VERSION ?= v1.0.6-rc1
22
3+ VERSION ?= $(shell git rev-parse --short HEAD)
34ifeq ($(OS ) , Windows_NT)
45 OS := windows
56 ARCH ?= x86_64
2526 UNZIP := unzip -q
2627endif
2728
28- .PHONY : build link xcopy download clean
29+ .PHONY : build link xcopy download clean package
2930
3031build :
3132 go build -o ./build/nexa$(EXE ) ./cmd/nexa-launcher
@@ -55,5 +56,17 @@ download: clean
5556 https://nexa-model-hub-bucket.s3.us-west-1.amazonaws.com/public/nexasdk/$(BRIDGE_VERSION ) /$(OS ) _$(ARCH ) /nexasdk-bridge.zip
5657 cd build && $(UNZIP ) nexasdk-bridge.zip && $(RM_FILE ) nexasdk-bridge.zip
5758
59+ package : build
60+ -$(RM_DIR ) artifacts
61+ @echo " ====> Creating installer package for $( OS) _$( ARCH) "
62+ @if [ " $( OS) " = " windows" ]; then \
63+ bash release/package_windows.sh $(VERSION ) ; \
64+ elif [ " $( OS) " = " macos" ]; then \
65+ release/package_darwin.sh $(VERSION ) $(ARCH ) ; \
66+ elif [ " $( OS) " = " linux" ]; then \
67+ bash release/package_linux.sh $(VERSION ) ; \
68+ fi
69+
5870clean :
5971 -$(RM_DIR ) build
72+ -$(RM_DIR ) artifacts
File renamed without changes.
Original file line number Diff line number Diff line change 1+ #! /usr/bin/osascript
2+ tell application " Terminal"
3+ activate
4+ do script " nexa"
5+ end tell
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change 99
1010echo " --- Preparing file structure for version ${VERSION} ---"
1111
12- APP_BASE=" staging/Applications"
13- APP_NAME=" NexaCLI"
14- APP_PATH=" ${APP_BASE} /${APP_NAME} .app"
12+ APP_PATH=" staging/Applications/NexaCLI.app"
1513
1614echo " Creating directories..."
1715mkdir -p " ${APP_PATH} /Contents/MacOS"
@@ -20,22 +18,8 @@ mkdir -p "${APP_PATH}/Contents/Resources"
2018echo " Moving build artifacts..."
2119mv artifacts/* " ${APP_PATH} /Contents/Resources/"
2220
23- echo " Copying support files..."
24- cp runner/release/darwin/scripts/uninstall.sh " ${APP_PATH} /Contents/Resources/"
25- chmod +x " ${APP_PATH} /Contents/Resources/uninstall.sh"
26- cp runner/release/darwin/nexa-icon.icns " ${APP_PATH} /Contents/Resources/"
27-
28- echo " Creating Info.plist..."
29- sed " s/\$ {VERSION}/${VERSION} /g" runner/release/darwin/Info.plist > " ${APP_PATH} /Contents/Info.plist"
30-
31- echo " Creating launcher script..."
32- cat << EOF > "${APP_PATH} /Contents/MacOS/launcher"
33- #!/usr/bin/osascript
34- tell application "Terminal"
35- activate
36- do script "nexa"
37- end tell
38- EOF
21+
22+
3923
4024echo " Setting permissions..."
4125chmod +x " ${APP_PATH} /Contents/MacOS/launcher"
File renamed without changes.
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ set -e
4+
5+ TARGET_DIR=" artifacts"
6+ TARGET_APP_PATH=" ${TARGET_DIR} /Applications/NexaCLI.app"
7+ TARGET_RESOURCES_PATH=" ${TARGET_APP_PATH} /Contents/Resources"
8+
9+ main () {
10+ local VERSION=$1
11+ local ARCH=$2
12+ if [ -z " $VERSION " ]; then
13+ echo " Usage: $0 <version> <arch>"
14+ exit 1
15+ fi
16+
17+ # copy files to target directory
18+ mkdir -p ${TARGET_DIR}
19+ cp -r release/darwin/Applications ${TARGET_DIR}
20+ cp -r build/* ${TARGET_RESOURCES_PATH}
21+
22+ # replace version in Info.plist
23+ sed -i ' ' " s/\$ {VERSION}/$VERSION /g" " ${TARGET_APP_PATH} /Contents/Info.plist"
24+
25+ # fix dylib Linkages (RPATH)
26+ install_name_tool -add_rpath " @loader_path" " ${TARGET_RESOURCES_PATH} /nexa-cli"
27+
28+ # setting permissions
29+ chmod +x " ${TARGET_APP_PATH} /Contents/MacOS/launcher"
30+ chmod +x " ${TAEGET_RESOURCES_PATH/ nexa"
31+ chmod +x " ${TAEGET_RESOURCES_PATH/ nexa-cli"
32+ if [ -d " ${TAEGET_RESOURCES_PATH/ nexa_mlx/ python_runtime/ bin" ]; then
33+ chmod -R +x " ${TAEGET_RESOURCES_PATH/ nexa_mlx/ python_runtime/ bin"
34+ fi
35+
36+ # Import Code Signing Certificates
37+
38+ # Sign binaries and libraries
39+
40+ # Build PKG
41+ pkgbuild --root " ${TARGET_DIR} " \
42+ --scripts " release/ darwin/ scripts" \
43+ --identifier " com.nexaai.nexa-sdk" \
44+ --version " ${VERSION} " \
45+ --install-location / \
46+ " ${TARGET_DIR} / nexa-cli_macos_${ARCH} -unsigned.pkg"
47+
48+ # Productsign PKG
49+
50+ # Notarize & Staple PKG
51+
52+ }
53+
54+ main " $@ "
You can’t perform that action at this time.
0 commit comments