Files
varde/.gitea/workflows/release.yml
T
Bendik LynghaugandClaude Fable 5 b53b5cc000
ci / quality (push) Failing after 3m0s
Bound every await in push_to; plain-git checkout for real this time
CI (run 208) showed the Push RPC hanging past the test client's 120s
read timeout: endpoint.connect and the delivery-verification observe
loop had no bounds, so a wedged path hung the socket instead of
failing. Connect now times out at 30s and each observe step at 60s,
producing structured errors that name the stage.

The checkout action is back out: run 212 proved the failure is not the
action's version — the runner execs the action's JS with node inside
the job container, and rust:1 has no node ('exec: "node": executable
file not found'). Plain git needs nothing the container lacks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-16 15:39:58 +02:00

92 lines
3.6 KiB
YAML

# Release pipeline: a `vX.Y.Z` tag (pushed by `cargo release`, see
# release.toml) builds distribution tarballs and attaches them to a
# Gitea release.
#
# Each tarball contains the two binaries (stripped, release profile),
# the systemd units, the example config, rendered man pages, and the
# license/readme — everything a distro package or a hand install needs.
name: release
on:
push:
tags: ["v*"]
jobs:
build:
runs-on: ubuntu-latest
container: rust:1
strategy:
matrix:
target: [x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu]
steps:
# Not the checkout action: it runs on node, which the rust:1 job
# container doesn't have and this runner doesn't inject (the v5
# run died with 'exec: "node": not found'). Plain git needs
# neither, and the token URL works against the private repo.
- name: checkout
run: |
git init -q .
git fetch --depth 1 \
"https://gitea:${{ secrets.GITHUB_TOKEN }}@${GITHUB_SERVER_URL#https://}/${GITHUB_REPOSITORY}.git" \
"$GITHUB_SHA"
git checkout -q FETCH_HEAD
- name: install tooling
run: |
apt-get update
apt-get install -y --no-install-recommends scdoc jq
if [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
apt-get install -y --no-install-recommends gcc-aarch64-linux-gnu
fi
rustup target add ${{ matrix.target }}
- name: build
env:
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
run: |
cargo build --workspace --release --target ${{ matrix.target }}
- name: package
run: |
VERSION="${GITHUB_REF_NAME#v}"
PKG="varde-${VERSION}-${{ matrix.target }}"
mkdir -p "$PKG"/{bin,systemd/user,man}
cp "target/${{ matrix.target }}/release/varde-daemon" \
"target/${{ matrix.target }}/release/varde-ctl" "$PKG/bin/"
# Cross-strip is unavailable for the foreign target; native
# strip handles the host one.
if [ "${{ matrix.target }}" = "x86_64-unknown-linux-gnu" ]; then
strip "$PKG"/bin/*
else
aarch64-linux-gnu-strip "$PKG"/bin/*
fi
cp dist/varde.service dist/varde.socket "$PKG/systemd/"
cp dist/user/varde.service dist/user/varde.socket "$PKG/systemd/user/"
cp dist/config.toml "$PKG/config.toml.example"
scdoc < dist/varde.8.scd > "$PKG/man/varde.8"
scdoc < dist/varde-ctl.1.scd > "$PKG/man/varde-ctl.1"
cp README.md LICENSE-MIT LICENSE-APACHE "$PKG/"
tar czf "$PKG.tar.gz" "$PKG"
sha256sum "$PKG.tar.gz" > "$PKG.tar.gz.sha256"
- name: create release and upload
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
API="${GITHUB_SERVER_URL}/api/v1/repos/${GITHUB_REPOSITORY}"
# Create the release if this matrix job is first; 409 = the
# other job already made it.
curl -sf -X POST "$API/releases" \
-H "Authorization: token $TOKEN" \
-H "Content-Type: application/json" \
-d "{\"tag_name\": \"${GITHUB_REF_NAME}\", \"name\": \"${GITHUB_REF_NAME}\", \"draft\": false}" \
|| true
RELEASE_ID=$(curl -sf "$API/releases/tags/${GITHUB_REF_NAME}" \
-H "Authorization: token $TOKEN" | jq .id)
for f in varde-*.tar.gz varde-*.tar.gz.sha256; do
curl -sf -X POST \
"$API/releases/${RELEASE_ID}/assets?name=$(basename "$f")" \
-H "Authorization: token $TOKEN" \
-F "attachment=@$f"
done