build: distribute gresource c/h with source tarball

This introduces the concept of a "dist resource" (specifically a
`GhosttyDist.Resource` type). This is a resource that may be present in
dist tarballs but not in the source tree. If the resource is present and
we're not in a Git checkout, then we use it directly instead of
generating it.

This is used for the first time in this commit for the gresource c/h
files, which depend on a variety of external tools (blueprint-compiler,
glib-compile-resources, etc.) that we do not want to require downstream
users/packagers to have and we also do not want to worry about them
having the right versions.

This also adds a check for `distcheck` to ensure our distribution
contains all the expected files.
This commit is contained in:
Mitchell Hashimoto
2025-03-19 10:12:45 -07:00
parent bd315c8394
commit 7b8c2232d3
6 changed files with 236 additions and 92 deletions

View File

@@ -239,7 +239,17 @@ jobs:
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Build and Check Source Tarball
run: nix develop -c zig build distcheck
run: |
rm -rf zig-out/dist
nix develop -c zig build distcheck
cp zig-out/dist/*.tar.gz ghostty-source.tar.gz
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: source-tarball
path: |-
ghostty-source.tar.gz
build-macos:
runs-on: namespace-profile-ghostty-macos
@@ -828,7 +838,7 @@ jobs:
test-debian-12:
name: Test build on Debian 12
runs-on: namespace-profile-ghostty-sm
needs: test
needs: [test, build-dist]
steps:
- name: Checkout code
uses: actions/checkout@v4
@@ -839,6 +849,11 @@ jobs:
- name: Configure Namespace powered Buildx
uses: namespacelabs/nscloud-setup-buildx-action@v0
- name: Download Source Tarball Artifacts
uses: actions/download-artifact@v4
with:
name: source-tarball
- name: Build and push
uses: docker/build-push-action@v6
with: