Skip to content

Commit

Permalink
Embed update info into appimage
Browse files Browse the repository at this point in the history
  • Loading branch information
wez committed May 5, 2020
1 parent 90de55f commit 3d7fc38
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@
/esctest.log
/AppDir
/WezTerm*.AppImage
/WezTerm*.AppImage.zsync
/wezterm*-src.tar.gz
27 changes: 18 additions & 9 deletions ci/appimage.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
3 changes: 2 additions & 1 deletion ci/generate-workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand All @@ -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):
Expand Down

0 comments on commit 3d7fc38

Please sign in to comment.