92f2c636be
busybox static musl build / build-and-release (push) Failing after 31s
doggo static musl build / build-and-release (push) Successful in 19s
gdu static musl build / build-and-release (push) Successful in 37s
iperf3 static musl build / build-and-release (push) Successful in 20s
speedtest-go static musl build / build-and-release (push) Successful in 32s
69 lines
2.2 KiB
YAML
69 lines
2.2 KiB
YAML
name: busybox static musl build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- .gitea/workflows/busybox.yml
|
|
- scripts/build_busybox.sh
|
|
- scripts/publish_release.py
|
|
- versions/busybox.version
|
|
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/busybox.version)"
|
|
artifact="busybox-${version}-linux-amd64-musl-static"
|
|
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
|
echo "artifact=${artifact}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build static busybox
|
|
shell: sh
|
|
working-directory: ${{ gitea.workspace }}
|
|
run: |
|
|
chmod +x scripts/build_busybox.sh
|
|
./scripts/build_busybox.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: busybox
|
|
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"
|