Skip to content

Commit 1a11377

Browse files
JAORMXclaude
andcommitted
Add macOS runtime packaging and release support
Add Taskfile tasks for building, packaging, and fetching macOS runtime and firmware tarballs (build-runner-darwin, package-runtime-darwin, package-firmware-darwin, fetch-runtime-darwin, fetch-firmware-darwin). Update release workflow to build macOS arm64 artifacts on macos-15, include them in GitHub Releases, and push OCI artifacts to ghcr.io. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent b81552a commit 1a11377

2 files changed

Lines changed: 158 additions & 1 deletion

File tree

.github/workflows/release.yaml

Lines changed: 84 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,53 @@ jobs:
6060
name: propolis-firmware-linux-${{ matrix.arch }}
6161
path: dist/propolis-firmware-linux-${{ matrix.arch }}.tar.gz
6262

63+
build-artifacts-darwin:
64+
name: Build macOS (${{ matrix.arch }})
65+
runs-on: ${{ matrix.runner }}
66+
strategy:
67+
matrix:
68+
include:
69+
- arch: arm64
70+
runner: macos-15
71+
steps:
72+
- name: Checkout repository
73+
uses: actions/checkout@v6
74+
75+
- name: Set up Task
76+
uses: arduino/setup-task@v2
77+
with:
78+
version: 3.x
79+
80+
- name: Install libkrun via Homebrew
81+
run: |
82+
brew tap slp/krun
83+
brew install libkrun libkrunfw
84+
85+
- name: Build runner and copy libraries
86+
run: task build-runner-darwin VERSION=${{ github.ref_name }}
87+
88+
- name: Package runtime tarball
89+
run: task package-runtime-darwin TAG=${{ github.ref_name }}
90+
91+
- name: Package firmware tarball
92+
run: task package-firmware-darwin TAG=${{ github.ref_name }}
93+
94+
- name: Upload runtime artifact
95+
uses: actions/upload-artifact@v6
96+
with:
97+
name: propolis-runtime-darwin-${{ matrix.arch }}
98+
path: dist/propolis-runtime-darwin-${{ matrix.arch }}.tar.gz
99+
100+
- name: Upload firmware artifact
101+
uses: actions/upload-artifact@v6
102+
with:
103+
name: propolis-firmware-darwin-${{ matrix.arch }}
104+
path: dist/propolis-firmware-darwin-${{ matrix.arch }}.tar.gz
105+
63106
create-release:
64107
name: Create Release
65108
runs-on: ubuntu-latest
66-
needs: build-artifacts
109+
needs: [build-artifacts, build-artifacts-darwin]
67110
steps:
68111
- name: Checkout repository
69112
uses: actions/checkout@v6
@@ -86,6 +129,8 @@ jobs:
86129
propolis-runtime-linux-arm64.tar.gz \
87130
propolis-firmware-linux-amd64.tar.gz \
88131
propolis-firmware-linux-arm64.tar.gz \
132+
propolis-runtime-darwin-arm64.tar.gz \
133+
propolis-firmware-darwin-arm64.tar.gz \
89134
sha256sums.txt
90135
91136
push-oci:
@@ -126,3 +171,41 @@ jobs:
126171
oras push ghcr.io/stacklok/propolis/firmware:${{ github.ref_name }}-linux-${{ matrix.arch }} \
127172
--artifact-type application/vnd.stacklok.propolis.firmware \
128173
propolis-firmware-linux-${{ matrix.arch }}.tar.gz:application/gzip
174+
175+
push-oci-darwin:
176+
name: Push OCI macOS (${{ matrix.arch }})
177+
runs-on: ubuntu-latest
178+
needs: build-artifacts-darwin
179+
strategy:
180+
matrix:
181+
include:
182+
- arch: arm64
183+
steps:
184+
- name: Download runtime artifact
185+
uses: actions/download-artifact@v7
186+
with:
187+
name: propolis-runtime-darwin-${{ matrix.arch }}
188+
189+
- name: Download firmware artifact
190+
uses: actions/download-artifact@v7
191+
with:
192+
name: propolis-firmware-darwin-${{ matrix.arch }}
193+
194+
- name: Install oras
195+
uses: oras-project/setup-oras@v1
196+
197+
- name: Login to ghcr.io
198+
run: |
199+
echo "${{ secrets.GITHUB_TOKEN }}" | oras login ghcr.io -u ${{ github.actor }} --password-stdin
200+
201+
- name: Push runtime OCI artifact
202+
run: |
203+
oras push ghcr.io/stacklok/propolis/runtime:${{ github.ref_name }}-darwin-${{ matrix.arch }} \
204+
--artifact-type application/vnd.stacklok.propolis.runtime \
205+
propolis-runtime-darwin-${{ matrix.arch }}.tar.gz:application/gzip
206+
207+
- name: Push firmware OCI artifact
208+
run: |
209+
oras push ghcr.io/stacklok/propolis/firmware:${{ github.ref_name }}-darwin-${{ matrix.arch }} \
210+
--artifact-type application/vnd.stacklok.propolis.firmware \
211+
propolis-firmware-darwin-${{ matrix.arch }}.tar.gz:application/gzip

