Skip to content

Commit 044cee1

Browse files
committed
Github action to build the app-image
- Ran into some issues with running the appimage directly via github. - Runs correctly if it's contents are extracted and ran that way instead
1 parent 69d8e4d commit 044cee1

File tree

3 files changed

+76
-6
lines changed

3 files changed

+76
-6
lines changed

.github/workflows/build-appimage.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build and Package AppImage
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- appimage
9+
pull_request:
10+
branches:
11+
- main
12+
- master
13+
- appimage
14+
15+
jobs:
16+
build-appimage:
17+
runs-on: ubuntu-22.04
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
21+
steps:
22+
# Checkout the repository
23+
- name: Checkout repository
24+
uses: actions/checkout@v3
25+
26+
# Set up dependencies
27+
- name: Install dependencies
28+
run: |
29+
sudo apt-get update
30+
sudo apt-get install -y build-essential cmake libgl1-mesa-dev libglu1-mesa-dev \
31+
libsdl2-dev libsdl2-net-dev zlib1g-dev
32+
33+
# Build Supermodel
34+
- name: Build Supermodel
35+
run: |
36+
cd ./AppImage
37+
./build_app_image.sh
38+
39+
- name: Delete Existing latest Release
40+
run: |
41+
gh release delete latest -y || true
42+
gh api -X DELETE /repos/${{ github.repository }}/git/refs/tags/latest || true
43+
44+
- name: Check AppImage File
45+
run: ls -lah ./AppImage/
46+
47+
# Create release as the "latest" tag
48+
- name: Create Release
49+
id: create_release
50+
uses: actions/create-release@v1
51+
with:
52+
tag_name: latest
53+
release_name: "Supermodel Release latest"
54+
draft: false
55+
prerelease: false
56+
57+
- name: Upload AppImage
58+
uses: actions/upload-release-asset@v1
59+
with:
60+
upload_url: ${{ steps.create_release.outputs.upload_url }}
61+
# upload_url: ${{ github.event.release.upload_url }}
62+
asset_path: ./AppImage/Supermodel-x86_64.AppImage
63+
asset_name: Supermodel-x86_64.AppImage
64+
asset_content_type: application/octet-stream

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,3 +362,5 @@ saves/
362362
/AppImage/appimagetool-x86_64.AppImage
363363
/AppImage/Supermodel.AppDir
364364
/AppImage/Supermodel-x86_64.AppImage
365+
/AppImage/squashfs-root/
366+
/AppImage/appimagetool

AppImage/build_app_image.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ make -f Makefiles/Makefile.UNIX NET_BOARD=1 APP_IMAGE=1
1212
cd ./AppImage
1313
mkdir -p ./${APP_DIR}
1414

15-
# Download appimagetool (for creating the image)
16-
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -c
17-
chmod +x appimagetool-x86_64.AppImage
18-
1915
# Copy binary into folder
2016
mkdir -p ./${APP_DIR}/usr/bin
2117
cp ../bin/supermodel ./${APP_DIR}/usr/bin/Supermodel
@@ -54,5 +50,13 @@ cp /lib/x86_64-linux-gnu/libxcb-randr.so.0 ./${APP_DIR}/usr/lib/
5450
cp /lib/x86_64-linux-gnu/libxcb.so.1 ./${APP_DIR}/usr/lib/
5551
cp /lib/x86_64-linux-gnu/libxkbcommon.so.0 ./${APP_DIR}/usr/lib/
5652

57-
# Build the app-image
58-
./appimagetool-x86_64.AppImage Supermodel.AppDir
53+
echo "Building appimage"
54+
# Download appimagetool (for creating the image)
55+
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -c
56+
chmod +x appimagetool-x86_64.AppImage
57+
# ./appimagetool-x86_64.AppImage Supermodel.AppDir
58+
59+
# Extract out the contents
60+
# NOTE: We do it this way so it can work without FUSE and also work via a github action
61+
./appimagetool-x86_64.AppImage --appimage-extract
62+
./squashfs-root/AppRun ./Supermodel.AppDir

0 commit comments

Comments
 (0)