mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +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
|
uses: cachix/install-nix-action@v24
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
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
|
- name: Check Zig cache hash
|
||||||
run: nix develop -c ./nix/build-support/check-zig-cache-hash.sh
|
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:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
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
|
# Setup Sparkle
|
||||||
- name: Setup Sparkle
|
- name: Setup Sparkle
|
||||||
env:
|
env:
|
||||||
|
53
.github/workflows/test.yml
vendored
53
.github/workflows/test.yml
vendored
@ -31,11 +31,41 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
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
|
# Cross-compile the binary. We always use static building for this
|
||||||
# because its the only way to access the headers.
|
# because its the only way to access the headers.
|
||||||
- name: Test Build
|
- name: Test Build
|
||||||
run: nix develop -c zig build -Dstatic=true -Dapp-runtime=glfw -Dtarget=${{ matrix.target }}
|
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:
|
build-macos:
|
||||||
runs-on: ghcr.io/cirruslabs/macos-ventura-xcode:latest
|
runs-on: ghcr.io/cirruslabs/macos-ventura-xcode:latest
|
||||||
needs: test
|
needs: test
|
||||||
@ -51,6 +81,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
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
|
# GhosttyKit is the framework that is built from Zig for our native
|
||||||
# Mac app to access.
|
# Mac app to access.
|
||||||
- name: Build GhosttyKit
|
- name: Build GhosttyKit
|
||||||
@ -61,6 +97,7 @@ jobs:
|
|||||||
# Nix breaks xcodebuild so this has to be run outside.
|
# Nix breaks xcodebuild so this has to be run outside.
|
||||||
- name: Build Ghostty.app
|
- name: Build Ghostty.app
|
||||||
run: cd macos && xcodebuild
|
run: cd macos && xcodebuild
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: windows-2019
|
runs-on: windows-2019
|
||||||
# this will not stop other jobs from running
|
# this will not stop other jobs from running
|
||||||
@ -126,6 +163,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
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
|
- name: test
|
||||||
run: nix develop -c zig build -Dapp-runtime=none test
|
run: nix develop -c zig build -Dapp-runtime=none test
|
||||||
|
|
||||||
@ -145,6 +188,11 @@ jobs:
|
|||||||
- uses: cachix/install-nix-action@v24
|
- uses: cachix/install-nix-action@v24
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
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
|
- name: prettier check
|
||||||
run: nix develop -c prettier --check .
|
run: nix develop -c prettier --check .
|
||||||
|
|
||||||
@ -155,5 +203,10 @@ jobs:
|
|||||||
- uses: cachix/install-nix-action@v24
|
- uses: cachix/install-nix-action@v24
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
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
|
- name: alejandra check
|
||||||
run: nix develop -c alejandra --check .
|
run: nix develop -c alejandra --check .
|
||||||
|
@ -138,11 +138,17 @@ in
|
|||||||
else "$out/share/terminfo"
|
else "$out/share/terminfo"
|
||||||
}
|
}
|
||||||
|
|
||||||
mkdir -p $terminfo/share
|
mkdir -p "$out/nix-support"
|
||||||
cp -r "$terminfo_src" $terminfo/share/terminfo
|
|
||||||
|
|
||||||
mkdir -p $shell_integration
|
mkdir -p "$terminfo/share"
|
||||||
cp -r $out/share/shell-integration $shell_integration/shell-integration
|
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; {
|
meta = with lib; {
|
||||||
|
Reference in New Issue
Block a user