Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modify AppImage build script to work with an EL8 base #7782

Merged
merged 7 commits into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,28 +148,6 @@ trigger:

---
kind: pipeline
name: AppImage

steps:
- name: build
image: ghcr.io/nextcloud/continuous-integration-client-appimage-qt6:client-appimage-6.7.3-1
environment:
CI_UPLOAD_GIT_TOKEN:
from_secret: CI_UPLOAD_GIT_TOKEN
CI_UPLOAD_GIT_USERNAME:
from_secret: CI_UPLOAD_GIT_USERNAME
commands:
- BUILDNR=$DRONE_BUILD_NUMBER VERSION_SUFFIX=$DRONE_PULL_REQUEST BUILD_UPDATER=ON DESKTOP_CLIENT_ROOT=$DRONE_WORKSPACE EXECUTABLE_NAME=nextcloud QT_BASE_DIR=/opt/qt6.7.3 OPENSSL_ROOT_DIR=/usr/local/lib64 /bin/bash -c "./admin/linux/build-appimage.sh"
- BUILDNR=$DRONE_BUILD_NUMBER VERSION_SUFFIX=$DRONE_PULL_REQUEST DESKTOP_CLIENT_ROOT=$DRONE_WORKSPACE /bin/bash -c "./admin/linux/upload-appimage.sh" || echo "Upload failed, however this is an optional step."
trigger:
branch:
- master
- stable-*
event:
- pull_request
- push
---
kind: pipeline
name: Debian

steps:
Expand All @@ -190,6 +168,6 @@ trigger:
- push
---
kind: signature
hmac: 94f252484ad174569755f01f37a1776a74085e73b39e36defd4c9e5e13b48456
hmac: 20a4eb306b48377c21036520acc47ad69253eca7fbf607e95153cfcd2274db37

...
63 changes: 60 additions & 3 deletions .github/workflows/linux-appimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,69 @@ jobs:
build:
name: Linux Appimage Package
runs-on: ubuntu-latest
container: ghcr.io/nextcloud/continuous-integration-client-appimage-qt6:client-appimage-6.8.0-1
container: ghcr.io/nextcloud/continuous-integration-client-appimage-qt6:client-appimage-el8-6.8.1-2
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Configure, compile and package
id: build-appimage
env:
PR_ID: ${{ github.event.number }}
run: |
BUILDNR=${GITHUB_RUN_ID} VERSION_SUFFIX=${GITHUB_HEAD_REF} BUILD_UPDATER=ON DESKTOP_CLIENT_ROOT=`pwd` EXECUTABLE_NAME=nextcloud QT_BASE_DIR=/opt/qt6.8.0 OPENSSL_ROOT_DIR=/usr/local/lib64 /bin/bash -c "./admin/linux/build-appimage.sh"
BUILDNR=${GITHUB_RUN_ID} VERSION_SUFFIX=${GITHUB_HEAD_REF} DESKTOP_CLIENT_ROOT=`pwd` /bin/bash -c "./admin/linux/upload-appimage.sh" || echo "Upload failed, however this is an optional step."
BUILDNR=${GITHUB_RUN_ID} VERSION_SUFFIX=${GITHUB_HEAD_REF} BUILD_UPDATER=ON DESKTOP_CLIENT_ROOT=`pwd` EXECUTABLE_NAME=nextcloud QT_BASE_DIR=/opt/qt OPENSSL_ROOT_DIR=/usr/local/lib64 /bin/bash -c "./admin/linux/build-appimage.sh"

- name: Upload AppImage artifact
id: upload-appimage
uses: actions/upload-artifact@v4
with:
name: nextcloud-appimage-pr-${{ github.event.number }}
path: ${{ steps.build-appimage.outputs.APPIMAGE_NAME }}
overwrite: true
compression-level: 0 # squashfs is already compressed

- name: Comment AppImage
uses: actions/github-script@v7
with:
script: |
const comment_identifier_string = "<!-- automated comment for an appimage build -->";

const comment_body = `
${comment_identifier_string}

Artifact containing the AppImage: [nextcloud-appimage-pr-${{ github.event.number }}.zip](${{ steps.upload-appimage.outputs.artifact-url }})

SHA256 checksum: \`${{ steps.upload-appimage.outputs.artifact-digest }}\`

To test this change/fix you can download the above artifact file, unzip it, and run it.

Please make sure to quit your existing Nextcloud app and backup your data.
`;

console.log("fetching old comments")
const comments = await github.rest.issues.listComments({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
});

comments
.data
.filter(comment => comment.body?.includes(comment_identifier_string))
.forEach(comment => {
console.log(`deleting previous AppImage comment with ID ${comment.id}`)
github.rest.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: comment.id,
})
});

console.log("creating new comment")
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: comment_body,
});
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ AppPackages/

