Skip to content

Commit 53b25be

Browse files
author
psadi
committed
feat: add experimental builds
1 parent cbb4404 commit 53b25be

File tree

2 files changed

+74
-28
lines changed

2 files changed

+74
-28
lines changed

.github/workflows/ci.yaml

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,27 @@ jobs:
2121
actions: read
2222
security-events: write
2323
contents: write
24-
name: 👻 Build Ghostty (${{ matrix.arch }})
24+
name: 👻 Build Ghostty (${{ matrix.arch }})${{ matrix.experimental == true && '(experimental)' || '' }}
2525
runs-on: ${{ matrix.runs-on }}
2626
strategy:
2727
matrix:
2828
include:
2929
- arch: aarch64
3030
platform: linux/arm64
3131
runs-on: ubuntu-24.04-arm
32+
experimental: false
3233
- arch: x86_64
3334
platform: linux/amd64
3435
runs-on: ubuntu-24.04
36+
experimental: false
37+
- arch: aarch64
38+
platform: linux/arm64
39+
runs-on: ubuntu-24.04-arm
40+
experimental: true
41+
- arch: x86_64
42+
platform: linux/amd64
43+
runs-on: ubuntu-24.04
44+
experimental: true
3545
container:
3646
image: ghcr.io/pkgforge-dev/archlinux:latest
3747
steps:
@@ -68,11 +78,13 @@ jobs:
6878
echo "tip" > VERSION
6979
fi
7080
./build.sh
81+
env:
82+
EXPERIMENTAL: ${{ matrix.experimental }}
7183

7284
- name: Upload AppImage Artifacts
7385
uses: actions/upload-artifact@v4
7486
with:
75-
name: ghostty-appimage-${{ matrix.arch }}
87+
name: ghostty-appimage-${{ matrix.arch }}${{ matrix.experimental == true && '-experimental' || '' }}
7688
retention-days: 7
7789
path: /tmp/ghostty-build/Ghostty-*-${{ matrix.arch }}.AppImage*
7890

@@ -124,6 +136,14 @@ jobs:
124136
with:
125137
name: ghostty-appimage-x86_64
126138

139+
- uses: actions/download-artifact@v4
140+
with:
141+
name: ghostty-appimage-aarch64-experimental
142+
143+
- uses: actions/download-artifact@v4
144+
with:
145+
name: ghostty-appimage-x86_64-exprimental
146+
127147
- name: Ghostty stable
128148
uses: svenstaro/upload-release-action@v2
129149
with:
@@ -152,6 +172,14 @@ jobs:
152172
with:
153173
name: ghostty-appimage-x86_64
154174

175+
- uses: actions/download-artifact@v4
176+
with:
177+
name: ghostty-appimage-aarch64-experimental
178+
179+
- uses: actions/download-artifact@v4
180+
with:
181+
name: ghostty-appimage-x86_64-exprimental
182+
155183
- name: Ghostty Tip ("Nightly")
156184
uses: softprops/[email protected]
157185
with:

build.sh

Lines changed: 44 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,34 @@ mkdir -p -- "${TMP_DIR}" "${APP_DIR}/share/metainfo" "${APP_DIR}/shared/lib"
2929
cd "${TMP_DIR}"
3030

3131
if [ $GHOSTTY_VERSION == "tip" ]; then
32-
wget "https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz" -O ghostty-${GHOSTTY_VERSION}.tar.gz
33-
wget "https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz.minisig" -O ghostty-${GHOSTTY_VERSION}.tar.gz.minisig
34-
GHOSTTY_VERSION="$(tar -tf ghostty-${GHOSTTY_VERSION}.tar.gz --wildcards "*zig.zon.txt" | awk -F'[-/]' '{print $2"-"$3}')"
35-
mv ghostty-tip.tar.gz ghostty-${GHOSTTY_VERSION}.tar.gz
36-
mv ghostty-tip.tar.gz.minisig ghostty-${GHOSTTY_VERSION}.tar.gz.minisig
32+
wget "https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz" -O ghostty-${GHOSTTY_VERSION}.tar.gz
33+
wget "https://github.com/ghostty-org/ghostty/releases/download/tip/ghostty-source.tar.gz.minisig" -O ghostty-${GHOSTTY_VERSION}.tar.gz.minisig
34+
GHOSTTY_VERSION="$(tar -tf ghostty-${GHOSTTY_VERSION}.tar.gz --wildcards "*zig.zon.txt" | awk -F'[-/]' '{print $2"-"$3}')"
35+
mv ghostty-tip.tar.gz ghostty-${GHOSTTY_VERSION}.tar.gz
36+
mv ghostty-tip.tar.gz.minisig ghostty-${GHOSTTY_VERSION}.tar.gz.minisig
3737
else
38-
wget "https://release.files.ghostty.org/${GHOSTTY_VERSION}/ghostty-${GHOSTTY_VERSION}.tar.gz"
39-
wget "https://release.files.ghostty.org/${GHOSTTY_VERSION}/ghostty-${GHOSTTY_VERSION}.tar.gz.minisig"
38+
wget "https://release.files.ghostty.org/${GHOSTTY_VERSION}/ghostty-${GHOSTTY_VERSION}.tar.gz"
39+
wget "https://release.files.ghostty.org/${GHOSTTY_VERSION}/ghostty-${GHOSTTY_VERSION}.tar.gz.minisig"
40+
fi
41+
42+
if [ $EXPERIMENTAL == true ]; then
43+
BUILD_ARGS="${BUILD_ARGS} -Dapp-runtime=glfw"
44+
LIBS2BUNDLE="
45+
./bin/ghostty \
46+
/usr/lib/libEGL*"
47+
else
48+
LIBS2BUNDLE="
49+
./bin/ghostty \
50+
/usr/lib/libEGL* \
51+
/usr/lib/gdk-pixbuf-*/*/*/*"
4052
fi
4153

