Skip to content

Merge pull request #7 from zblauser/v0.1.6-tui-crash #11

Merge pull request #7 from zblauser/v0.1.6-tui-crash

Merge pull request #7 from zblauser/v0.1.6-tui-crash #11

Workflow file for this run

name: release
on:
push:
tags: ["v*"]
permissions:
contents: write
jobs:
build-linux:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- { name: linux-arm64, os: ubuntu-24.04-arm }
- { name: linux-x86_64, os: ubuntu-24.04 }
steps:
- uses: actions/checkout@v5
- uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: install libmpv
run: sudo apt-get update && sudo apt-get install -y libmpv-dev
- name: build
run: |
zig build test -Dmpv-prefix=
zig build -Doptimize=ReleaseSafe -Dmpv-prefix=
- name: package
run: tar -czf "ytcli-${{ matrix.name }}.tar.gz" -C zig-out/bin ytcli
- uses: softprops/action-gh-release@v3
with:
files: ytcli-${{ matrix.name }}.tar.gz
# Single universal (arm64 + x86_64) binary, cross-built on one Apple-silicon
# runner and lipo'd — avoids the scarce macos-13 Intel runner entirely.
build-macos:
name: macos-universal
runs-on: macos-14
timeout-minutes: 45
steps:
- uses: actions/checkout@v5
- uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: install libmpv (arm64, native)
run: brew install mpv
- name: install libmpv (x86_64, via Rosetta homebrew)
run: |
sudo softwareupdate --install-rosetta --agree-to-license
arch -x86_64 /usr/bin/env NONINTERACTIVE=1 bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# mpv's python@3.14 dep can fail to symlink into /usr/local/bin against
# the runner's preinstalled Python.framework — harmless, we only need
# libmpv, reached via the formula's opt prefix (not global links).
arch -x86_64 /usr/local/bin/brew install mpv || true
test -f "$(arch -x86_64 /usr/local/bin/brew --prefix mpv)/lib/libmpv.dylib"
- name: build both slices + lipo
run: |
ARM_MPV="$(brew --prefix mpv)"
X86_MPV="$(arch -x86_64 /usr/local/bin/brew --prefix mpv)"
zig build test -Dmpv-prefix="$ARM_MPV"
zig build -Doptimize=ReleaseSafe -Dtarget=aarch64-macos -Dmpv-prefix="$ARM_MPV"
cp zig-out/bin/ytcli ytcli-arm64
zig build -Doptimize=ReleaseSafe -Dtarget=x86_64-macos -Dmpv-prefix="$X86_MPV"
cp zig-out/bin/ytcli ytcli-x86_64
lipo -create -output ytcli ytcli-arm64 ytcli-x86_64
lipo -info ytcli
file ytcli
- name: package
run: tar -czf ytcli-macos-universal.tar.gz ytcli
- uses: softprops/action-gh-release@v3
with:
files: ytcli-macos-universal.tar.gz
build-freebsd:
name: freebsd-x86_64
runs-on: ubuntu-latest
timeout-minutes: 30
continue-on-error: true
steps:
- uses: actions/checkout@v5
- uses: vmactions/freebsd-vm@v1
env:
ZIG: "0.16.0"
with:
usesh: true
envs: "ZIG"
prepare: |
set -e
pkg install -y mpv pkgconf curl
fetch -o /tmp/zig.tar.xz "https://ziglang.org/download/${ZIG}/zig-x86_64-freebsd-${ZIG}.tar.xz"
mkdir -p /opt/zig
tar -xJf /tmp/zig.tar.xz -C /opt/zig --strip-components=1
ln -sf /opt/zig/zig /usr/local/bin/zig
run: |
set -e
zig version
zig build test -Dmpv-prefix=/usr/local
zig build -Doptimize=ReleaseSafe -Dmpv-prefix=/usr/local
- name: package
run: tar -czf ytcli-freebsd-x86_64.tar.gz -C zig-out/bin ytcli
- uses: softprops/action-gh-release@v3
with:
files: ytcli-freebsd-x86_64.tar.gz