Files
static-musl-builds/.gitea/workflows/jq.yml
T
Hermes Agent 7f91a2a68e
iperf3 static musl build / build-and-release (push) Successful in 21s
jq static musl build / build-and-release (push) Successful in 15s
feat: add jq static build
2026-05-08 13:43:24 +00:00

73 lines
2.2 KiB
YAML

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"