3 Commits

Author SHA1 Message Date
Hermes Agent 7f91a2a68e feat: add jq static build
iperf3 static musl build / build-and-release (push) Successful in 21s
jq static musl build / build-and-release (push) Successful in 15s
2026-05-08 13:43:24 +00:00
Hermes Agent 6959684d63 fix: trim busybox to archive-focused config
busybox static musl build / build-and-release (push) Successful in 38s
2026-05-08 00:18:12 +00:00
Hermes Agent 9d69535ad9 fix: add linux headers for busybox build
busybox static musl build / build-and-release (push) Failing after 21s
iperf3 static musl build / build-and-release (push) Successful in 20s
2026-05-08 00:10:10 +00:00
6 changed files with 155 additions and 7 deletions
+2 -1
View File
@@ -6,7 +6,8 @@ on:
- main
paths:
- .gitea/workflows/iperf3.yml
- scripts/**
- scripts/build_iperf3.sh
- scripts/publish_release.py
- versions/iperf3.version
- README.md
workflow_dispatch:
+72
View File
@@ -0,0 +1,72 @@
name: jq static musl build
on:
push:
branches:
- main
paths:
- .gitea/workflows/jq.yml
- scripts/build_jq.sh
- scripts/publish_release.py
- versions/jq.version
- README.md
workflow_dispatch:
permissions:
contents: write
jobs:
build-and-release:
runs-on: alpine-latest
steps:
- name: Bootstrap workspace
shell: sh
env:
REPO_URL: ${{ gitea.server_url }}
REPO_NAME: ${{ gitea.repository }}
GIT_SHA: ${{ gitea.sha }}
run: |
apk add --no-cache git
workdir="$(pwd)"
tmpdir="$(mktemp -d)"
git clone --depth 1 "$REPO_URL/$REPO_NAME.git" "$tmpdir/repo"
git -C "$tmpdir/repo" fetch --depth 1 origin "$GIT_SHA"
git -C "$tmpdir/repo" checkout "$GIT_SHA"
find "$workdir" -mindepth 1 -maxdepth 1 -exec rm -rf {} +
cp -a "$tmpdir/repo"/. "$workdir"/
- name: Read version
id: meta
shell: sh
working-directory: ${{ gitea.workspace }}
run: |
version="$(tr -d ' \n\r' < versions/jq.version)"
artifact="jq-${version}-linux-amd64-musl-static"
echo "version=${version}" >> "$GITHUB_OUTPUT"
echo "artifact=${artifact}" >> "$GITHUB_OUTPUT"
- name: Build static jq
shell: sh
working-directory: ${{ gitea.workspace }}
run: |
chmod +x scripts/build_jq.sh
./scripts/build_jq.sh "${{ steps.meta.outputs.version }}" "$PWD/dist"
- name: Publish release assets
shell: sh
env:
GITEA_TOKEN: ${{ gitea.token }}
GITEA_API_URL: ${{ gitea.api_url }}
REPO_OWNER: ${{ gitea.repository_owner }}
REPO_NAME: static-musl-builds
TOOL: jq
VERSION: ${{ steps.meta.outputs.version }}
TARGET_SHA: ${{ gitea.sha }}
working-directory: ${{ gitea.workspace }}
run: |
apk add --no-cache python3
python3 scripts/publish_release.py \
"dist/${{ steps.meta.outputs.artifact }}" \
"dist/${{ steps.meta.outputs.artifact }}.tar.gz" \
"dist/${{ steps.meta.outputs.artifact }}.sha256"
+1
View File
@@ -8,6 +8,7 @@ Automated static `musl` builds for portable Linux binaries.
- `speedtest-go`
- `doggo`
- `busybox`
- `jq`
Each release publishes:
- the raw binary
+30 -6
View File
@@ -7,22 +7,30 @@ PREFIX_NAME="busybox-${VERSION}-linux-amd64-musl-static"
mkdir -p "$OUTPUT_DIR"
apk add --no-cache build-base bzip2 curl file tar xz
apk add --no-cache \
build-base \
bzip2 \
curl \
file \
linux-headers \
tar \
xz
SRCDIR="${TMPDIR:-/tmp}/busybox-src-${VERSION}"
rm -rf "$SRCDIR"
mkdir -p "$SRCDIR"
curl -fsSL "https://busybox.net/downloads/busybox-${VERSION}.tar.bz2" | tar -xj -C "$SRCDIR" --strip-components=1
curl -fsSL "https://busybox.net/downloads/busybox-${VERSION}.tar.bz2" \
| tar -xj -C "$SRCDIR" --strip-components=1
cd "$SRCDIR"
make defconfig >/dev/null
make allnoconfig >/dev/null
set_kconfig() {
key="$1"
value="$2"
if grep -q "^${key}=" .config; then
sed -i "s#^${key}=.*#${key}=${value}#" .config
sed -i "s|^${key}=.*|${key}=${value}|" .config
elif grep -q "^# ${key} is not set$" .config; then
sed -i "s|^# ${key} is not set$|${key}=${value}|" .config
else
@@ -31,11 +39,27 @@ set_kconfig() {
}
set_kconfig CONFIG_STATIC y
set_kconfig CONFIG_FEATURE_SEAMLESS_XZ y
set_kconfig CONFIG_LONG_OPTS y
set_kconfig CONFIG_FEATURE_VERBOSE_USAGE y
set_kconfig CONFIG_FEATURE_COMPRESS_USAGE y
set_kconfig CONFIG_FEATURE_SEAMLESS_GZ y
set_kconfig CONFIG_FEATURE_SEAMLESS_BZ2 y
set_kconfig CONFIG_FEATURE_SEAMLESS_XZ y
set_kconfig CONFIG_GUNZIP y
set_kconfig CONFIG_ZCAT y
set_kconfig CONFIG_BUNZIP2 y
set_kconfig CONFIG_BZCAT y
set_kconfig CONFIG_UNLZMA y
set_kconfig CONFIG_LZCAT y
set_kconfig CONFIG_UNXZ y
set_kconfig CONFIG_XZ y
set_kconfig CONFIG_BZIP2 y
set_kconfig CONFIG_XZCAT y
set_kconfig CONFIG_GZIP y
set_kconfig CONFIG_TAR y
set_kconfig CONFIG_FEATURE_TAR_CREATE y
set_kconfig CONFIG_FEATURE_TAR_FROM y
set_kconfig CONFIG_FEATURE_TAR_GNU_EXTENSIONS y
set_kconfig CONFIG_FEATURE_TAR_AUTODETECT y
set_kconfig CONFIG_UNZIP y
yes '' | make oldconfig >/dev/null
+49
View File
@@ -0,0 +1,49 @@
#!/bin/sh
set -eu
VERSION="${1:?usage: build_jq.sh <version> [output_dir]}"
OUTPUT_DIR="${2:-$PWD/dist}"
VERSION="${VERSION#v}"
PREFIX_NAME="jq-${VERSION}-linux-amd64-musl-static"
mkdir -p "$OUTPUT_DIR"
apk add --no-cache \
build-base \
curl \
file \
tar \
xz
SRCDIR="${TMPDIR:-/tmp}/jq-src-${VERSION}"
rm -rf "$SRCDIR"
mkdir -p "$SRCDIR"
curl -fsSL "https://github.com/jqlang/jq/releases/download/jq-${VERSION}/jq-${VERSION}.tar.gz" \
| tar -xz -C "$SRCDIR" --strip-components=1
cd "$SRCDIR"
./configure \
--disable-docs \
--with-oniguruma=builtin \
--enable-all-static \
CFLAGS='-O2 -pipe'
make -j"$(getconf _NPROCESSORS_ONLN 2>/dev/null || echo 2)"
cp jq "$OUTPUT_DIR/$PREFIX_NAME"
strip "$OUTPUT_DIR/$PREFIX_NAME" 2>/dev/null || true
(
cd "$OUTPUT_DIR"
tar -czf "${PREFIX_NAME}.tar.gz" "$PREFIX_NAME"
sha256sum "$PREFIX_NAME" "${PREFIX_NAME}.tar.gz" > "${PREFIX_NAME}.sha256"
)
file "$OUTPUT_DIR/$PREFIX_NAME"
ldd "$OUTPUT_DIR/$PREFIX_NAME" || true
if file "$OUTPUT_DIR/$PREFIX_NAME" | grep -qi 'dynamically linked'; then
echo "error: output binary is still dynamically linked" >&2
exit 1
fi
echo "build OK: $OUTPUT_DIR/$PREFIX_NAME"
+1
View File
@@ -0,0 +1 @@
1.8.1