Skip to content

Commit fc8024f

Browse files
Update codo.yml
1 parent 47cda9d commit fc8024f

1 file changed

Lines changed: 66 additions & 12 deletions

File tree

.github/workflows/codo.yml

Lines changed: 66 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ on:
1515
jobs:
1616
build:
1717
runs-on: ubuntu-latest
18-
1918
steps:
2019
- name: Checkout repository
2120
uses: actions/checkout@v4
@@ -30,25 +29,81 @@ jobs:
3029
env:
3130
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3231

33-
- name: Prepare Linux AppDir
32+
- name: Install linuxdeploy
33+
uses: miurahr/install-linuxdeploy-action@v1
34+
with:
35+
plugins: appimage
36+
37+
- name: Prepare AppDir structure
3438
run: |
39+
# Create the AppDir structure
3540
mkdir -p AppDir/usr/bin
41+
mkdir -p AppDir/usr/lib
3642
mkdir -p AppDir/usr/share/applications
3743
mkdir -p AppDir/usr/share/icons/hicolor/256x256/apps
38-
44+
45+
# Copy the Godot executable
3946
cp build/Codo/Codo.x86_64 AppDir/usr/bin/
47+
chmod +x AppDir/usr/bin/Codo.x86_64
48+
49+
# Copy the required library (you'll need to ensure this file exists)
50+
# If this file is in your repository, adjust the path accordingly
51+
# For now, creating a placeholder - replace with actual file location
52+
if [ -f "addons/godot_xterm/native/bin/libgdterm.linux.template_release.x86_64.so" ]; then
53+
cp addons/godot_xterm/native/bin/libgdterm.linux.template_release.x86_64.so AppDir/usr/lib/
54+
else
55+
echo "Warning: libgdterm.so not found. Please ensure it's available in your repository."
56+
fi
57+
58+
# Copy desktop file and icon
4059
cp packaging/codo.desktop AppDir/usr/share/applications/
4160
cp packaging/codo-icon.png AppDir/usr/share/icons/hicolor/256x256/apps/
61+
62+
# Create AppRun launcher script
63+
cat > AppDir/AppRun << 'EOF'
64+
#!/bin/sh
65+
# Set up library path to include our custom libraries
66+
export LD_LIBRARY_PATH="$APPDIR/usr/lib:$LD_LIBRARY_PATH"
67+
68+
# Change to the AppImage mount point
69+
cd "$APPDIR"
4270

43-
echo '#!/bin/sh' > AppDir/AppRun
44-
echo 'exec "$APPDIR/usr/bin/Codo.x86_64" "$@"' >> AppDir/AppRun
71+
# Execute the main application
72+
exec "$APPDIR/usr/bin/Codo.x86_64" "$@"
73+
EOF
4574
chmod +x AppDir/AppRun
75+
76+
# Copy desktop file and icon to root of AppDir (required by AppImage spec)
77+
cp packaging/codo.desktop AppDir/
78+
cp packaging/codo-icon.png AppDir/
4679

47-
- name: Build AppImage
48-
uses: AppImageCrafters/build-appimage@v1
49-
with:
50-
appdir: AppDir
51-
output: build/Codo.AppImage
80+
- name: Verify AppDir structure
81+
run: |
82+
echo "AppDir structure:"
83+
find AppDir -type f -exec ls -la {} \;
84+
85+
- name: Build AppImage with linuxdeploy
86+
run: |
87+
# Create output directory
88+
mkdir -p build
89+
90+
# Use linuxdeploy to create the AppImage
91+
linuxdeploy --appdir AppDir --output appimage
92+
93+
# Move the resulting AppImage to build directory with proper name
94+
mv Codo*.AppImage build/Codo.AppImage
95+
96+
- name: Verify AppImage creation
97+
run: |
98+
ls -la build/
99+
if [ -f "build/Codo.AppImage" ]; then
100+
echo "AppImage created successfully"
101+
chmod +x build/Codo.AppImage
102+
file build/Codo.AppImage
103+
else
104+
echo "ERROR: AppImage not found"
105+
exit 1
106+
fi
52107
53108
- name: Upload artifact
54109
uses: actions/upload-artifact@v4
@@ -57,10 +112,9 @@ jobs:
57112
path: build/Codo.AppImage
58113

59114
release:
60-
if: github.ref == 'refs/heads/main'
115+
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
61116
runs-on: ubuntu-latest
62117
needs: build
63-
64118
steps:
65119
- name: Checkout repository
66120
uses: actions/checkout@v4

0 commit comments

Comments
 (0)