feat: support AppImage (#3248)

* feat: add build deb shell script

* feat: update release.yml

* chore: add flatpak readme

* feat: support appimage builder

* feat: support appimage builder

* Update release.yml
This commit is contained in:
Lucas.Xu 2023-08-23 08:46:11 +08:00 committed by GitHub
parent 773b09c2f7
commit affd253e21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 260 additions and 38 deletions

View File

@ -394,7 +394,7 @@ jobs:
if: ${{ matrix.job.target == 'aarch64-unknown-linux-gnu' }}
working-directory: frontend
run: |
sudo apt-get install -qy binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
sudo apt-get install -qy binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libgtk-3-0
- name: Build AppFlowy
working-directory: frontend
@ -402,34 +402,15 @@ jobs:
flutter config --enable-linux-desktop
dart ./scripts/flutter_release_build/build_flowy.dart run . ${{ github.ref_name }}
- name: Archive Assert
- name: Archive Asset
working-directory: ${{ env.LINUX_APP_RELEASE_PATH }}
run: tar -czf ${{ env.LINUX_ZIP_NAME }} *
- name: Configuring Linux Package
- name: Build Linux package (.deb)
working-directory: frontend
run: |
mkdir -p ../${{ env.LINUX_APP_RELEASE_PATH }}/package/opt
mkdir -p ../${{ env.LINUX_APP_RELEASE_PATH }}/package/usr/share/applications
cp -r ./scripts/linux_installer ../${{ env.LINUX_APP_RELEASE_PATH }}/package/DEBIAN
cd ../${{ env.LINUX_APP_RELEASE_PATH }}/package/DEBIAN
grep -rl "\[CHANGE_THIS\]" ./control | xargs sed -i "s/\[CHANGE_THIS\]/${{ github.ref_name }}/"
chmod 0755 {postinst,postrm}
- name: Build Linux package
working-directory: ${{ env.LINUX_APP_RELEASE_PATH }}
run: |
mv AppFlowy package/opt/
cd package
# Update Exec & icon path in desktop entry
grep -rl "\[CHANGE_THIS\]" ./opt/AppFlowy/appflowy.desktop.temp | xargs sed -i "s/\[CHANGE_THIS\]/\/opt/"
# Add desktop entry in package
mv ./opt/AppFlowy/appflowy.desktop.temp ./usr/share/applications/appflowy.desktop
# Build
cd ../ && dpkg-deb --build --root-owner-group -Z xz package ${{ env.LINUX_PACKAGE_NAME }}
sh scripts/linux_distribution/deb/build_deb.sh appflowy_flutter/product/${{ github.ref_name }}/linux/Release ${{ github.ref_name }} ${{ env.LINUX_PACKAGE_NAME }}
- name: Upload Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
@ -441,7 +422,7 @@ jobs:
asset_name: ${{ env.LINUX_ZIP_NAME }}
asset_content_type: application/octet-stream
- name: Upload Asset Install Package
- name: Upload Debian package
id: upload-release-asset-install-package
uses: actions/upload-release-asset@v1
env:

4
.gitignore vendored
View File

@ -37,3 +37,7 @@ pubspec.lock
.fvm/
**/AppFlowy-Collab/
# ignore the deb filegit
frontend/package
frontend/*.deb

View File

@ -1,8 +0,0 @@
[Desktop Entry]
Name=AppFlowy
Comment=An Open Source Alternative to Notion
Icon=[CHANGE_THIS]/AppFlowy/flowy_logo.svg
Exec=[CHANGE_THIS]/AppFlowy/AppFlowy
Categories=Office
Type=Application
Terminal=false

View File

View File

@ -0,0 +1,76 @@
# appimage-builder recipe see https://appimage-builder.readthedocs.io for details
version: 1
script:
- rm -rf AppDir || true
- cp -r appflowy_flutter/build/linux/x64/release/bundle AppDir
# Icon
- mkdir -p AppDir/usr/share/icons/hicolor/scalable/apps
- cp scripts/linux_distribution/packaging/appflowy.svg AppDir/usr/share/icons/hicolor/scalable/apps/
AppDir:
path: ./AppDir
app_info:
id: io.appflowy.AppFlowy
name: AppFlowy
icon: appflowy.svg
version: [CHANGE_THIS]
exec: AppFlowy
exec_args: $@
apt:
arch:
- amd64
allow_unauthenticated: true
sources:
- sourceline: deb http://id.archive.ubuntu.com/ubuntu/ jammy main restricted
- sourceline: deb http://id.archive.ubuntu.com/ubuntu/ jammy-updates main restricted
- sourceline: deb http://id.archive.ubuntu.com/ubuntu/ jammy universe
- sourceline: deb http://id.archive.ubuntu.com/ubuntu/ jammy-updates universe
- sourceline: deb http://id.archive.ubuntu.com/ubuntu/ jammy multiverse
- sourceline: deb http://id.archive.ubuntu.com/ubuntu/ jammy-updates multiverse
- sourceline: deb http://id.archive.ubuntu.com/ubuntu/ jammy-backports main restricted
universe multiverse
- sourceline: deb http://security.ubuntu.com/ubuntu jammy-security main restricted
- sourceline: deb http://security.ubuntu.com/ubuntu jammy-security universe
- sourceline: deb http://security.ubuntu.com/ubuntu jammy-security multiverse
- sourceline: deb https://ppa.launchpadcontent.net/touchegg/stable/ubuntu/ jammy
main
- sourceline: deb https://packagecloud.io/slacktechnologies/slack/debian/ jessie
main
- sourceline: deb [arch=amd64 signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg]
https://cli.github.com/packages stable main
- sourceline: deb [signed-by=/usr/share/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x
jammy main
- sourceline: deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code
stable main
- sourceline: deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable
main
include:
- libc6:amd64
files:
include: []
exclude:
- usr/share/man
- usr/share/doc/*/README.*
- usr/share/doc/*/changelog.*
- usr/share/doc/*/NEWS.*
- usr/share/doc/*/TODO.*
test:
fedora-30:
image: appimagecrafters/tests-env:fedora-30
command: ./AppRun
debian-stable:
image: appimagecrafters/tests-env:debian-stable
command: ./AppRun
archlinux-latest:
image: appimagecrafters/tests-env:archlinux-latest
command: ./AppRun
centos-7:
image: appimagecrafters/tests-env:centos-7
command: ./AppRun
ubuntu-xenial:
image: appimagecrafters/tests-env:ubuntu-xenial
command: ./AppRun
AppImage:
arch: x86_64
update-information: guess

View File

@ -0,0 +1,18 @@
#!/bin/bash
VERSION=$1
# if the appimage-builder not exist, download it
if [ ! -e /usr/local/bin/appimage-builder ]; then
wget -O appimage-builder-x86_64.AppImage https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage
chmod +x appimage-builder-x86_64.AppImage
# install (optional)
sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder
fi
# update version
grep -rl "\[CHANGE_THIS\]" scripts/linux_distribution/appimage/AppImageBuilder.yml | xargs sed -i "s/\[CHANGE_THIS\]/$VERSION/"
appimage-builder --recipe scripts/linux_distribution/appimage/AppImageBuilder.yml

View File

@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
Name=AppFlowy
Icon=/usr/share/icons/hicolor/scalable/apps/appflowy.svg
Exec=env GDK_GL=gles /usr/bin/AppFlowy %U
Categories=Network;Productivity;
Keywords=Notes
DBusActivatable=true
Implements=io.appflowy.AppFlowy;
Terminal=false

View File

@ -0,0 +1,8 @@
Package: AppFlowy
Version: [CHANGE_THIS]
Depends: libkeybinder-3.0-0
Architecture: amd64
Essential: no
Priority: optional
Maintainer: AppFlowy
Description: An Open Source Alternative to Notion

View File

@ -0,0 +1,8 @@
#!/bin/bash
if [ -e /usr/bin/AppFlowy ]; then
echo "Symlink already exists, skipping."
else
echo "Creating Symlink in /usr/bin/appflowy"
ln -s /usr/lib/AppFlowy/AppFlowy /usr/bin/AppFlowy
ln -s /usr/lib/AppFlowy/launcher.sh /usr/bin/AppFlowyLauncher.sh
fi

View File

@ -0,0 +1,5 @@
#!/bin/bash
if [ -e /usr/bin/AppFlowy ]; then
rm /usr/bin/AppFlowy
rm /usr/bin/AppFlowyLauncher.sh
fi

View File

@ -0,0 +1,18 @@
# Build AppFlowy for Debian
## Prerequisites
- dpkg-deb
- make sure you have built the app for Linux which is located in `frontend/appflowy_flutter/production/$VERSION/linux/Release/`
## Build
```bash
cd frontend/
sh scripts/linux_distribution/deb/build_deb.sh [LINUX_PRODUCTION_RELEASE_PATH] [VERSION] [PACKAGE_NAME]
# for example
sh scripts/linux_distribution/deb/build_deb.sh appflowy_flutter/product/0.2.9/linux/Release 0.2.9 AppFlowy_0.2.9.deb
```
The deb file will be located in '[LINUX_PRODUCTION_RELEASE_PATH]/[PACKAGE_NAME]'

View File

@ -0,0 +1,42 @@
#!/bin/bash
LINUX_RELEASE_PRODUCTION=$1
VERSION=$2
PACKAGE_NAME=$3
# Define package folders
PACKAGE=$LINUX_RELEASE_PRODUCTION/package
LIB=$PACKAGE/usr/lib
APPLICATIONS=$PACKAGE/usr/share/applications
DBUS_SERVICES=$PACKAGE/usr/share/dbus-1/services
ICONS=$PACKAGE/usr/share/icons/hicolor/scalable/apps
METAINFO=$PACKAGE/usr/share/metainfo
DEBIAN=$PACKAGE/DEBIAN
# Create package folder
mkdir -p $LIB
mkdir -p $APPLICATIONS
mkdir -p $DBUS_SERVICES
mkdir -p $ICONS
mkdir -p $METAINFO
mkdir -p $DEBIAN
# Configure the package
cp -R ./scripts/linux_distribution/deb/DEBIAN $PACKAGE
chmod 0755 $DEBIAN/postinst
chmod 0755 $DEBIAN/postrm
grep -rl "\[CHANGE_THIS\]" $DEBIAN/control | xargs sed -i "s/\[CHANGE_THIS\]/$VERSION/"
cp -fR $LINUX_RELEASE_PRODUCTION/AppFlowy $LIB
cp ./scripts/linux_distribution/packaging/launcher.sh $LIB/AppFlowy
chmod +x $LIB/AppFlowy/launcher.sh
cp ./scripts/linux_distribution/deb/AppFlowy.desktop $APPLICATIONS
cp ./scripts/linux_distribution/packaging/io.appflowy.AppFlowy.launcher.desktop $APPLICATIONS
cp ./scripts/linux_distribution/packaging/io.appflowy.AppFlowy.metainfo.xml $METAINFO
cp ./scripts/linux_distribution/packaging/io.appflowy.AppFlowy.service $DBUS_SERVICES
cp ./scripts/linux_distribution/packaging/appflowy.svg $ICONS
# Build the package
dpkg-deb --build --root-owner-group -Z xz $PACKAGE $LINUX_RELEASE_PRODUCTION/$PACKAGE_NAME

View File

@ -0,0 +1 @@
Please refer to https://github.com/flathub/io.appflowy.AppFlowy repo.

View File

@ -0,0 +1,11 @@
<svg width="41" height="40" viewBox="0 0 41 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M39.9564 24.0195C38.8098 30.1683 33.7828 35.5321 28.0061 38.5411C27.3005 38.9336 26.4627 39.1516 25.6689 39.1952H37.9279C39.1185 39.1952 39.9564 38.323 39.9564 37.2328V24.0195Z" fill="#F7931E"/>
<path d="M15.4381 12.1576C15.2617 12.2884 15.0853 12.4192 14.9089 12.55C11.9103 14.6432 2.82634 21.3589 0.753788 18.4371C-1.27467 15.6026 0.886079 7.57868 6.08952 3.69755C6.17771 3.61033 6.31 3.56672 6.3982 3.4795C12.0867 -0.48885 16.32 0.078058 18.3926 2.95621C20.3328 5.65992 18.1721 9.93353 15.4381 12.1576Z" fill="#8427E0"/>
<path d="M33.8715 36.098C33.7833 36.1852 33.6951 36.2288 33.5628 36.316C27.8743 40.2844 23.641 39.7175 21.5684 36.8393C19.6282 34.1356 21.7889 29.862 24.5229 27.638C24.6993 27.5072 24.8757 27.3763 25.0521 27.2455C28.0507 25.1959 37.1347 18.4366 39.1631 21.3584C41.2357 24.1929 39.119 32.2169 33.8715 36.098Z" fill="#FFBD00"/>
<path d="M17.9954 38.8459C15.085 40.8955 6.70658 38.6715 2.87014 33.264C2.78195 33.1768 2.69376 33.046 2.64966 32.9588C-1.09858 27.5078 -0.481224 23.4086 2.38508 21.4462C5.20728 19.4838 9.61698 21.7515 11.8218 24.586C11.91 24.7168 11.9982 24.804 12.0864 24.9349C14.159 27.8566 20.9499 36.8399 17.9954 38.8459Z" fill="#E3006D"/>
<path d="M15.4385 12.1576C11.3816 13.9455 2.73857 17.6086 1.45976 14.6432C0.357338 12.1576 2.3858 7.09899 6.08994 3.69755C6.17814 3.61033 6.31043 3.56672 6.39862 3.4795C12.0871 -0.48885 16.3204 0.078058 18.393 2.95621C20.3333 5.65992 18.1725 9.93353 15.4385 12.1576Z" fill="#9327FF"/>
<path d="M37.6624 18.3955C34.8402 20.3579 30.4305 18.0903 28.2257 15.2557C28.1375 15.1249 28.0493 15.0377 27.9611 14.9069C25.8444 11.9415 19.0535 2.95819 21.9639 0.952211C24.8743 -1.09738 33.2968 1.12664 37.1333 6.53407C37.2215 6.6649 37.3096 6.75211 37.3978 6.88294C41.102 12.334 40.5287 16.3895 37.6624 18.3955Z" fill="#00B5FF"/>
<path d="M37.6628 18.3934C34.8406 20.3557 30.4309 18.0881 28.2261 15.2536C26.4181 11.1108 22.9344 2.95603 25.8448 1.73499C28.4906 0.601179 33.9587 2.86881 37.4423 6.88077C41.1024 12.3318 40.5291 16.3874 37.6628 18.3934Z" fill="#00C8FF"/>
<path d="M33.8715 36.0986C33.7833 36.1858 33.6951 36.2294 33.5628 36.3166C27.8743 40.285 23.641 39.7181 21.5684 36.8399C19.6282 34.1362 21.7889 29.8626 24.5229 27.6386C28.5799 25.8506 37.2229 22.1875 38.5017 25.1529C39.6482 27.6386 37.6197 32.6971 33.8715 36.0986Z" fill="#FFCE00"/>
<path d="M14.2031 38.061C11.5572 39.1948 6.08922 36.9708 2.64966 32.9588C-1.09858 27.5078 -0.481224 23.4086 2.38508 21.4462C5.20728 19.4838 9.61698 21.7515 11.8218 24.586C13.6298 28.6852 17.1135 36.8399 14.2031 38.061Z" fill="#FB006D"/>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,6 @@
[Desktop Entry]
Type=Application
Name=AppFlowy Launcher
Exec=AppFlowyLauncher.sh %u
MimeType=x-scheme-handler/appflowy-flutter;
NoDisplay=true

View File

@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>io.appflowy.AppFlowy</id>
<name>AppFlowy</name>
<summary>Open Source Notion Alternative</summary>
<metadata_license>CC-BY-4.0</metadata_license>
<project_license>AGPL-3.0-only</project_license>
<description>
<p>
# Built for teams that need more control and flexibility ## 100% data control You can host AppFlowy wherever you want; no vendor lock-in.
</p>
<p>
## Unlimited customizations Design and modify AppFlowy your way with an open core codebase.
</p>
<p>
## One codebase supporting multiple platforms AppFlowy is built with Flutter and Rust. What does this mean? Faster development, better native experience, and more reliable performance.
</p>
<p>
# Built for individuals who care about data security and mobile experience ## 100% control of your data Download and install AppFlowy on your local machine. You own and control your personal data.
</p>
<p>
## Extensively extensible For those with no coding experience, AppFlowy enables you to create apps that suit your needs. It&apos;s built on a community-driven toolbox, including templates, plugins, themes, and more.
</p>
<p>
## Truly native experience Faster, more stable with support for offline mode. It&apos;s also better integrated with different devices. Moreover, AppFlowy enables users to access features and possibilities not available on the web.
</p>
</description>
<launchable type="desktop-id">io.appflowy.AppFlowy.desktop</launchable>
<screenshots>
<screenshot type="default">
<image>https://github.com/AppFlowy-IO/appflowy/raw/main/doc/imgs/welcome.png</image>
</screenshot>
</screenshots>
</component>

View File

@ -0,0 +1,3 @@
[D-BUS Service]
Name=io.appflowy.AppFlowy
Exec=AppFlowy

View File

@ -0,0 +1,4 @@
#!/bin/bash
gdbus call --session --dest io.appflowy.AppFlowy \
--object-path /io/appflowy/AppFlowy/Object \
--method io.appflowy.AppFlowy.Open "['$1']" {}

View File

@ -120,9 +120,6 @@ script = [
product=${PRODUCT_NAME}
cp -R ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/build/${TARGET_OS}/${LINUX_ARCH}/${BUILD_FLAG}/bundle \
${output_path}/${product}
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/linux/appflowy.desktop.temp ${output_path}/${product}
cp ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/assets/images/flowy_logo.svg ${output_path}/${product}
""",
]
script_runner = "@shell"
@ -164,8 +161,8 @@ linux_alias = "create-release-archive-linux"
[tasks.create-release-archive-linux]
script = [
"cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/product/${APP_VERSION}/${TARGET_OS}/Release",
"tar -czf ${PRODUCT_NAME}-${TARGET_OS}-x86.tar.gz *",
# "cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/appflowy_flutter/product/${APP_VERSION}/${TARGET_OS}/Release",
# "tar -czf ${PRODUCT_NAME}-${TARGET_OS}-x86.tar.gz *",
]
[tasks.create-release-archive-windows]