Skip to content

Commit 5d15667

Browse files
CI: Add AppImage Build (#452)
1 parent 2f86622 commit 5d15667

File tree

6 files changed

+115
-21
lines changed

6 files changed

+115
-21
lines changed

.github/workflows/build.yml

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,36 @@ jobs:
2222
uses: actions/checkout@v3
2323
with:
2424
submodules: "recursive"
25-
25+
2626
- name: Setup release mode parameters (for deploy)
2727
if: ${{ inputs.deploymode == 'release' }}
2828
run: |
2929
echo "BUILD_MODE=release" >> $GITHUB_ENV
3030
echo "BUILD_FLAGS=" >> $GITHUB_ENV
3131
echo "Build mode is release"
32+
3233
- name: Setup debug mode parameters (for continous build)
3334
if: ${{ inputs.deploymode != 'release' }}
3435
run: |
3536
echo "BUILD_MODE=debug" >> $GITHUB_ENV
3637
echo "BUILD_FLAGS=" >> $GITHUB_ENV
3738
echo "Build mode is debug"
38-
39+
3940
- name: Setup version for experimental
4041
if: ${{ inputs.experimentalversion != '' }}
4142
run: |
4243
echo "[INFO] Experimental version ${{ inputs.experimentalversion }}"
4344
echo "BUILD_FLAGS=${{ env.BUILD_FLAGS }} -DEXPERIMENTAL_VERSION=${{ inputs.experimentalversion }}" >> $GITHUB_ENV
44-
45+
4546
- name: "Install system dependencies"
4647
run: |
4748
sudo apt update -qq
4849
sudo apt install -y clang-12 cmake freeglut3-dev libgcrypt20-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev nasm ninja-build
50+
4951
- name: "Bootstrap vcpkg"
5052
run: |
5153
bash ./dependencies/vcpkg/bootstrap-vcpkg.sh
52-
54+
5355
- name: 'Setup NuGet Credentials for vcpkg'
5456
shell: 'bash'
5557
run: |
@@ -66,15 +68,12 @@ jobs:
6668
6769
- name: "cmake"
6870
run: |
69-
mkdir -p build
70-
cd build
71-
cmake .. ${{ env.BUILD_FLAGS }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_MODE }} -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja
71+
cmake -S . -B build ${{ env.BUILD_FLAGS }} -DCMAKE_BUILD_TYPE=${{ env.BUILD_MODE }} -DPORTABLE=OFF -DCMAKE_C_COMPILER=/usr/bin/clang-12 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-12 -G Ninja -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja
7272
7373
- name: "Build Cemu"
7474
run: |
75-
cd build
76-
ninja
77-
75+
cmake --build build
76+
7877
- name: Prepare artifact
7978
if: ${{ inputs.deploymode == 'release' }}
8079
run: mv bin/Cemu_release bin/Cemu
@@ -85,8 +84,33 @@ jobs:
8584
with:
8685
name: cemu-bin-linux-x64
8786
path: ./bin/Cemu
88-
89-
87+
88+
build-appimage:
89+
runs-on: ubuntu-20.04
90+
needs: build-ubuntu
91+
steps:
92+
- name: Checkout Upstream Repo
93+
uses: actions/checkout@v3
94+
95+
- uses: actions/download-artifact@v3
96+
with:
97+
name: cemu-bin-linux-x64
98+
path: bin
99+
100+
- name: "Install system dependencies"
101+
run: |
102+
sudo apt update -qq
103+
sudo apt install -y clang-12 cmake freeglut3-dev libgcrypt20-dev libgtk-3-dev libpulse-dev libsecret-1-dev libsystemd-dev nasm ninja-build
104+
105+
- name: "Build AppImage"
106+
run: dist/linux/appimage.sh
107+
108+
- name: Upload artifact
109+
uses: actions/upload-artifact@v3
110+
with:
111+
name: cemu-appimage-x64
112+
path: artifacts
113+
90114
build-windows:
91115
runs-on: windows-2022
92116
steps:

.github/workflows/build_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
paths-ignore:
1212
- "*.md"
1313
branches:
14-
- main
14+
#- main
1515

1616
jobs:
1717
build:

.github/workflows/deploy_experimental_release.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@ jobs:
1313
runs-on: ubuntu-20.04
1414
needs: call-release-build
1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717

1818
- uses: actions/download-artifact@v3
1919
with:
2020
name: cemu-bin-linux-x64
2121
path: cemu-bin-linux-x64
2222

23+
- uses: actions/download-artifact@v3
24+
with:
25+
name: cemu-appimage-x64
26+
path: cemu-appimage-x64
27+
2328
- uses: actions/download-artifact@v3
2429
with:
2530
name: cemu-bin-windows-x64
@@ -53,7 +58,14 @@ jobs:
5358
mv cemu-bin-windows-x64/Cemu.exe ./${{ env.CEMU_FOLDER_NAME }}/Cemu.exe
5459
zip -9 -r upload/cemu-${{ env.CEMU_VERSION }}-windows-x64.zip ${{ env.CEMU_FOLDER_NAME }}
5560
rm -r ./${{ env.CEMU_FOLDER_NAME }}
56-
61+
62+
- name: Create appimage
63+
run: |
64+
VERSION=${{ env.CEMU_VERSION }}
65+
echo "Cemu Version is $VERSION"
66+
ls cemu-appimage-x64
67+
mv cemu-appimage-x64/Cemu-*-x86_64.AppImage upload/Cemu-$VERSION-x86_64.AppImage
68+
5769
- name: Create release from linux-bin
5870
run: |
5971
ls ./

