-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (108 loc) · 4.07 KB
/
Copy pathrelease.yml
File metadata and controls
128 lines (108 loc) · 4.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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 "hum-${{ matrix.name }}.tar.gz" -C zig-out/bin hum
- uses: softprops/action-gh-release@v3
with:
files: hum-${{ 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.
# Apple-silicon only. The universal build died when Homebrew stopped
# shipping x86_64 bottles for mpv (Tier 3 under Rosetta): the x86_64 slice
# needs an x86_64 libmpv to link against, and building mpv from source in CI
# means building ffmpeg too. Intel Macs build from source via the tap.
build-macos:
name: macos-arm64
runs-on: macos-14
timeout-minutes: 30
steps:
- uses: actions/checkout@v5
- uses: mlugg/setup-zig@v2
with:
version: 0.16.0
- name: install libmpv
run: brew install mpv
- name: build
run: |
MPV="$(brew --prefix mpv)"
zig build test -Dmpv-prefix="$MPV"
zig build -Doptimize=ReleaseSafe -Dtarget=aarch64-macos -Dmpv-prefix="$MPV"
file zig-out/bin/hum
- name: package
run: tar -czf hum-macos-arm64.tar.gz -C zig-out/bin hum
- uses: softprops/action-gh-release@v3
with:
files: hum-macos-arm64.tar.gz
# Everything here runs inside an emulated FreeBSD VM, so every step is
# 5-10x its native cost. The 30-minute cap was being hit; the work was
# a 55MB in-VM toolchain download plus two full compiles.
build-freebsd:
name: freebsd-x86_64
runs-on: ubuntu-latest
timeout-minutes: 60
continue-on-error: true
steps:
- uses: actions/checkout@v5
# Pull the toolchain on the fast host (and cache it between releases)
# instead of over the VM's emulated network. The VM sees the workspace.
- name: cache zig tarball
id: zigcache
uses: actions/cache@v4
with:
path: zig-freebsd.tar.xz
key: zig-freebsd-0.16.0
- name: fetch zig (host)
if: steps.zigcache.outputs.cache-hit != 'true'
run: curl -fsSL -o zig-freebsd.tar.xz "https://ziglang.org/download/0.16.0/zig-x86_64-freebsd-0.16.0.tar.xz"
- uses: vmactions/freebsd-vm@v1
with:
usesh: true
prepare: |
set -e
# mpv drags in ffmpeg/X11/vulkan; we only ever link libmpv, but the
# port is how FreeBSD ships it. Keep the set otherwise minimal.
pkg install -y mpv pkgconf curl
run: |
set -e
# Unpacked here rather than in `prepare`: this block is the one that
# is guaranteed to run inside the synced workspace, where the
# host-fetched tarball actually is.
mkdir -p /opt/zig
tar -xJf zig-freebsd.tar.xz -C /opt/zig --strip-components=1
ln -sf /opt/zig/zig /usr/local/bin/zig
zig version
# Tests already run on the linux and macos legs of this same
# workflow. Repeating them here bought a second full compile in the
# slowest environment we have, for no extra coverage.
zig build -Doptimize=ReleaseSafe -Dmpv-prefix=/usr/local
- name: package
run: tar -czf hum-freebsd-x86_64.tar.gz -C zig-out/bin hum
- uses: softprops/action-gh-release@v3
with:
files: hum-freebsd-x86_64.tar.gz