Taskfile.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,18 @@ tasks:
6868
# Hypervisor.framework requires entitlements
6969
- codesign --entitlements assets/entitlements.plist --force -s - bin/{{.RUNNER_NAME}}
7070

71+
build-runner-darwin:
72+
desc: Build runner + copy Homebrew dylibs for macOS packaging
73+
platforms: [darwin]
74+
cmds:
75+
- task: build-dev-darwin
76+
- cp $(brew --prefix libkrun)/lib/libkrun.dylib bin/
77+
- cp $(brew --prefix libkrunfw)/lib/libkrunfw.dylib bin/
78+
generates:
79+
- bin/{{.RUNNER_NAME}}
80+
- bin/libkrun.dylib
81+
- bin/libkrunfw.dylib
82+
7183
build-dev-race:
7284
desc: Build runner with race detector (requires libkrun-devel)
7385
env:
@@ -227,6 +239,40 @@ tasks:
227239
tar czf "dist/${staging}.tar.gz" "${staging}"
228240
rm -rf "${staging}"
229241
242+
package-runtime-darwin:
243+
desc: Package macOS runtime tarball (runner + libkrun)
244+
platforms: [darwin]
245+
vars:
246+
TAG: '{{.TAG | default .VERSION}}'
247+
cmds:
248+
- mkdir -p dist
249+
- |
250+
staging="propolis-runtime-darwin-{{.HOST_ARCH}}"
251+
mkdir -p "${staging}"
252+
cp bin/propolis-runner bin/libkrun.dylib "${staging}/"
253+
echo "{{.TAG}}" > "${staging}/VERSION"
254+
tar czf "dist/${staging}.tar.gz" "${staging}"
255+
rm -rf "${staging}"
256+
257+
package-firmware-darwin:
258+
desc: Package macOS firmware tarball (libkrunfw, GPL-licensed)
259+
platforms: [darwin]
260+
vars:
261+
TAG: '{{.TAG | default .VERSION}}'
262+
cmds:
263+
- mkdir -p dist
264+
- |
265+
staging="propolis-firmware-darwin-{{.HOST_ARCH}}"
266+
mkdir -p "${staging}"
267+
cp bin/libkrunfw.dylib "${staging}/"
268+
echo "{{.TAG}}" > "${staging}/VERSION"
269+
cat > "${staging}/LICENSE-GPL" <<'LICEOF'
270+
libkrunfw is licensed under the GNU General Public License v2.0 (GPL-2.0).
271+
See https://github.com/containers/libkrunfw for full license text.
272+
LICEOF
273+
tar czf "dist/${staging}.tar.gz" "${staging}"
274+
rm -rf "${staging}"
275+
230276
# =============================================================================
231277
# Fetch Pre-built Artifacts
232278
# =============================================================================
@@ -259,6 +305,34 @@ tasks:
259305
- tar -xzf bin/propolis-firmware-linux-{{.HOST_ARCH}}.tar.gz -C bin/ --strip-components=1
260306
- rm -f bin/propolis-firmware-linux-{{.HOST_ARCH}}.tar.gz
261307

308+
fetch-runtime-darwin:
309+
desc: Download pre-built macOS runtime tarball from GitHub Release
310+
vars:
311+
RELEASE_TAG: '{{.RELEASE_TAG | default .VERSION}}'
312+
cmds:
313+
- mkdir -p bin
314+
- >-
315+
gh release download {{.RELEASE_TAG}}
316+
--repo stacklok/propolis
317+
--pattern "propolis-runtime-darwin-{{.HOST_ARCH}}.tar.gz"
318+
--dir bin/ --clobber
319+
- tar -xzf bin/propolis-runtime-darwin-{{.HOST_ARCH}}.tar.gz -C bin/ --strip-components=1
320+
- rm -f bin/propolis-runtime-darwin-{{.HOST_ARCH}}.tar.gz
321+
322+
fetch-firmware-darwin:
323+
desc: Download pre-built macOS firmware tarball from GitHub Release
324+
vars:
325+
RELEASE_TAG: '{{.RELEASE_TAG | default .VERSION}}'
326+
cmds:
327+
- mkdir -p bin
328+
- >-
329+
gh release download {{.RELEASE_TAG}}
330+
--repo stacklok/propolis
331+
--pattern "propolis-firmware-darwin-{{.HOST_ARCH}}.tar.gz"
332+
--dir bin/ --clobber
333+
- tar -xzf bin/propolis-firmware-darwin-{{.HOST_ARCH}}.tar.gz -C bin/ --strip-components=1
334+
- rm -f bin/propolis-firmware-darwin-{{.HOST_ARCH}}.tar.gz
335+
262336
fetch-runtime-oci:
263337
desc: Pull pre-built runtime OCI artifact from ghcr.io
264338
vars:

0 commit comments

Comments
 (0)