release-tip workflow (wip)

This commit is contained in:
Mitchell Hashimoto
2022-11-17 11:24:12 -08:00
parent 7a2c551d60
commit 2d3126ffb7
2 changed files with 68 additions and 0 deletions

64
.github/workflows/release-tip.yml vendored Normal file
View 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

View File

@ -14,6 +14,8 @@
, wasmtime
, wraptest
, zig
, zip
, llvmPackages_latest
, bzip2
, expat
@ -55,9 +57,11 @@ in mkShell rec {
nativeBuildInputs = [
# For builds
llvmPackages_latest.llvm
pkg-config
scdoc
zig
zip
# Testing
gdb