63 lines
1.9 KiB
YAML
63 lines
1.9 KiB
YAML
name: iperf3 static musl build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
paths:
|
|
- .gitea/workflows/iperf3.yml
|
|
- scripts/**
|
|
- versions/iperf3.version
|
|
- README.md
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
build-and-release:
|
|
runs-on: alpine-latest
|
|
|
|
steps:
|
|
- name: Bootstrap workspace
|
|
shell: sh
|
|
run: |
|
|
apk add --no-cache git
|
|
rm -rf "$GITHUB_WORKSPACE"
|
|
git clone --depth 1 "${{ gitea.server_url }}/${{ gitea.repository }}.git" "$GITHUB_WORKSPACE"
|
|
git -C "$GITHUB_WORKSPACE" fetch --depth 1 origin "${{ gitea.sha }}"
|
|
git -C "$GITHUB_WORKSPACE" checkout "${{ gitea.sha }}"
|
|
|
|
- name: Read version
|
|
id: meta
|
|
shell: sh
|
|
working-directory: ${{ gitea.workspace }}
|
|
run: |
|
|
version="$(tr -d ' \n\r' < versions/iperf3.version)"
|
|
artifact="iperf3-${version}-linux-amd64-musl-static"
|
|
echo "version=${version}" >> "$GITHUB_OUTPUT"
|
|
echo "artifact=${artifact}" >> "$GITHUB_OUTPUT"
|
|
|
|
- name: Build static iperf3
|
|
shell: sh
|
|
working-directory: ${{ gitea.workspace }}
|
|
run: |
|
|
chmod +x scripts/build_iperf3.sh
|
|
./scripts/build_iperf3.sh "${{ steps.meta.outputs.version }}" "$PWD/dist"
|
|
|
|
- name: Publish release assets
|
|
shell: sh
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
GITEA_API_URL: ${{ gitea.api_url }}
|
|
REPO_OWNER: ${{ gitea.repository_owner }}
|
|
REPO_NAME: static-musl-builds
|
|
VERSION: ${{ steps.meta.outputs.version }}
|
|
TARGET_SHA: ${{ gitea.sha }}
|
|
working-directory: ${{ gitea.workspace }}
|
|
run: |
|
|
python3 scripts/publish_release.py \
|
|
"dist/${{ steps.meta.outputs.artifact }}" \
|
|
"dist/${{ steps.meta.outputs.artifact }}.tar.gz" \
|
|
"dist/${{ steps.meta.outputs.artifact }}.sha256"
|