Merge pull request #1 from qurious-pixel/main

merge to build AppImages
This commit is contained in:
pineappleEA 2020-12-30 19:14:52 +01:00 committed by GitHub
commit 29c67c4f40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 187 additions and 0 deletions

12
.github/workflows/AppRun vendored Normal file
View file

@ -0,0 +1,12 @@
#!/bin/bash
mkdir -p $HOME/.local/share/icons/hicolor/scalable/apps && cp $APPDIR/yuzu.svg $HOME/.local/share/icons/hicolor/scalable/apps
GITVER=`wget -qO- https://www.github.com/pineappleEA/pineapple-src/releases/tag/continuous | grep pineappleEA/pineapple-src/commit/ | cut -d '"' -f 2 | cut -d '/' -f 5 | awk '!x[$0]++'`
APPVER=`cat $APPDIR/version.txt`
if [ "$GITVER" = "$APPVER" ]; then
$APPDIR/usr/bin/yuzu
else
$APPDIR/update.sh
fi

71
.github/workflows/appimage.sh vendored Normal file
View file

@ -0,0 +1,71 @@
#!/bin/bash -ex
BUILDBIN=/yuzu/build/bin
BINFILE=yuzu-x86_64.AppImage
LOG_FILE=$HOME/curl.log
BRANCH=`echo ${GITHUB_REF##*/}`
# QT 5.14.2
# source /opt/qt514/bin/qt514-env.sh
QT_BASE_DIR=/opt/qt514
export QTDIR=$QT_BASE_DIR
export PATH=$QT_BASE_DIR/bin:$PATH
export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib:$LD_LIBRARY_PATH
export PKG_CONFIG_PATH=$QT_BASE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
cd /tmp
curl -sLO "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
curl -sLO "https://github.com/$GITHUB_REPOSITORY/raw/$BRANCH/.github/workflows/update.tar.gz"
tar -xzf update.tar.gz
chmod a+x linuxdeployqt*.AppImage
./linuxdeployqt-continuous-x86_64.AppImage --appimage-extract
cd $HOME
mkdir -p squashfs-root/usr/bin
cp -P "$BUILDBIN"/yuzu $HOME/squashfs-root/usr/bin/
curl -sL https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$BRANCH/dist/yuzu.svg -o ./squashfs-root/yuzu.svg
curl -sL https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$BRANCH/dist/yuzu.desktop -o ./squashfs-root/yuzu.desktop
curl -sL https://github.com/AppImage/AppImageKit/releases/download/continuous/runtime-x86_64 -o ./squashfs-root/runtime
mkdir -p squashfs-root/usr/share/applications && cp ./squashfs-root/yuzu.desktop ./squashfs-root/usr/share/applications
mkdir -p squashfs-root/usr/share/icons && cp ./squashfs-root/yuzu.svg ./squashfs-root/usr/share/icons
mkdir -p squashfs-root/usr/share/icons/hicolor/scalable/apps && cp ./squashfs-root/yuzu.svg ./squashfs-root/usr/share/icons/hicolor/scalable/apps
mkdir -p squashfs-root/usr/share/pixmaps && cp ./squashfs-root/yuzu.svg ./squashfs-root/usr/share/pixmaps
curl -sL "https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$BRANCH/.github/workflows/update.sh" -o $HOME/squashfs-root/update.sh
chmod a+x ./squashfs-root/runtime
chmod a+x ./squashfs-root/update.sh
#cp /tmp/libssl.so.47 /tmp/libcrypto.so.45 /usr/lib/x86_64-linux-gnu/
echo $GITHUB_SHA > $HOME/squashfs-root/version.txt
unset QT_PLUGIN_PATH
unset LD_LIBRARY_PATH
unset QTDIR
mkdir $HOME/artifacts/
mkdir -p /yuzu/artifacts/version
# Version AppImage
curl -sL https://github.com/AppImage/AppImageKit/releases/download/continuous/AppRun-x86_64 -o $HOME/squashfs-root/AppRun
chmod a+x ./squashfs-root/AppRun
# /tmp/squashfs-root/AppRun $HOME/squashfs-root/usr/bin/yuzu -appimage -unsupported-allow-new-glibc -no-copy-copyright-files -no-translations -bundle-non-qt-libs
/tmp/squashfs-root/AppRun $HOME/squashfs-root/usr/bin/yuzu -unsupported-allow-new-glibc -no-copy-copyright-files -no-translations -bundle-non-qt-libs
export PATH=$(readlink -f /tmp/squashfs-root/usr/bin/):$PATH
/tmp/squashfs-root/usr/bin/appimagetool $HOME/squashfs-root
version=$(cat /yuzu/README.md | grep -o 'early-access [[:digit:]]*' | cut -c 14-17)
mv ./yuzu-x86_64.AppImage /yuzu/artifacts/version/Yuzu-EA-$version.AppImage
# Continuous AppImage
rm $HOME/squashfs-root/AppRun
curl -sL "https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$BRANCH/.github/workflows/AppRun" -o $HOME/squashfs-root/AppRun
chmod a+x ./squashfs-root/AppRun
mv /tmp/update/AppImageUpdate $HOME/squashfs-root/usr/bin/
mv /tmp/update/* $HOME/squashfs-root/usr/lib/
/tmp/squashfs-root/usr/bin/appimagetool $HOME/squashfs-root -u "gh-releases-zsync|pineappleEA|pineapple-src|continuous|yuzu-x86_64.AppImage.zsync"
mv yuzu-x86_64.AppImage* /yuzu/artifacts
cp -R $HOME/artifacts/ /yuzu/
cp "$BUILDBIN"/yuzu /yuzu/artifacts/version/
chmod -R 777 /yuzu/artifacts
cd /yuzu/artifacts
ls -al /yuzu/artifacts/
ls -al /yuzu/artifacts/version

39
.github/workflows/build.yml vendored Normal file
View file

@ -0,0 +1,39 @@
name: AppImage
on: push
jobs:
appimage:
name: pineapple bundled as appimage
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: cache
uses: actions/cache@v2
with:
path: $HOME/.ccache
key: build-ccache
restore-keys: |
build-ccache
- name: Build binary
run: |
mkdir -p "$HOME/.ccache"
docker pull quriouspixel/yuzu:latest
docker run -u root -e ENABLE_COMPATIBILITY_REPORTING --env-file .github/workflows/docker.env -v $(pwd):/yuzu -v "$HOME/.ccache":/root/.ccache quriouspixel/yuzu:latest /bin/bash /yuzu/.github/workflows/docker.sh
- name: Package AppImage
run: echo "Success!"
- name: Upload AppImage
run: |
ls -al artifacts/
wget -c https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_linux_amd64.tar.gz
tar xfv ghr_v0.13.0_linux_amd64.tar.gz
version=$(ls artifacts/version |grep Yuzu-EA | cut -d "-" -f 3 | cut -d "." -f 1)
ghr_v0.13.0_linux_amd64/ghr -recreate -n 'Continous build' -b "GitHub https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" continuous artifacts/
ghr_v0.13.0_linux_amd64/ghr -recreate -n "Continuous build (EA-$version)" -b "GitHub https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" EA-$version artifacts/version/
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

9
.github/workflows/docker.env vendored Normal file
View file

@ -0,0 +1,9 @@
GITHUB_REF
GITHUB_RUN_ID
GITHUB_REPOSITORY
GITHUB_SHA
GITHUB_WORKSPACE
# yuzu specific flags
ENABLE_COMPATIBILITY_REPORTING
USE_DISCORD_PRESENCE

22
.github/workflows/docker.sh vendored Normal file
View file

@ -0,0 +1,22 @@
#!/bin/bash -ex
BRANCH=`echo ${GITHUB_REF##*/}`
ver=$(cat /yuzu/README.md | grep -o 'early-access [[:digit:]]*' | cut -c 14-17)
title="yuzu Early Access $ver"
yuzupatch=( $(ls -d patches/* ) )
for i in "${yuzupatch[@]}"; do patch -p1 < "$i"; done
mkdir build && cd build
cmake .. -G Ninja -DCMAKE_CXX_FLAGS="-W" -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/lib/ccache/gcc -DCMAKE_CXX_COMPILER=/usr/lib/ccache/g++ -DTITLE_BAR_FORMAT_IDLE="$title" -DTITLE_BAR_FORMAT_RUNNING="$title | {3}" -DENABLE_COMPATIBILITY_LIST_DOWNLOAD=ON -DGIT_BRANCH="HEAD" -DGIT_DESC="$msvc" -DUSE_DISCORD_PRESENCE=ON
ninja
cd /tmp
curl -sLO "https://raw.githubusercontent.com/$GITHUB_REPOSITORY/$BRANCH/.github/workflows/appimage.sh"
chmod a+x appimage.sh
./appimage.sh

13
.github/workflows/update.sh vendored Normal file
View file

@ -0,0 +1,13 @@
#!/bin/bash
zenity --question --timeout=10 --title="yuzu updater" --text="New update available. Update now?" --icon-name=yuzu --window-icon=yuzu.svg --height=80 --width=400
answer=$?
if [ "$answer" -eq 0 ]; then
$APPDIR/usr/bin/AppImageUpdate $PWD/yuzu-x86_64.AppImage
elif [ "$answer" -eq 1 ]; then
$APPDIR/usr/bin/yuzu
elif [ "$answer" -eq 5 ]; then
$APPDIR/usr/bin/yuzu
fi
exit 0

BIN
.github/workflows/update.tar.gz vendored Normal file

Binary file not shown.

View file

@ -0,0 +1,21 @@
--- a/src/video_core/CMakeLists.txt
+++ b/src/video_core/CMakeLists.txt
@@ -299,7 +299,6 @@
/we4457 # Declaration of 'identifier' hides function parameter
/we4458 # Declaration of 'identifier' hides class member
/we4459 # Declaration of 'identifier' hides global declaration
- /we4715 # 'function' : not all control paths return a value
)
else()
target_compile_options(video_core PRIVATE
@@ -307,10 +305,8 @@
-Werror=shadow
-Werror=switch
-Werror=type-limits
- -Werror=unused-variable
$<$<CXX_COMPILER_ID:GNU>:-Werror=class-memaccess>
$<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-parameter>
- $<$<CXX_COMPILER_ID:GNU>:-Werror=unused-but-set-variable>
)
endif()