-
Notifications
You must be signed in to change notification settings - Fork 364
CI: Add AppImage #1391
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
Open
Samueru-sama
wants to merge
7
commits into
dunst-project:master
Choose a base branch
from
Samueru-sama:create-appimage
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
CI: Add AppImage #1391
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f29d832
CI: Add AppImage
Samueru-sama 95bef12
sort dependencies
Samueru-sama 21b2fa5
use case statement in `AppRun`
Samueru-sama 451c899
use `$ARCH` and declare it in `AppRun`
Samueru-sama ec2bb7f
fix case statement in `AppRun`
Samueru-sama e1c4cd5
fix `$VERSION` and add it to appimage file name
Samueru-sama c4c6305
use ubuntu-latest to spin alpine container
Samueru-sama File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,3 +111,42 @@ jobs: | |
| runs-on: ubuntu-latest | ||
| container: | ||
| image: ghcr.io/dunst-project/docker-images:misc-doxygen | ||
|
|
||
| appimage: | ||
| runs-on: ubuntu-latest | ||
| container: alpine:latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: build appimage | ||
| if: always() | ||
| run: | | ||
| apk add \ | ||
| build-base \ | ||
| dbus \ | ||
| dbus-dev \ | ||
| desktop-file-utils \ | ||
| git \ | ||
| libnotify-dev \ | ||
| librsvg \ | ||
| libxinerama-dev \ | ||
| libxrandr-dev \ | ||
| libxscrnsaver-dev \ | ||
| pango-dev \ | ||
| patchelf \ | ||
| perl \ | ||
| wayland-dev \ | ||
| wayland-protocols \ | ||
| wget | ||
|
|
||
| chmod +x ./AppImage/make-appimage.sh | ||
| ./AppImage/make-appimage.sh | ||
|
|
||
| mkdir dist | ||
| mv *.AppImage dist/ | ||
|
|
||
| - name: Upload appimage artifact | ||
| uses: actions/[email protected] | ||
| with: | ||
| name: AppImage | ||
| path: 'dist' | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| #!/bin/sh | ||
|
|
||
| # This script is meant to be ran on alpine linux, dependencies: | ||
| # wget build-base patchelf libxscrnsaver-dev libxinerama-dev libxrandr-dev libnotify-dev | ||
| # dbus-dev wayland-dev perl pango-dev wayland-protocols dbus librsvg desktop-file-utils | ||
|
|
||
| set -e | ||
| export ARCH="$(uname -m)" | ||
bebehei marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| export APPIMAGE_EXTRACT_AND_RUN=1 | ||
| APPIMAGETOOL="https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-$ARCH.AppImage" | ||
| export COMPLETIONS=0 | ||
|
|
||
| # BUILD DUNST | ||
| mkdir -p ./AppDir | ||
| make -j$(nproc) PREFIX="$PWD"/AppDir/usr | ||
| make install PREFIX="$PWD"/AppDir/usr | ||
| cd ./AppDir | ||
|
|
||
| # AppRun | ||
| echo "Creating AppRun..." | ||
| cat >> ./AppRun << 'EOF' | ||
| #!/bin/sh | ||
| CURRENTDIR="$(dirname "$(readlink -f "$0")")" | ||
bebehei marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ARCH="$(uname -m)" | ||
| export PATH="$CURRENTDIR/usr/bin:$PATH" | ||
| [ -z "$APPIMAGE" ] && APPIMAGE="$0" | ||
| BIN="${ARGV0#./}" | ||
| unset ARGV0 | ||
|
|
||
| case "${BIN}" in | ||
| dunst|dunstify) | ||
| exec "$CURRENTDIR/ld-musl-${ARCH}.so.1" "$CURRENTDIR/usr/bin/$BIN" "$@" | ||
| ;; | ||
| dunstctl) | ||
| exec "$CURRENTDIR/usr/bin/$BIN" "$@" | ||
| ;; | ||
| ""|*) | ||
| BIN="$1" | ||
| case "${BIN}" in | ||
| dunst|dunstify) | ||
| shift | ||
| exec "$CURRENTDIR/ld-musl-${ARCH}.so.1" "$CURRENTDIR/usr/bin/$BIN" "$@" | ||
| ;; | ||
| dunstctl) | ||
| shift | ||
| exec "$CURRENTDIR/usr/bin/$BIN" "$@" | ||
| ;; | ||
| ""|*) | ||
| echo "AppImage commands:" | ||
| echo " \"$APPIMAGE dunst\" runs dunst" | ||
| echo " \"$APPIMAGE dunstify\" runs dunstify" | ||
| echo " \"$APPIMAGE dunstctl\" runs dunstctl" | ||
| echo "You can also make and run symlinks to the AppImage with the names" | ||
| echo "dunstify and dunstctl to launch them automatically without extra args" | ||
| echo "running dunst..." | ||
| exec "$CURRENTDIR/ld-musl-${ARCH}.so.1" "$CURRENTDIR/usr/bin/dunst" "$@" | ||
| ;; | ||
| esac | ||
| esac | ||
Samueru-sama marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| EOF | ||
| chmod +x ./AppRun | ||
|
|
||
| # Dummy Icon & Desktop | ||
| echo "Placing .desktop and icon..." | ||
| touch ./dunst.png && ln -s ./dunst.png ./.DirIcon # No official icon? | ||
| cat >> ./dunst.desktop << 'EOF' # No official .desktop? | ||
| [Desktop Entry] | ||
| Type=Application | ||
| Name=dunst | ||
| Icon=dunst | ||
| Exec=dunst | ||
| Categories=System | ||
| Hidden=true | ||
| EOF | ||
bebehei marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # DEPLOY ALL LIBS | ||
| echo "Deploying dependencies..." | ||
| mkdir -p ./usr/lib | ||
| ldd ./usr/bin/* | awk -F"[> ]" '{print $4}' | xargs -I {} cp -vf {} ./usr/lib | ||
| if [ -f ./usr/lib/ld-musl-"$ARCH".so.1 ]; then | ||
| mv ./usr/lib/ld-musl-"$ARCH".so.1 ./ | ||
| else | ||
| cp /lib/ld-musl-"$ARCH".so.1 ./ | ||
| fi | ||
| find ./usr/bin -type f -exec patchelf --set-rpath '$ORIGIN/../lib' {} ';' | ||
| find ./usr/lib -type f -exec patchelf --set-rpath '$ORIGIN' {} ';' | ||
| find ./usr/lib ./usr/bin -type f -exec strip -s -R .comment --strip-unneeded {} ';' | ||
|
|
||
| # Do the thing! | ||
| echo "Generating AppImage..." | ||
| export VERSION="$(./AppRun dunst --version | awk 'FNR==1 {print $NF}')" | ||
| cd .. | ||
| wget -q "$APPIMAGETOOL" -O appimagetool | ||
| chmod +x ./appimagetool | ||
| ./appimagetool --comp zstd \ | ||
| --mksquashfs-opt -Xcompression-level --mksquashfs-opt 22 \ | ||
| -n ./AppDir ./dunst-"$VERSION"-"$ARCH".AppImage | ||
| ls | ||
| echo "All Done!" | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.