Skip to content

Commit

Permalink
Use Docker for our build env
Browse files Browse the repository at this point in the history
I think this will be a benefit overall, it gives us a reproducible build
environment that can be used in or outside of GitHub Actions.

Also, it will let us build in versions of Ubuntu/Debian other than what
GitHub Actions supports for runners, and possibly even other
architectures with Qemu.
  • Loading branch information
mkasberg committed Jan 18, 2025
1 parent 211e00a commit c6e0c97
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 33 deletions.
29 changes: 21 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,34 @@ jobs:
matrix:
ubuntu_version: ["22.04", "24.04", "24.10"]
runs-on: ubuntu-latest
container:
image: ubuntu:${{ matrix.ubuntu_version }}
steps:
# See the docs: https://github.com/docker/build-push-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# This action checks out the source as part of the action and can therefore
# go before the checkout step.
- name: Build Docker Image
uses: docker/build-push-action@v6
with:
tags: ghostty-ubuntu:${{ matrix.ubuntu_version }}
build-args: |
UBUNTU_VERSION=${{ matrix.ubuntu_version }}
push: false
load: true
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Checkout ghostty-ubuntu
uses: actions/checkout@v4

- name: Setup Build Env
run: ./setup-env.sh

- name: Build Ghostty
run: ./build-ghostty.sh
run: docker run --rm -v$PWD:/workspace -w /workspace ghostty-ubuntu:${{ matrix.ubuntu_version }} /bin/bash build-ghostty.sh

- name: Lint .deb Package
run: lintian ghostty_*.deb || true # Lintian shouldn't fail our build yet

# Lintian shouldn't fail our build yet
run: docker run --rm -v$PWD:/workspace -w /workspace ghostty-ubuntu:${{ matrix.ubuntu_version }} lintian ghostty_*.deb || true

- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
Expand Down
34 changes: 34 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
ARG UBUNTU_VERSION="24.10"
FROM ubuntu:${UBUNTU_VERSION}

# Install Build Tools
RUN DEBIAN_FRONTEND="noninteractive" apt-get -qq update && \
apt-get -qq -y install \
build-essential \
libbz2-dev \
libonig-dev \
lintian \
lsb-release \
pandoc \
wget

# Install Minisign
# https://jedisct1.github.io/minisign/
RUN wget -q "https://github.com/jedisct1/minisign/releases/download/0.11/minisign-0.11-linux.tar.gz" && \
tar -xzf minisign-0.11-linux.tar.gz && \
mv minisign-linux/x86_64/minisign /usr/local/bin && \
rm -r minisign-linux

# Install zig
# https://ziglang.org/download/
ARG ZIG_VERSION="0.13.0"
RUN 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 && \
rm "zig-linux-x86_64-$ZIG_VERSION.tar.xz" && \
ln -s "/opt/zig-linux-x86_64-$ZIG_VERSION/zig" /usr/local/bin/zig

# Install Ghostty Dependencies
RUN DEBIAN_FRONTEND="noninteractive" apt-get -qq update && \
apt-get -qq -y install \
libadwaita-1-dev \
libgtk-4-dev
1 change: 0 additions & 1 deletion build-ghostty.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ UBUNTU_DIST=$(lsb_release -sc)
#FULL_VERSION="$GHOSTTY_VERSION-0~${UBUNTU_DIST}1"
FULL_VERSION="$GHOSTTY_VERSION-0~ppa3"


# Fetch Ghostty Source
wget -q "https://release.files.ghostty.org/$GHOSTTY_VERSION/ghostty-$GHOSTTY_VERSION.tar.gz"
wget -q "https://release.files.ghostty.org/$GHOSTTY_VERSION/ghostty-$GHOSTTY_VERSION.tar.gz.minisig"
Expand Down
24 changes: 0 additions & 24 deletions setup-env.sh

This file was deleted.

0 comments on commit c6e0c97

Please sign in to comment.