From bd943c0aff76b85a5aefba0a9171b1b18a6ac45e Mon Sep 17 00:00:00 2001 From: qurious-pixel <62252937+qurious-pixel@users.noreply.github.com> Date: Tue, 18 Jul 2023 02:03:03 -0700 Subject: [PATCH] CI: AppImage build (#25) --- .github/workflows/build.yml | 29 +++++++++++++++++++++++++++++ Linux/appimage/Mesen.48x48.png | Bin 0 -> 509 bytes Linux/appimage/Mesen.desktop | 10 ++++++++++ Linux/appimage/appimage.sh | 20 ++++++++++++++++++++ makefile | 2 +- 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 Linux/appimage/Mesen.48x48.png create mode 100644 Linux/appimage/Mesen.desktop create mode 100755 Linux/appimage/appimage.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6262933c..67564093 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,6 +95,35 @@ jobs: name: Mesen (Linux - ${{ matrix.os }} - ${{ matrix.compiler }}) path: bin/linux-x64/Release/linux-x64/publish/Mesen + appimage: + runs-on: ubuntu-20.04 + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install .NET Core + uses: actions/setup-dotnet@v3 + with: + dotnet-version: 6.x + + - name: Install dependencies + run: | + sudo apt-get update -qy + sudo apt-get install -qy libsdl2-dev libfuse2 # The compilers are already installed on GitHub's runners. + + - name: Build Mesen (AppImage) + run: | + Linux/appimage/appimage.sh + - name: Upload Mesen (AppImage) + uses: actions/upload-artifact@v3 + with: + name: Mesen (Linux x64 - AppImage) + path: Mesen.AppImage + + macos: strategy: matrix: diff --git a/Linux/appimage/Mesen.48x48.png b/Linux/appimage/Mesen.48x48.png new file mode 100644 index 0000000000000000000000000000000000000000..789a54ad150db2b895133932aa747b833c970f96 GIT binary patch literal 509 zcmeAS@N?(olHy`uVBq!ia0y~yU@!n-4kiW$h8qca7Z?~A7>k44ofy`glX=O&z`&C3 z=MnofkUWbe2T(qt`MH(5jqpSV1u^nu9h$0?=@x{j@3ULGN@ z?%mj>+#4APVrnz+UYa3V+V!XPQ`gLy&$uE}ZkgD&A^DX< ua+aJ%rI77L`^H-f4fAI$y7_*ayrS->t2!Y!au^sG7(8A5T-G@yGywpRSj=hw literal 0 HcmV?d00001 diff --git a/Linux/appimage/Mesen.desktop b/Linux/appimage/Mesen.desktop new file mode 100644 index 00000000..8d2033e9 --- /dev/null +++ b/Linux/appimage/Mesen.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Icon=Mesen +Exec=Mesen %f +Terminal=false +Type=Application +Categories=Game;Emulator; +Name=Mesen +GenericName=Multi-system emulator +Comment=Multi-system emulator (NES, SNES, GB, PCE) diff --git a/Linux/appimage/appimage.sh b/Linux/appimage/appimage.sh new file mode 100755 index 00000000..a98979e4 --- /dev/null +++ b/Linux/appimage/appimage.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +export PUBLISHFLAGS="-r linux-x64 --no-self-contained false -p:PublishSingleFile=true -p:PublishReadyToRun=true" +make -j$(nproc) -O LTO=true STATICLINK=true SYSTEM_LIBEVDEV=false + +curl -SL https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -o appimagetool + +mkdir -p AppDir/usr/bin +cp bin/linux-x64/Release/linux-x64/publish/Mesen AppDir/usr/bin +chmod +x AppDir/usr/bin +ln -sr AppDir/usr/bin/Mesen AppDir/AppRun + +cp Linux/appimage/Mesen.48x48.png AppDir/Mesen.png +cp Linux/appimage/Mesen.desktop AppDir/Mesen.desktop +mkdir -p AppDir/usr/share/applications && cp ./AppDir/Mesen.desktop ./AppDir/usr/share/applications +mkdir -p AppDir/usr/share/icons && cp ./AppDir/Mesen.png ./AppDir/usr/share/icons +mkdir -p AppDir/usr/share/icons/hicolor/48x48/apps && cp ./AppDir/Mesen.png ./AppDir/usr/share/icons/hicolor/48x48/apps + +chmod a+x appimagetool +./appimagetool AppDir/ Mesen.AppImage diff --git a/makefile b/makefile index bfd7594a..62fcb695 100644 --- a/makefile +++ b/makefile @@ -98,7 +98,7 @@ CFLAGS = -fPIC -Wall $(MESENFLAGS) OBJFOLDER := obj.$(MESENPLATFORM) RELEASEFOLDER := bin/$(MESENPLATFORM)/Release -PUBLISHFLAGS := -r $(MESENPLATFORM) --no-self-contained true -p:PublishSingleFile=true +PUBLISHFLAGS ?= -r $(MESENPLATFORM) --no-self-contained true -p:PublishSingleFile=true CORESRC := $(shell find Core -name '*.cpp') COREOBJ := $(CORESRC:.cpp=.o)