build.sh 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2018-Present Lea Anthony
  3. # SPDX-License-Identifier: MIT
  4. # Fail script on any error
  5. set -euxo pipefail
  6. # Define variables
  7. APP_DIR="${APP_NAME}.AppDir"
  8. # Create AppDir structure
  9. mkdir -p "${APP_DIR}/usr/bin"
  10. cp -r "${APP_BINARY}" "${APP_DIR}/usr/bin/"
  11. cp "${ICON_PATH}" "${APP_DIR}/"
  12. cp "${DESKTOP_FILE}" "${APP_DIR}/"
  13. if [[ $(uname -m) == *x86_64* ]]; then
  14. # Download linuxdeploy and make it executable
  15. wget -q -4 -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
  16. chmod +x linuxdeploy-x86_64.AppImage
  17. # Run linuxdeploy to bundle the application
  18. ./linuxdeploy-x86_64.AppImage --appdir "${APP_DIR}" --output appimage
  19. else
  20. # Download linuxdeploy and make it executable (arm64)
  21. wget -q -4 -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-aarch64.AppImage
  22. chmod +x linuxdeploy-aarch64.AppImage
  23. # Run linuxdeploy to bundle the application (arm64)
  24. ./linuxdeploy-aarch64.AppImage --appdir "${APP_DIR}" --output appimage
  25. fi
  26. # Rename the generated AppImage
  27. mv "${APP_NAME}*.AppImage" "${APP_NAME}.AppImage"