From 891f0f19f345d7b79e8775dd06c433756468d7a0 Mon Sep 17 00:00:00 2001 From: Nguyen Thai Date: Tue, 26 Sep 2023 15:05:15 +0700 Subject: [PATCH] Use new appimage packaging for Linux builds Fixed library name and removed unneeded packages Use azure mirror, skip tests Because GH Actions docker is flaky Use png file for icon Added additional libraries Correct the distro codename --- .github/workflows/release.yaml | 2 +- appimage/AppImageBuilder.yml | 65 ++++++++++++++++++++++++++++++++++ scripts/build-linux-debug.sh | 8 ++--- scripts/build-linux.sh | 8 ++--- scripts/package-linux-debug.sh | 17 +++++---- scripts/package-linux.sh | 17 +++++---- 6 files changed, 96 insertions(+), 21 deletions(-) create mode 100644 appimage/AppImageBuilder.yml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ddd5d18125..4c9a2d845e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -149,7 +149,7 @@ jobs: run: | case "$RUNNER_OS" in Linux) - cp dist/*/* "twake-$GITHUB_REF_NAME-linux-amd64.AppImage";; + cp dist/* "twake-$GITHUB_REF_NAME-linux-amd64.AppImage";; macOS) cp dist/*/* "twake-$GITHUB_REF_NAME-macos-amd64.dmg" # Notarize the app diff --git a/appimage/AppImageBuilder.yml b/appimage/AppImageBuilder.yml new file mode 100644 index 0000000000..428219d48d --- /dev/null +++ b/appimage/AppImageBuilder.yml @@ -0,0 +1,65 @@ +# appimage-builder recipe see https://appimage-builder.readthedocs.io for details +script: + - rm -rf AppDir | true + - cp -r ./build/linux/x64/{{BUILD_TYPE}}/bundle AppDir + - mkdir -p AppDir/usr/share/icons/hicolor/64x64/apps/ + - cp ./assets/logo.svg AppDir/usr/share/icons/hicolor/64x64/apps/twake.svg +version: 1 +AppDir: + path: ./AppDir + app_info: + id: com.linagora.linux.twake + name: Twake + icon: twake + version: latest + exec: fluffychat + exec_args: $@ + apt: + arch: + - amd64 + allow_unauthenticated: true + sources: + - sourceline: deb http://azure.archive.ubuntu.com/ubuntu/ {{VERSION_CODENAME}} main restricted universe multiverse + key_url: "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C" + - sourceline: deb http://azure.archive.ubuntu.com/ubuntu/ {{VERSION_CODENAME}}-updates main restricted universe multiverse + key_url: "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C" + - sourceline: deb http://azure.archive.ubuntu.com/ubuntu/ {{VERSION_CODENAME}}-backports main restricted universe multiverse + key_url: "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C" + - sourceline: deb http://azure.archive.ubuntu.com/ubuntu {{VERSION_CODENAME}}-security main restricted universe multiverse + key_url: "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x871920D1991BC93C" + include: + - libgtk-3-0 + - libwayland-cursor0 + - libc6 + - libjsoncpp25 + - libsecret-1-0 + - libmpv1 + - libdrm2 + - libolm3 + 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-bionic: + image: appimagecrafters/tests-env:ubuntu-bionic + command: ./AppRun +AppImage: + arch: x86_64 + update-information: guess diff --git a/scripts/build-linux-debug.sh b/scripts/build-linux-debug.sh index 49163f22bc..cc99e03a77 100755 --- a/scripts/build-linux-debug.sh +++ b/scripts/build-linux-debug.sh @@ -1,9 +1,9 @@ #!/bin/sh -ve echo "Setup Linux dependencies" -sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libjsoncpp-dev locate libfuse-dev libolm-dev - -# Updating database of locate -sudo updatedb +sudo apt-get install -y clang cmake ninja-build \ + pkg-config libgtk-3-dev liblzma-dev \ + libjsoncpp-dev libfuse-dev \ + libolm-dev libmpv-dev libsecret-1-dev flutter config --enable-linux-desktop flutter clean diff --git a/scripts/build-linux.sh b/scripts/build-linux.sh index 9848b3d9da..c3e3839edb 100755 --- a/scripts/build-linux.sh +++ b/scripts/build-linux.sh @@ -1,9 +1,9 @@ #!/bin/sh -ve echo "Setup Linux dependencies" -sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libjsoncpp-dev locate libfuse-dev libolm-dev - -# Updating database of locate -sudo updatedb +sudo apt-get install -y clang cmake ninja-build \ + pkg-config libgtk-3-dev liblzma-dev \ + libjsoncpp-dev libfuse-dev \ + libolm-dev libmpv-dev libsecret-1-dev flutter config --enable-linux-desktop flutter clean diff --git a/scripts/package-linux-debug.sh b/scripts/package-linux-debug.sh index 45bda4415b..813a8959d8 100755 --- a/scripts/package-linux-debug.sh +++ b/scripts/package-linux-debug.sh @@ -1,10 +1,15 @@ #!/bin/bash -# Setup AppImageTool for packaging -echo "Setting up AppImageTool" -curl -o appimagetool -L "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" -chmod +x appimagetool -sudo mv appimagetool /usr/local/bin/ +# Setup appimage-builder for packaging +echo "Setting up appimage-builder" +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 +sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder echo "Packaging." -flutter pub global run flutter_distributor:main.dart package --platform linux --targets appimage --skip-clean --flutter-build-args="profile" +export BUILD_TYPE=profile +# This is to set environment variable from a file +# https://stackoverflow.com/a/45971167/8296391 +set -a; . /etc/os-release; set +a +appimage-builder --recipe appimage/AppImageBuilder.yml --skip-tests +mkdir dist && cp ./*.AppImage dist/ diff --git a/scripts/package-linux.sh b/scripts/package-linux.sh index 3f5df909ee..ee8e04f3f4 100755 --- a/scripts/package-linux.sh +++ b/scripts/package-linux.sh @@ -1,10 +1,15 @@ #!/bin/bash -# Setup AppImageTool for packaging -echo "Setting up AppImageTool" -curl -o appimagetool -L "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" -chmod +x appimagetool -sudo mv appimagetool /usr/local/bin/ +# Setup appimage-builder for packaging +echo "Setting up appimage-builder" +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 +sudo mv appimage-builder-x86_64.AppImage /usr/local/bin/appimage-builder echo "Packaging." -flutter pub global run flutter_distributor:main.dart package --platform linux --targets appimage --skip-clean --flutter-build-args="release" +export BUILD_TYPE=release +# This is to set environment variable from a file +# https://stackoverflow.com/a/45971167/8296391 +set -a; . /etc/os-release; set +a +appimage-builder --recipe appimage/AppImageBuilder.yml --skip-tests +mkdir dist && cp ./*.AppImage dist/