mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 07:46:12 +03:00
Merge pull request #1150 from jcollie/fix-nix-package
fix nix package and add ci test for nix package build
This commit is contained in:
5
.github/workflows/nix.yml
vendored
5
.github/workflows/nix.yml
vendored
@ -10,6 +10,11 @@ jobs:
|
||||
uses: cachix/install-nix-action@v24
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
# Use cache to minimize build times.
|
||||
- name: Setup Nix cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
with:
|
||||
diagnostic-endpoint: "" # disable telemetry
|
||||
- name: Check Zig cache hash
|
||||
run: nix develop -c ./nix/build-support/check-zig-cache-hash.sh
|
||||
#
|
||||
|
6
.github/workflows/release-tip.yml
vendored
6
.github/workflows/release-tip.yml
vendored
@ -48,6 +48,12 @@ jobs:
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
# Use cache to minimize build times.
|
||||
- name: Setup Nix cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
with:
|
||||
diagnostic-endpoint: "" # disable telemetry
|
||||
|
||||
# Setup Sparkle
|
||||
- name: Setup Sparkle
|
||||
env:
|
||||
|
53
.github/workflows/test.yml
vendored
53
.github/workflows/test.yml
vendored
@ -31,11 +31,41 @@ jobs:
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
# Use cache to minimize build times.
|
||||
- name: Setup Nix cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
with:
|
||||
diagnostic-endpoint: "" # disable telemetry
|
||||
|
||||
# Cross-compile the binary. We always use static building for this
|
||||
# because its the only way to access the headers.
|
||||
- name: Test Build
|
||||
run: nix develop -c zig build -Dstatic=true -Dapp-runtime=glfw -Dtarget=${{ matrix.target }}
|
||||
|
||||
build-nix:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
needs: test
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# Install Nix and use that to run our tests so our environment matches exactly.
|
||||
- uses: cachix/install-nix-action@v24
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
# Use cache to minimize build times.
|
||||
- name: Setup Nix cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
with:
|
||||
diagnostic-endpoint: "" # disable telemetry
|
||||
|
||||
- name: Test NixOS package build
|
||||
run: nix build .#ghostty
|
||||
|
||||
build-macos:
|
||||
runs-on: ghcr.io/cirruslabs/macos-ventura-xcode:latest
|
||||
needs: test
|
||||
@ -51,6 +81,12 @@ jobs:
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
# Use cache to minimize build times.
|
||||
- name: Setup Nix cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
with:
|
||||
diagnostic-endpoint: "" # disable telemetry
|
||||
|
||||
# GhosttyKit is the framework that is built from Zig for our native
|
||||
# Mac app to access.
|
||||
- name: Build GhosttyKit
|
||||
@ -61,6 +97,7 @@ jobs:
|
||||
# Nix breaks xcodebuild so this has to be run outside.
|
||||
- name: Build Ghostty.app
|
||||
run: cd macos && xcodebuild
|
||||
|
||||
build-windows:
|
||||
runs-on: windows-2019
|
||||
# this will not stop other jobs from running
|
||||
@ -126,6 +163,12 @@ jobs:
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
# Use cache to minimize build times.
|
||||
- name: Setup Nix cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
with:
|
||||
diagnostic-endpoint: "" # disable telemetry
|
||||
|
||||
- name: test
|
||||
run: nix develop -c zig build -Dapp-runtime=none test
|
||||
|
||||
@ -145,6 +188,11 @@ jobs:
|
||||
- uses: cachix/install-nix-action@v24
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
# Use cache to minimize build times.
|
||||
- name: Setup Nix cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
with:
|
||||
diagnostic-endpoint: "" # disable telemetry
|
||||
- name: prettier check
|
||||
run: nix develop -c prettier --check .
|
||||
|
||||
@ -155,5 +203,10 @@ jobs:
|
||||
- uses: cachix/install-nix-action@v24
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
# Use cache to minimize build times.
|
||||
- name: Setup Nix cache
|
||||
uses: DeterminateSystems/magic-nix-cache-action@main
|
||||
with:
|
||||
diagnostic-endpoint: "" # disable telemetry
|
||||
- name: alejandra check
|
||||
run: nix develop -c alejandra --check .
|
||||
|
@ -138,11 +138,17 @@ in
|
||||
else "$out/share/terminfo"
|
||||
}
|
||||
|
||||
mkdir -p $terminfo/share
|
||||
cp -r "$terminfo_src" $terminfo/share/terminfo
|
||||
mkdir -p "$out/nix-support"
|
||||
|
||||
mkdir -p $shell_integration
|
||||
cp -r $out/share/shell-integration $shell_integration/shell-integration
|
||||
mkdir -p "$terminfo/share"
|
||||
mv "$terminfo_src" "$terminfo/share/terminfo"
|
||||
ln -sf "$terminfo/share/terminfo" "$terminfo_src"
|
||||
echo "$terminfo" >> "$out/nix-support/propagated-user-env-packages"
|
||||
|
||||
mkdir -p "$shell_integration"
|
||||
mv "$out/share/ghostty/shell-integration" "$shell_integration/shell-integration"
|
||||
ln -sf "$shell_integration/shell-integration" "$out/share/ghostty/shell-integration"
|
||||
echo "$shell_integration" >> "$out/nix-support/propagated-user-env-packages"
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
|
Reference in New Issue
Block a user