Skip to content

Commit

Permalink
release_linux: distribute NopeDiff along with NopeViewer
Browse files Browse the repository at this point in the history
  • Loading branch information
mbouron committed Feb 2, 2024
1 parent 34300ed commit fce3928
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 6 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/release_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ jobs:
permissions:
contents: write
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- tool: nope-viewer
tool_fullname: NopeViewer
- tool: nope-diff
tool_fullname: NopeDiff

steps:
- uses: actions/checkout@v3
Expand All @@ -33,12 +41,12 @@ jobs:
- name: Build
run: |
scripts/appimage/build.sh
scripts/appimage/build.sh ${{ matrix.tool }}
- name: Upload AppImage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
output_file="appimage/NopeViewer-$(cat VERSION)-x86_64.AppImage"
mv appimage/NopeViewer-x86_64.AppImage $output_file
output_file="appimage/${{ matrix.tool_fullname }}-$(cat VERSION)-x86_64.AppImage"
mv appimage/${{ matrix.tool_fullname }}-x86_64.AppImage $output_file
gh release upload v$(cat VERSION) $output_file
2 changes: 1 addition & 1 deletion scripts/appimage/AppRun → scripts/appimage/AppRun.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ here=$(dirname "$self")

platform=x86_64-linux-gnu
python="$here/usr/bin/python3.10"
exe="$here/usr/local/bin/ngl-viewer"
exe="$here/usr/local/bin/@TOOL@"

export PATH="$here/usr/bin:$here/usr/local/bin:$PATH"
export LD_LIBRARY_PATH="$here/lib/$platform:$here/usr/lib/$platform:$here/usr/lib"
Expand Down
21 changes: 19 additions & 2 deletions scripts/appimage/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ if [ ! -f "configure.py" ]; then
exit 1
fi

target=$1
target_exec=
case "$target" in
"nope-diff")
target_exec="ngl-diff"
;;
"nope-viewer")
target_exec="ngl-viewer"
;;
*)
echo "usage: $0 {nope-viewer,nope-diff}"
exit 1
;;
esac

# Check if repository is in a clean state
git diff-index --quiet HEAD
[ -f Makefile ] && exit 1
Expand Down Expand Up @@ -82,12 +97,14 @@ $python -m pip uninstall -y cython
curl -sL https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -o linuxdeploy
chmod +x linuxdeploy

sed "s/@TOOL@/$target_exec/g" "$resources_dir/AppRun.in" > "$resources_dir/AppRun"

LD_LIBRARY_PATH="$appdir/usr/lib/" ./linuxdeploy \
--appdir "$appdir" \
--output appimage \
--custom-apprun "$resources_dir/AppRun" \
--desktop-file "$resources_dir/nope-viewer.desktop" \
--icon-file "$resources_dir/nope-viewer.png" \
--desktop-file "$resources_dir/$target.desktop" \
--icon-file "$resources_dir/$target.png" \
--executable "$python" \
--executable "$appdir/usr/bin/ffmpeg" \
--executable "$appdir/usr/bin/ffprobe" \
Expand Down
7 changes: 7 additions & 0 deletions scripts/appimage/nope-diff.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Desktop Entry]
Type=Application
Categories=Development;Graphics;
Icon=nope-diff
Name=NopeDiff
Exec=ngl-diff
Terminal=false
Binary file added scripts/appimage/nope-diff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit fce3928

Please sign in to comment.