build: build for apple
Build and Release Firmware / firmware (ak4490) (push) Successful in 17s
Build and Release Firmware / firmware (cs4398) (push) Successful in 16s
Build and Release Firmware / firmware (evk) (push) Successful in 15s
Build and Release Firmware / cli (aarch64-unknown-linux-musl) (push) Successful in 1m58s
Build and Release Firmware / cli (universal2-apple-darwin) (push) Successful in 1m16s
Build and Release Firmware / cli (x86_64-pc-windows-gnu) (push) Successful in 1m26s
Build and Release Firmware / cli (x86_64-unknown-linux-musl) (push) Successful in 1m14s
Build and Release Firmware / release (push) Successful in 7s

This commit is contained in:
ktims committed 2026-11-11 18:57:25 -07:00
1 parent 27c8fa6a32
commit cc92b55df4
4 files changed
+93 -50

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
FROM ghcr.io/rust-cross/cargo-zigbuild:latest
# The base image may resolve its toolchain through $HOME, which the runner does not preserve for
# action containers, so pin it to a fixed path. entrypoint.sh re-exports this because the runner
# injects the workflow environment into action containers as well.
ENV RUSTUP_HOME=/usr/local/rustup
RUN if ! rustup default >/dev/null 2>&1; then \
rustup toolchain install stable --profile minimal --no-self-update; \
rustup default stable; \
fi
# The image ships the toolchain, zig, a macOS SDK and cargo-zigbuild, but not the bits the build and
# packaging scripts need.
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates zip zstd \
&& rm -rf /var/lib/apt/lists/*
# Install every target up front so building needs no network access. `universal2-apple-darwin` is
# not a rustc target: cargo-zigbuild builds both architectures and merges them.
RUN rustup target install \
aarch64-unknown-linux-musl \
x86_64-unknown-linux-musl \
x86_64-pc-windows-gnu \
aarch64-apple-darwin \
x86_64-apple-darwin
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
+13
View File
@@ -0,0 +1,13 @@
name: Build guac CLI
description: Cross-compile the guac CLI with cargo-zigbuild and package the artifact
inputs:
target:
description: Rust target triple, or universal2-apple-darwin
required: true
runs:
using: docker
image: Dockerfile
args:
- ${{ inputs.target }}
+26
View File
@@ -0,0 +1,26 @@
#!/bin/sh
set -eu
target="$1"
cd "${GITHUB_WORKSPACE:-$(pwd)}"
# The runner overrides env vars from the workflow for action containers, so re-assert the
# toolchain path the image installed to, and keep the registry in the workspace for caching.
export RUSTUP_HOME=/usr/local/rustup
export CARGO_HOME="${PWD}/.cargo-cache"
bin=guac-cli
case "$target" in
*windows*) bin=guac-cli.exe ;;
esac
(cd cli && cargo zigbuild --release --target "$target")
artifact="target/${target}/release/${bin}"
if [ ! -f "$artifact" ]; then
artifact="cli/${artifact}"
fi
mkdir -p dist
zip -j "dist/guac-cli-${target}.zip" "$artifact"