mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
ci: build macos app
This commit is contained in:
32
.github/workflows/test.yml
vendored
32
.github/workflows/test.yml
vendored
@ -53,16 +53,42 @@ jobs:
|
|||||||
submodules: recursive
|
submodules: recursive
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
|
- name: Install Signing Certificates
|
||||||
|
env:
|
||||||
|
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
|
||||||
|
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
|
||||||
|
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
|
||||||
|
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
|
||||||
|
run: |
|
||||||
|
# Turn our base64-encoded certificate back to a regular .p12 file
|
||||||
|
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
|
||||||
|
|
||||||
|
# We need to create a new keychain, otherwise using the certificate will prompt
|
||||||
|
# with a UI dialog asking for the certificate password, which we can't
|
||||||
|
# use in a headless CI environment
|
||||||
|
security create-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
|
||||||
|
security set-keychain-settings -lut 21600 build.keychain
|
||||||
|
security default-keychain -s build.keychain
|
||||||
|
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
|
||||||
|
security import certificate.p12 -k build.keychain -P "$MACOS_CERTIFICATE_PWD" -T /usr/bin/codesign
|
||||||
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$MACOS_CI_KEYCHAIN_PWD" build.keychain
|
||||||
|
|
||||||
# Install Nix and use that to run our tests so our environment matches exactly.
|
# Install Nix and use that to run our tests so our environment matches exactly.
|
||||||
- uses: cachix/install-nix-action@v19
|
- uses: cachix/install-nix-action@v19
|
||||||
with:
|
with:
|
||||||
nix_path: nixpkgs=channel:nixos-unstable
|
nix_path: nixpkgs=channel:nixos-unstable
|
||||||
|
|
||||||
# Cross-compile the binary. We always use static building for this
|
# GhosttyKit is the framework that is built from Zig for our native
|
||||||
# because its the only way to access the headers.
|
# Mac app to access.
|
||||||
- name: Test Build
|
- name: Build GhosttyKit
|
||||||
run: nix develop -c zig build -Dstatic=true
|
run: nix develop -c zig build -Dstatic=true
|
||||||
|
|
||||||
|
# The native app is built with native XCode tooling. This also does
|
||||||
|
# codesigning. IMPORTANT: this must NOT run in a Nix environment.
|
||||||
|
# Nix breaks xcodebuild so this has to be run outside.
|
||||||
|
- name: Build Ghostty.app
|
||||||
|
run: cd macos && xcodebuild
|
||||||
|
|
||||||
test:
|
test:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
Reference in New Issue
Block a user