Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 32 additions & 15 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
name: Build

on:
workflow_dispatch: {}
pull_request:
Expand All @@ -14,29 +12,47 @@ jobs:
actions: read
security-events: write
contents: write
name: Build Ghostty
name: Build Ghostty (${{ matrix.arch }})
runs-on: ubuntu-24.04
container:
image: ubuntu:24.04
options: "--privileged --cap-add SYS_ADMIN --device /dev/fuse"
strategy:
matrix:
include:
- arch: aarch64
platform: linux/arm64
- arch: x86_64
platform: linux/amd64
steps:
- name: Checkout ghostty-appimage
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup Build Env
run: ./setup.sh
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
continue-on-error: true

- name: Build Ghostty
run: ./build.sh
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
continue-on-error: true

- name: Build in Docker
run: |
docker run --rm --privileged \
--cap-add SYS_ADMIN \
--device /dev/fuse \
--platform ${{ matrix.platform }} \
-v ${{ github.workspace }}:/work \
-v /tmp:/tmp \
-w /work \
ubuntu:24.04 \
bash -c "./setup.sh && ./build.sh"

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: ghostty-appimage
name: ghostty-appimage-${{ matrix.arch }}
retention-days: 7
path: /tmp/ghostty-build/Ghostty-*-x86_64.AppImage*
path: /tmp/ghostty-build/Ghostty-*-${{ matrix.arch }}.AppImage*

release_appimage:
permissions:
Expand All @@ -45,18 +61,19 @@ jobs:
contents: write
name: "Upload binaries to current release"
runs-on: ubuntu-latest
if: ${{ github.event_name == 'release' }}
#if: ${{ github.event_name == 'release' }}
needs: "build_appimage"
steps:
- uses: actions/download-artifact@v4
with:
name: ghostty-appimage
pattern: ghostty-appimage-*
merge-multiple: true

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./Ghostty-*-x86_64.AppImage*
file: ./Ghostty-*-*.AppImage*
tag: ${{ github.ref }}
overwrite: true
file_glob: true
18 changes: 15 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,22 @@ cd "${APP_DIR}"

# bundle all libs
ldd ./usr/bin/ghostty | awk -F"[> ]" '{print $4}' | xargs -I {} cp --update=none -v {} ./usr/lib
if ! mv ./usr/lib/ld-linux-x86-64.so.2 ./; then
cp -v /lib64/ld-linux-x86-64.so.2 ./

# ld-linux contains x86-64 instead of x86_64.
if [ "$ARCH" = "x86_64" ]; then
if ! mv ./usr/lib/ld-linux-x86-64.so.2 ./ld-linux.so; then
cp -v /lib64/ld-linux-x86-64.so.2 ./ld-linux.so
fi
elif [ "$ARCH" = "aarch64" ]; then
if ! mv ./usr/lib/ld-linux-aarch64.so.1 ./ld-linux.so; then
cp -v /lib64/ld-linux-aarch64.so.1 ./ld-linux.so
fi
else
exit 1
fi



# Prepare AppImage -- Configure launcher script, metainfo and desktop file with icon.
cat <<'EOF' >./AppRun
#!/usr/bin/env sh
Expand All @@ -75,7 +87,7 @@ HERE="$(dirname "$(readlink -f "$0")")"
export TERM=xterm-256color
export GHOSTTY_RESOURCES_DIR="${HERE}/usr/share/ghostty"

exec "${HERE}"/ld-linux-x86-64.so.2 --library-path "${HERE}"/usr/lib "${HERE}"/usr/bin/ghostty "$@"
exec "${HERE}"/ld-linux.so --library-path "${HERE}"/usr/lib "${HERE}"/usr/bin/ghostty "$@"
EOF

chmod +x AppRun
Expand Down
17 changes: 9 additions & 8 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -e

export DEBIAN_FRONTEND="noninteractive"
export ARCH="$(uname -m)"

ZIG_VERSION="0.13.0"
MINISIGN_URL="https://github.com/jedisct1/minisign/releases/download/0.11/minisign-0.11-linux.tar.gz"
Expand All @@ -29,22 +30,22 @@ apt-get -qq update && apt-get -qq -y upgrade && apt-get -qq -y install ${buildPk

# download & install other dependencies
# appimagetool: https://github.com/AppImage/appimagetool
wget -q "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-x86_64.AppImage"
install appimagetool-x86_64.AppImage /usr/local/bin/appimagetool
wget -q "https://github.com/AppImage/appimagetool/releases/download/continuous/appimagetool-${ARCH}.AppImage"
install "appimagetool-${ARCH}.AppImage" /usr/local/bin/appimagetool

# minisign: https://github.com/jedisct1/minisign
wget -q "${MINISIGN_URL}" -O "minisign-linux.tar.gz"
tar -xzf "minisign-linux.tar.gz"
mv minisign-linux/x86_64/minisign /usr/local/bin
mv minisign-linux/"${ARCH}"/minisign /usr/local/bin

# zig: https://ziglang.org
wget -q "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-x86_64-${ZIG_VERSION}.tar.xz"
tar -xf "zig-linux-x86_64-${ZIG_VERSION}.tar.xz" -C /opt
ln -s "/opt/zig-linux-x86_64-${ZIG_VERSION}/zig" /usr/local/bin/zig
wget -q "https://ziglang.org/download/${ZIG_VERSION}/zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz"
tar -xf "zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz" -C /opt
ln -s "/opt/zig-linux-${ARCH}-${ZIG_VERSION}/zig" /usr/local/bin/zig

# cleanup
rm -r \
"appimagetool-x86_64.AppImage" \
"appimagetool-${ARCH}.AppImage" \
"minisign-linux.tar.gz" \
"minisign-linux" \
"zig-linux-x86_64-${ZIG_VERSION}.tar.xz"
"zig-linux-${ARCH}-${ZIG_VERSION}.tar.xz"
Loading