4254
minisign -V -m "ghostty-${GHOSTTY_VERSION}.tar.gz" -P "${PUB_KEY}" -s "ghostty-${GHOSTTY_VERSION}.tar.gz.minisig"
4355

4456
tar -xzmf "ghostty-${GHOSTTY_VERSION}.tar.gz"
4557

4658
rm "ghostty-${GHOSTTY_VERSION}.tar.gz" \
47-
"ghostty-${GHOSTTY_VERSION}.tar.gz.minisig"
59+
"ghostty-${GHOSTTY_VERSION}.tar.gz.minisig"
4860

4961
BUILD_DIR="ghostty-${GHOSTTY_VERSION}"
5062
BUILD_ARGS="${BUILD_ARGS} -Dversion-string=${GHOSTTY_VERSION}"
@@ -53,8 +65,8 @@ cd "${TMP_DIR}/${BUILD_DIR}"
5365

5466
#Fetch Zig Cache
5567
if [ -f './nix/build-support/fetch-zig-cache.sh' ]; then
56-
ZIG_GLOBAL_CACHE_DIR=/tmp/offline-cache ./nix/build-support/fetch-zig-cache.sh
57-
BUILD_ARGS="${BUILD_ARGS} --system /tmp/offline-cache/p"
68+
ZIG_GLOBAL_CACHE_DIR=/tmp/offline-cache ./nix/build-support/fetch-zig-cache.sh
69+
BUILD_ARGS="${BUILD_ARGS} --system /tmp/offline-cache/p"
5870
fi
5971

6072
# Build Ghostty with zig
@@ -72,19 +84,19 @@ ln -s "share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png" .
7284
ln -s "share/icons/hicolor/256x256/apps/com.mitchellh.ghostty.png" .DirIcon
7385

7486
# bundle all libs
75-
xvfb-run -a -- sharun l -p -v -e -s -k \
76-
./bin/ghostty \
77-
/usr/lib/libEGL* \
78-
/usr/lib/gdk-pixbuf-*/*/*/*
87+
xvfb-run -a -- sharun l -p -v -e -s -k ${LIBS2BUNDLE}
7988

8089
# preload libpixbufloader /w ld-preload-open as svg icons breaks
8190
# either on ghostty tab bar or gnome-text-editor while config edit or both :(
82-
mv ./shared/lib/gdk-pixbuf-2.0 ./
83-
cp -rv /opt/path-mapping.so ./shared/lib/
84-
cp -rv gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so ./shared/lib/
91+
if [ $EXPERIMENTAL == false ]; then
92+
mv ./shared/lib/gdk-pixbuf-2.0 ./
93+
cp -rv /opt/path-mapping.so ./shared/lib/
94+
cp -rv gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader_svg.so ./shared/lib/
95+
96+
echo 'path-mapping.so' >./.preload
97+
echo 'PATH_MAPPING=/usr/lib/gdk-pixbuf-2.0:${SHARUN_DIR}/gdk-pixbuf-2.0' >>./.env
98+
fi
8599

86-
echo 'path-mapping.so' >./.preload
87-
echo 'PATH_MAPPING=/usr/lib/gdk-pixbuf-2.0:${SHARUN_DIR}/gdk-pixbuf-2.0' >>./.env
88100
echo 'GHOSTTY_RESOURCES_DIR=${SHARUN_DIR}/share/ghostty' >>./.env
89101
echo 'unset ARGV0' >>./.env
90102

@@ -93,8 +105,14 @@ ln -s ./bin/ghostty ./AppRun
93105

94106
export VERSION="$(./AppRun --version | awk 'FNR==1 {print $2}')"
95107
if [ -z "$VERSION" ]; then
96-
echo "ERROR: Could not get version from ghostty binary"
97-
exit 1
108+
echo "ERROR: Could not get version from ghostty binary"
109+
exit 1
110+
fi
111+
112+
GHOSTTY_APPIMAGE="Ghostty-${VERSION}-${ARCH}.AppImage"
113+
114+
if [ $EXPERIMENTAL == true ]; then
115+
GHOSTTY_APPIMAGE="Ghostty-Experimental-${VERSION}-${ARCH}.AppImage"
98116
fi
99117

100118
cd "${TMP_DIR}"
@@ -111,11 +129,11 @@ sed -i 's|URUNTIME_MOUNT=[0-9]|URUNTIME_MOUNT=0|' ./uruntime-lite
111129

112130
echo "Generating AppImage"
113131
./uruntime --appimage-mkdwarfs -f \
114-
--set-owner 0 --set-group 0 \
115-
--no-history --no-create-timestamp \
116-
--compression zstd:level=22 -S26 -B8 \
117-
--header uruntime-lite -i "${APP_DIR}" \
118-
-o Ghostty-"${VERSION}"-"${ARCH}".AppImage
132+
--set-owner 0 --set-group 0 \
133+
--no-history --no-create-timestamp \
134+
--compression zstd:level=22 -S26 -B8 \
135+
--header uruntime-lite -i "${APP_DIR}" \
136+
-o "${GHOSTTY_APPIMAGE}"
119137

120138
echo "Generating Zsync file"
121139
zsyncmake *.AppImage -u *.AppImage

0 commit comments

Comments
 (0)