Should hopefully make things less brittle across different architectures Signed-off-by: Seth Flynn <getchoo@tuta.io>
147 lines
6.1 KiB
YAML
147 lines
6.1 KiB
YAML
name: Package for Linux
|
|
description: Create Linux packages for Prism Launcher
|
|
|
|
inputs:
|
|
version:
|
|
description: Launcher version
|
|
required: true
|
|
build-type:
|
|
description: Type for the build
|
|
required: true
|
|
default: Debug
|
|
artifact-name:
|
|
description: Name of the uploaded artifact
|
|
required: true
|
|
default: Linux
|
|
cmake-preset:
|
|
description: Base CMake preset previously used for the build
|
|
required: true
|
|
default: linux
|
|
qt-version:
|
|
description: Version of Qt to use
|
|
required: true
|
|
gpg-private-key:
|
|
description: Private key for AppImage signing
|
|
required: false
|
|
gpg-private-key-id:
|
|
description: ID for the gpg-private-key, to select the signing key
|
|
required: false
|
|
|
|
runs:
|
|
using: composite
|
|
|
|
steps:
|
|
- name: Setup build variables
|
|
shell: bash
|
|
run: |
|
|
# Fixup architecture naming for AppImages
|
|
dpkg_arch="$(dpkg-architecture -q DEB_HOST_ARCH_CPU)"
|
|
case "$dpkg_arch" in
|
|
"amd64")
|
|
APPIMAGE_ARCH="x86_64"
|
|
;;
|
|
"arm64")
|
|
APPIMAGE_ARCH="aarch64"
|
|
;;
|
|
*)
|
|
echo "# 🚨 The Debian architecture \"$deb_arch\" is not recognized!" >> "$GITHUB_STEP_SUMMARY"
|
|
exit 1
|
|
;;
|
|
esac
|
|
echo "APPIMAGE_ARCH=$APPIMAGE_ARCH" >> "$GITHUB_ENV"
|
|
|
|
# Used for the file paths of libraries
|
|
echo "DEB_HOST_MULTIARCH=$(dpkg-architecture -q DEB_HOST_MULTIARCH)" >> "$GITHUB_ENV"
|
|
|
|
- name: Package AppImage
|
|
shell: bash
|
|
env:
|
|
VERSION: ${{ inputs.version }}
|
|
BUILD_DIR: build
|
|
INSTALL_APPIMAGE_DIR: install-appdir
|
|
|
|
GPG_PRIVATE_KEY: ${{ inputs.gpg-private-key }}
|
|
run: |
|
|
cmake --install ${{ env.BUILD_DIR }} --prefix ${{ env.INSTALL_APPIMAGE_DIR }}/usr
|
|
|
|
mv ${{ env.INSTALL_APPIMAGE_DIR }}/usr/share/metainfo/org.prismlauncher.PrismLauncher.metainfo.xml ${{ env.INSTALL_APPIMAGE_DIR }}/usr/share/metainfo/org.prismlauncher.PrismLauncher.appdata.xml
|
|
export "NO_APPSTREAM=1" # we have to skip appstream checking because appstream on ubuntu 20.04 is outdated
|
|
|
|
export OUTPUT="PrismLauncher-Linux-$APPIMAGE_ARCH.AppImage"
|
|
|
|
chmod +x linuxdeploy-*.AppImage
|
|
|
|
mkdir -p ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib
|
|
mkdir -p ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/iconengines
|
|
|
|
cp -r ${{ runner.workspace }}/Qt/${{ inputs.qt-version }}/gcc_64/plugins/iconengines/* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/plugins/iconengines
|
|
|
|
cp /usr/lib/"$DEB_HOST_MULTIARCH"/libcrypto.so.* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/
|
|
cp /usr/lib/"$DEB_HOST_MULTIARCH"/libssl.so.* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/
|
|
cp /usr/lib/"$DEB_HOST_MULTIARCH"/libOpenGL.so.0* ${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib/
|
|
|
|
LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${{ env.INSTALL_APPIMAGE_DIR }}/usr/lib"
|
|
export LD_LIBRARY_PATH
|
|
|
|
chmod +x AppImageUpdate-"$APPIMAGE_ARCH".AppImage
|
|
cp AppImageUpdate-"$APPIMAGE_ARCH".AppImage ${{ env.INSTALL_APPIMAGE_DIR }}/usr/bin
|
|
|
|
export UPDATE_INFORMATION="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|PrismLauncher-Linux-$APPIMAGE_ARCH.AppImage.zsync"
|
|
|
|
if [ '${{ inputs.gpg-private-key-id }}' != '' ]; then
|
|
export SIGN=1
|
|
export SIGN_KEY=${{ inputs.gpg-private-key-id }}
|
|
mkdir -p ~/.gnupg/
|
|
echo "$GPG_PRIVATE_KEY" > ~/.gnupg/private.key
|
|
gpg --import ~/.gnupg/private.key
|
|
else
|
|
echo ":warning: Skipped code signing for Linux AppImage, as gpg key was not present." >> $GITHUB_STEP_SUMMARY
|
|
fi
|
|
|
|
./linuxdeploy-"$APPIMAGE_ARCH".AppImage --appdir ${{ env.INSTALL_APPIMAGE_DIR }} --output appimage --plugin qt -i ${{ env.INSTALL_APPIMAGE_DIR }}/usr/share/icons/hicolor/scalable/apps/org.prismlauncher.PrismLauncher.svg
|
|
|
|
mv "PrismLauncher-Linux-$APPIMAGE_ARCH.AppImage" "PrismLauncher-Linux-${{ env.VERSION }}-${{ inputs.build-type }}-$APPIMAGE_ARCH.AppImage"
|
|
|
|
- name: Package portable tarball
|
|
shell: bash
|
|
env:
|
|
BUILD_DIR: build
|
|
|
|
CMAKE_PRESET: ${{ inputs.cmake-preset }}
|
|
|
|
INSTALL_PORTABLE_DIR: install-portable
|
|
run: |
|
|
cmake --preset "$CMAKE_PRESET" -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_PORTABLE_DIR }} -DINSTALL_BUNDLE=full
|
|
cmake --install ${{ env.BUILD_DIR }}
|
|
cmake --install ${{ env.BUILD_DIR }} --component portable
|
|
|
|
mkdir ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
|
cp /lib/"$DEB_HOST_MULTIARCH"/libbz2.so.1.0 ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
|
cp /usr/lib/"$DEB_HOST_MULTIARCH"/libgobject-2.0.so.0 ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
|
cp /usr/lib/"$DEB_HOST_MULTIARCH"/libcrypto.so.* ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
|
cp /usr/lib/"$DEB_HOST_MULTIARCH"/libssl.so.* ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
|
cp /usr/lib/"$DEB_HOST_MULTIARCH"/libffi.so.*.* ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
|
mv ${{ env.INSTALL_PORTABLE_DIR }}/bin/*.so* ${{ env.INSTALL_PORTABLE_DIR }}/lib
|
|
|
|
for l in $(find ${{ env.INSTALL_PORTABLE_DIR }} -type f); do l=${l#$(pwd)/}; l=${l#${{ env.INSTALL_PORTABLE_DIR }}/}; l=${l#./}; echo $l; done > ${{ env.INSTALL_PORTABLE_DIR }}/manifest.txt
|
|
cd ${{ env.INSTALL_PORTABLE_DIR }}
|
|
tar -czf ../PrismLauncher-portable.tar.gz *
|
|
|
|
- name: Upload binary tarball
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: PrismLauncher-${{ inputs.artifact-name }}-Qt6-Portable-${{ inputs.version }}-${{ inputs.build-type }}
|
|
path: PrismLauncher-portable.tar.gz
|
|
|
|
- name: Upload AppImage
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: PrismLauncher-${{ runner.os }}-${{ inputs.version }}-${{ inputs.build-type }}-${{ env.APPIMAGE_ARCH }}.AppImage
|
|
path: PrismLauncher-${{ runner.os }}-${{ inputs.version }}-${{ inputs.build-type }}-${{ env.APPIMAGE_ARCH }}.AppImage
|
|
|
|
- name: Upload AppImage Zsync
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: PrismLauncher-${{ runner.os }}-${{ inputs.version }}-${{ inputs.build-type }}-${{ env.APPIMAGE_ARCH }}.AppImage.zsync
|
|
path: PrismLauncher-${{ runner.os }}-${{ env.APPIMAGE_ARCH }}.AppImage.zsync
|