.github/workflows/deploy_stable_release.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,18 @@ jobs:
1515
runs-on: ubuntu-20.04
1616
needs: call-release-build
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1919

2020
- uses: actions/download-artifact@v3
2121
with:
2222
name: cemu-bin-linux-x64
2323
path: cemu-bin-linux-x64
2424

25+
- uses: actions/download-artifact@v3
26+
with:
27+
name: cemu-appimage-x64
28+
path: cemu-appimage-x64
29+
2530
- uses: actions/download-artifact@v3
2631
with:
2732
name: cemu-bin-windows-x64
@@ -44,11 +49,7 @@ jobs:
4449
echo "Cemu CI version: $(./getversion)"
4550
echo "CEMU_FOLDER_NAME=Cemu_$(./getversion)" >> $GITHUB_ENV
4651
echo "CEMU_VERSION=$(./getversion)" >> $GITHUB_ENV
47-
48-
- name: Create appimage
49-
run: |
50-
echo "to do"
51-
52+
5253
- name: Create release from windows-bin
5354
run: |
5455
ls ./
@@ -57,6 +58,13 @@ jobs:
5758
mv cemu-bin-windows-x64/Cemu.exe ./${{ env.CEMU_FOLDER_NAME }}/Cemu.exe
5859
zip -9 -r upload/cemu-${{ env.CEMU_VERSION }}-windows-x64.zip ${{ env.CEMU_FOLDER_NAME }}
5960
rm -r ./${{ env.CEMU_FOLDER_NAME }}
61+
62+
- name: Create appimage
63+
run: |
64+
VERSION=${{ env.CEMU_VERSION }}
65+
echo "Cemu Version is $VERSION"
66+
ls cemu-appimage-x64
67+
mv cemu-appimage-x64/Cemu-*-x86_64.AppImage upload/Cemu-$VERSION-x86_64.AppImage
6068
6169
- name: Create release from ubuntu-bin
6270
run: |

dist/linux/appimage.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
if [ -z "${GITHUB_WORKSPACE}" ]; then
4+
export GITHUB_WORKSPACE="."
5+
fi
6+
7+
curl -sSfLO "https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage"
8+
chmod a+x linuxdeploy*.AppImage
9+
curl -sSfL https://github.com$(curl https://github.com/probonopd/go-appimage/releases/expanded_assets/continuous | grep "mkappimage-.*-x86_64.AppImage" | head -n 1 | cut -d '"' -f 2) -o mkappimage.AppImage
10+
chmod a+x mkappimage.AppImage
11+
curl -sSfLO "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/master/linuxdeploy-plugin-gtk.sh"
12+
chmod a+x linuxdeploy-plugin-gtk.sh
13+
14+
if [[ ! -e /usr/lib/x86_64-linux-gnu ]]; then
15+
sed -i 's#lib\/x86_64-linux-gnu#lib64#g' linuxdeploy-plugin-gtk.sh
16+
fi
17+
18+
mkdir -p AppDir/usr/
19+
cp dist/linux/{info.cemu.Cemu.desktop,info.cemu.Cemu.png} AppDir/
20+
21+
mkdir -p AppDir/usr/share/applications
22+
mkdir -p AppDir/usr/share/icons/hicolor/scalable/apps
23+
mkdir -p AppDir/usr/lib
24+
25+
cp -r bin AppDir/usr/
26+
cp /usr/lib/x86_64-linux-gnu/{libsepol.so.1,libffi.so.7,libpcre.so.3,libGLU.so.1} AppDir/usr/lib
27+
28+
chmod +x AppDir/usr/bin/Cemu
29+
#chmod +x AppDir/AppRun
30+
31+
export UPD_INFO="gh-releases-zsync|cemu-project|Cemu|ci|Cemu.AppImage.zsync"
32+
./linuxdeploy-x86_64.AppImage --appimage-extract-and-run\
33+
--appdir="$GITHUB_WORKSPACE"/AppDir/ \
34+
-d "$GITHUB_WORKSPACE"/AppDir/info.cemu.Cemu.desktop \
35+
-i "$GITHUB_WORKSPACE"/AppDir/info.cemu.Cemu.png \
36+
-e "$GITHUB_WORKSPACE"/AppDir/usr/bin/Cemu \
37+
--plugin gtk
38+
39+
GITVERSION=$(git rev-parse --short HEAD)
40+
echo $GITVERSION
41+
if [[ -z ${GITVERSION} ]]; then
42+
GITVERSION=experimental
43+
fi
44+
45+
echo "Cemu Version Cemu-${GITVERSION}"
46+
rm AppDir/usr/lib/libwayland-client.so.0
47+
VERSION=${GITVERSION} ./mkappimage.AppImage --appimage-extract-and-run "$GITHUB_WORKSPACE"/AppDir
48+
49+
mkdir -p "$GITHUB_WORKSPACE"/artifacts/
50+
mv Cemu-${GITVERSION}-x86_64.AppImage "$GITHUB_WORKSPACE"/artifacts/

dist/linux/info.cemu.Cemu.png

11.7 KB
Loading

0 commit comments

Comments
 (0)