From 41a555def943fed19cc19867f985b71b94f5c8fd Mon Sep 17 00:00:00 2001 From: Anthony Bilinski Date: Sat, 19 Feb 2022 00:03:11 -0800 Subject: [PATCH] chore(CI): Remove knowledge of build context from AppImage build script * Since nightlies are now published under qTox/qTox, different update info is not needed for the zsync file. * The github action yaml already handles naming files correctly otherwise. --- .github/workflows/build-test-deploy.yaml | 4 +++- appimage/build.sh | 27 +++--------------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build-test-deploy.yaml b/.github/workflows/build-test-deploy.yaml index 44aca22b5..c4532c382 100644 --- a/.github/workflows/build-test-deploy.yaml +++ b/.github/workflows/build-test-deploy.yaml @@ -224,6 +224,8 @@ jobs: if: contains(github.ref, 'refs/tags/v') id: get_version run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3) + # The zync file names MUST match the pattern "qTox-*.x86_64.AppImage.zsync" + # indefinitely for older versions to be able to update https://github.com/AppImage/AppImageSpec/blob/master/draft.md#github-releases - name: Rename appimage for release upload if: contains(github.ref, 'refs/tags/v') run: | @@ -250,7 +252,7 @@ jobs: prerelease: true replacesArtifacts: true token: ${{ secrets.GITHUB_TOKEN }} - artifacts: "qTox-nightly.x86_64.AppImage" + artifacts: "qTox-*.x86_64.AppImage,qTox-*.x86_64.AppImage.zsync" build-flatpak: name: Flatpak runs-on: ubuntu-latest diff --git a/appimage/build.sh b/appimage/build.sh index a4633f8f7..ef14fe0da 100755 --- a/appimage/build.sh +++ b/appimage/build.sh @@ -54,17 +54,8 @@ readonly LOCAL_LIB_DIR="$QTOX_APP_DIR"/local/lib readonly LDQT_BIN="/usr/lib/qt5/bin/linuxdeployqt" # update information to be embeded in AppImage -if [ "cron" == "${TRAVIS_EVENT_TYPE:-}" ] -then - # update information for nightly version - readonly NIGHTLY_REPO_SLUG=$(echo "$CIRP_GITHUB_REPO_SLUG" | tr "/" "|") - readonly UPDATE_INFO="gh-releases-zsync|$NIGHTLY_REPO_SLUG|ci-master-latest|qTox-*-x86_64.AppImage.zsync" -else - # update information for stable version - readonly UPDATE_INFO="gh-releases-zsync|qTox|qTox|latest|qTox-*.x86_64.AppImage.zsync" -fi - -export VERSION=$(git -C "${QTOX_SRC_DIR}" rev-parse --short HEAD) +readonly UPDATE_INFO="gh-releases-zsync|qTox|qTox|latest|qTox-*.x86_64.AppImage.zsync" +export GIT_VERSION=$(git -C "${QTOX_SRC_DIR}" rev-parse --short HEAD) echo $QTOX_APP_DIR cmake "${QTOX_SRC_DIR}" -DDESKTOP_NOTIFICATIONS=ON -DUPDATE_CHECK=ON -DCMAKE_BUILD_TYPE=Release @@ -106,16 +97,4 @@ for lib in "${libs[@]}"; do patchelf --set-rpath '$ORIGIN' "$LOCAL_LIB_DIR/$lib_file_name" done -# this is important, aitool automatically uses the same filename in .zsync meta file. -# if this name does not match with the one we upload, the update always fails. -if [ -n "${TRAVIS_TAG-}" ] -then - VERSION_NAME="${TRAVIS_TAG}" -elif [ -n "${TRAVIS_COMMIT-}" ] -then - VERSION_NAME="${TRAVIS_COMMIT}" -else - VERSION_NAME="${VERSION}" -fi - -appimagetool -u "$UPDATE_INFO" $QTOX_APP_DIR qTox-$VERSION_NAME.x86_64.AppImage +appimagetool -u "$UPDATE_INFO" $QTOX_APP_DIR qTox-${GIT_VERSION}.x86_64.AppImage