mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-01-06 21:37:49 +00:00
release-tip workflow (wip)
This commit is contained in:
64
.github/workflows/release-tip.yml
vendored
Normal file
64
.github/workflows/release-tip.yml
vendored
Normal file
@@ -0,0 +1,64 @@
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: [Test]
|
||||
types: [completed]
|
||||
branches: [main]
|
||||
|
||||
name: Release Tip
|
||||
|
||||
jobs:
|
||||
build-macos:
|
||||
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
# Needed for macos SDK
|
||||
AGREE: "true"
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 0
|
||||
|
||||
# Install Nix and use that so our environment matches exactly.
|
||||
- uses: cachix/install-nix-action@v18
|
||||
with:
|
||||
nix_path: nixpkgs=channel:nixos-unstable
|
||||
|
||||
# Cross-compile the binary. We always use static building for this
|
||||
# because its the only way to access the headers.
|
||||
- name: Build aarch64
|
||||
run: |
|
||||
nix develop -c zig build -Dcpu=baseline -Dstatic=true -Dtarget=aarch64-macos -Drelease-fast
|
||||
mv zig-out/bin/ghostty zig-out/bin/ghostty-aarch64-macos
|
||||
- name: Build x86_64
|
||||
run: |
|
||||
nix develop -c zig build -Dcpu=baseline -Dstatic=true -Dtarget=x86_64-macos -Drelease-fast
|
||||
mv zig-out/bin/ghostty zig-out/bin/ghostty-x86_64-macos
|
||||
|
||||
- name: Create Universal Binary
|
||||
run: |
|
||||
# Lipo our binaries
|
||||
nix develop -c \
|
||||
llvm-lipo \
|
||||
zig-out/bin/ghostty-aarch64-macos \
|
||||
zig-out/bin/ghostty-x86_64-macos \
|
||||
-create \
|
||||
-output zig-out/bin/ghostty-universal
|
||||
|
||||
# Ensure the app is universal
|
||||
cp zig-out/bin/ghostty-universal zig-out/Ghostty.app/Contents/MacOS/ghostty
|
||||
|
||||
# Zip up the app
|
||||
- name: Zip App
|
||||
run: nix develop -c sh -c 'cd zig-out && zip -9 -r ../ghostty-macos-universal.zip Ghostty.app'
|
||||
|
||||
# Update Release
|
||||
- name: Release
|
||||
uses: softprops/action-gh-release@v1
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
with:
|
||||
name: "Ghostty Tip (\"Nightly\")"
|
||||
prerelease: true
|
||||
tag_name: tip
|
||||
files: ghostty-macos-universal.zip
|
||||
Reference in New Issue
Block a user