diff --git a/.github/workflows/release_linux.yml b/.github/workflows/release_linux.yml index 0febe058e..73c3184cb 100644 --- a/.github/workflows/release_linux.yml +++ b/.github/workflows/release_linux.yml @@ -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 @@ -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 diff --git a/scripts/appimage/AppRun b/scripts/appimage/AppRun.in similarity index 88% rename from scripts/appimage/AppRun rename to scripts/appimage/AppRun.in index 3bf6b7e1c..58fd94a49 100644 --- a/scripts/appimage/AppRun +++ b/scripts/appimage/AppRun.in @@ -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" diff --git a/scripts/appimage/build.sh b/scripts/appimage/build.sh index 7d6af1458..d75ba7476 100755 --- a/scripts/appimage/build.sh +++ b/scripts/appimage/build.sh @@ -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 @@ -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" \ diff --git a/scripts/appimage/nope-diff.desktop b/scripts/appimage/nope-diff.desktop new file mode 100644 index 000000000..9588bff72 --- /dev/null +++ b/scripts/appimage/nope-diff.desktop @@ -0,0 +1,7 @@ +[Desktop Entry] +Type=Application +Categories=Development;Graphics; +Icon=nope-diff +Name=NopeDiff +Exec=ngl-diff +Terminal=false diff --git a/scripts/appimage/nope-diff.png b/scripts/appimage/nope-diff.png new file mode 100644 index 000000000..396708fb3 Binary files /dev/null and b/scripts/appimage/nope-diff.png differ