mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 02:39:30 +08:00
36 lines
1.1 KiB
Bash
36 lines
1.1 KiB
Bash
#!/usr/bin/env bash
|
|
# Copyright (c) 2018-Present Lea Anthony
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
# Fail script on any error
|
|
set -euxo pipefail
|
|
|
|
# Define variables
|
|
APP_DIR="${APP_NAME}.AppDir"
|
|
|
|
# Create AppDir structure
|
|
mkdir -p "${APP_DIR}/usr/bin"
|
|
cp -r "${APP_BINARY}" "${APP_DIR}/usr/bin/"
|
|
cp "${ICON_PATH}" "${APP_DIR}/"
|
|
cp "${DESKTOP_FILE}" "${APP_DIR}/"
|
|
|
|
if [[ $(uname -m) == *x86_64* ]]; then
|
|
# Download linuxdeploy and make it executable
|
|
wget -q -4 -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
|
chmod +x linuxdeploy-x86_64.AppImage
|
|
|
|
# Run linuxdeploy to bundle the application
|
|
./linuxdeploy-x86_64.AppImage --appdir "${APP_DIR}" --output appimage
|
|
else
|
|
# Download linuxdeploy and make it executable (arm64)
|
|
wget -q -4 -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-aarch64.AppImage
|
|
chmod +x linuxdeploy-aarch64.AppImage
|
|
|
|
# Run linuxdeploy to bundle the application (arm64)
|
|
./linuxdeploy-aarch64.AppImage --appdir "${APP_DIR}" --output appimage
|
|
fi
|
|
|
|
# Rename the generated AppImage
|
|
mv "${APP_NAME}*.AppImage" "${APP_NAME}.AppImage"
|
|
|