From 3d7fc38bb6eb884e665b8e0eb13dec22e743d3e7 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Mon, 4 May 2020 23:38:50 -0700 Subject: [PATCH] Embed update info into appimage --- .gitignore | 1 + ci/appimage.sh | 27 ++++++++++++++++++--------- ci/generate-workflows.py | 3 ++- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index e1163c322db..b0fcfb433b2 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ /esctest.log /AppDir /WezTerm*.AppImage +/WezTerm*.AppImage.zsync /wezterm*-src.tar.gz diff --git a/ci/appimage.sh b/ci/appimage.sh index 847212acefa..537bafae839 100755 --- a/ci/appimage.sh +++ b/ci/appimage.sh @@ -1,6 +1,6 @@ #!/bin/bash -rm -rf AppDir *.AppImage +rm -rf AppDir *.AppImage *.zsync mkdir AppDir install -Dsm755 -t AppDir/usr/bin target/release/wezterm @@ -13,18 +13,27 @@ install -Dm644 assets/wezterm.appdata.xml AppDir/usr/share/metainfo/org.wezfurlo TAG_NAME=${TAG_NAME:-$(git describe --tags)} TAG_NAME=${TAG_NAME:-$(date +'%Y%m%d-%H%M%S')-$(git log --format=%h -1)} +distro=$(lsb_release -is) +distver=$(lsb_release -rs) + +# Embed appropriate update info +# https://github.com/AppImage/AppImageSpec/blob/master/draft.md#github-releases +if [[ "$BUILD_REASON" == "Schedule" ]] ; then + UPDATE="gh-releases-zsync|wez|wezterm|nightly|WezTerm-*.AppImage.zsync" + OUTPUT=WezTerm-nightly-$distro$distver.AppImage +else + UPDATE="gh-releases-zsync|wez|wezterm|latest|WezTerm-*.AppImage.zsync" + OUTPUT=WezTerm-$TAG_NAME-$distro$distver.AppImage +fi # Munge the path so that it finds our appstreamcli wrapper -PATH="$PWD/ci:$PATH" VERSION="$TAG_NAME" /tmp/linuxdeploy \ +PATH="$PWD/ci:$PATH" \ +VERSION="$TAG_NAME" \ +UPDATE_INFORMATION="$UPDATE" \ +OUTPUT="$OUTPUT" \ + /tmp/linuxdeploy \ --appdir AppDir \ --output appimage \ --desktop-file assets/wezterm.desktop -distro=$(lsb_release -is) -distver=$(lsb_release -rs) -if [[ "$BUILD_REASON" == "Schedule" ]] ; then - mv WezTerm*.AppImage WezTerm-nightly-$distro$distver.AppImage -else - mv WezTerm*.AppImage WezTerm-$TAG_NAME-$distro$distver.AppImage -fi diff --git a/ci/generate-workflows.py b/ci/generate-workflows.py index a312ac4dabf..20fee6baf04 100755 --- a/ci/generate-workflows.py +++ b/ci/generate-workflows.py @@ -264,7 +264,7 @@ def upload_artifact(self): if ("ubuntu" in self.name) or ("debian" in self.name): run += "mv *.deb *.xz pkg_\n" if self.app_image: - run += "mv *.AppImage pkg_\n" + run += "mv *.AppImage *.zsync pkg_\n" return [ RunStep("Move Package for artifact upload", run), @@ -286,6 +286,7 @@ def asset_patterns(self): if self.app_image: patterns.append("*.AppImage") + patterns.append("*.zsync") return patterns def upload_asset_nightly(self):