# Others
sql/
*.Cache
*.[Cc]ache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
Expand Down Expand Up @@ -191,3 +191,4 @@ convert.exe
*-w10startmenu.png
*state-*.png
theme.qrc
*.AppImage
30 changes: 21 additions & 9 deletions admin/linux/build-appimage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ export OPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR:-/usr/lib/x86_64-linux-gnu}
export VERSION_SUFFIX=${VERSION_SUFFIX:stable}

# Set defaults
export SUFFIX=${DRONE_PULL_REQUEST:=master}
export SUFFIX=${PR_ID:=${DRONE_PULL_REQUEST:=master}}
nilsding marked this conversation as resolved.
Show resolved Hide resolved
if [ $SUFFIX != "master" ]; then
SUFFIX="PR-$SUFFIX"
fi
if [ "$BUILD_UPDATER" != "OFF" ]; then
BUILD_UPDATER=ON
fi

# Ensure we use gcc-11 on RHEL-like systems
if [ -e "/opt/rh/gcc-toolset-11/enable" ]; then
source /opt/rh/gcc-toolset-11/enable
fi

mkdir /app

# Build client
Expand All @@ -42,11 +47,11 @@ DESTDIR=/app cmake --install .
# Move stuff around
cd /app

mv usr/lib/x86_64-linux-gnu/* usr/lib/
[ -d usr/lib/x86_64-linux-gnu ] && mv usr/lib/x86_64-linux-gnu/* usr/lib/

mkdir usr/plugins
mv usr/lib/*sync_vfs_suffix.so usr/plugins
mv usr/lib/*sync_vfs_xattr.so usr/plugins
mv usr/lib64/*sync_vfs_suffix.so usr/plugins || mv usr/lib/*sync_vfs_suffix.so usr/plugins
mv usr/lib64/*sync_vfs_xattr.so usr/plugins || mv usr/lib/*sync_vfs_xattr.so usr/plugins

rm -rf usr/lib/cmake
rm -rf usr/include
Expand All @@ -73,7 +78,7 @@ chmod a+x ${APPIMAGE_NAME}
rm ./${APPIMAGE_NAME}
cp -r ./squashfs-root ./linuxdeploy-squashfs-root

export LD_LIBRARY_PATH=/app/usr/lib:${QT_BASE_DIR}/lib:/usr/local/lib/x86_64-linux-gnu:/usr/local/lib:/usr/local/lib64
export LD_LIBRARY_PATH=/app/usr/lib64:/app/usr/lib:${QT_BASE_DIR}/lib:/usr/local/lib/x86_64-linux-gnu:/usr/local/lib:/usr/local/lib64
./linuxdeploy-squashfs-root/AppRun --desktop-file=${DESKTOP_FILE} --icon-file=usr/share/icons/hicolor/512x512/apps/Nextcloud.png --executable=usr/bin/${EXECUTABLE_NAME} --appdir=AppDir

# Use linuxdeploy-plugin-qt to deploy qt dependencies
Expand Down Expand Up @@ -106,10 +111,17 @@ rm ./squashfs-root/usr/lib/libglib-2.0.so.0
LD_LIBRARY_PATH="$PWD/appimagetool-squashfs-root/usr/lib":$LD_LIBRARY_PATH PATH="$PWD/appimagetool-squashfs-root/usr/bin":$PATH appimagetool -n ./squashfs-root "${APPIMAGE}"

#move AppImage
if [ ! -z "$DRONE_COMMIT" ]
export COMMIT=${GITHUB_SHA:=${DRONE_COMMIT}}
nilsding marked this conversation as resolved.
Show resolved Hide resolved
if [ ! -z "$COMMIT" ]
then
mv *.AppImage ${EXECUTABLE_NAME}-${SUFFIX}-${DRONE_COMMIT}-x86_64.AppImage
export APPIMAGE_NAME="${EXECUTABLE_NAME}-${SUFFIX}-${COMMIT}-x86_64.AppImage"
else
mv *.AppImage ${EXECUTABLE_NAME}-${SUFFIX}-x86_64.AppImage
export APPIMAGE_NAME="${EXECUTABLE_NAME}-${SUFFIX}-x86_64.AppImage"
fi
mv *.AppImage ${DESKTOP_CLIENT_ROOT}/$APPIMAGE_NAME

# tell GitHub Actions the name of our appimage
if [ ! -z "$GITHUB_OUTPUT" ]; then
echo "AppImage name: ${APPIMAGE_NAME}"
echo "APPIMAGE_NAME=${APPIMAGE_NAME}" >> "$GITHUB_OUTPUT"
fi
mv *.AppImage ${DESKTOP_CLIENT_ROOT}/
154 changes: 0 additions & 154 deletions admin/linux/upload-appimage.sh

This file was deleted.

2 changes: 1 addition & 1 deletion craftmaster.ini
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ SIGN_PACKAGE = False

[Custom_Variables_for_Brander]
qtPath = /opt/qt
dockerImage = ghcr.io/nextcloud/continuous-integration-client-appimage-qt6:client-appimage-6.8.1-1
dockerImage = ghcr.io/nextcloud/continuous-integration-client-appimage-qt6:client-appimage-el8-6.8.1-2
Loading