Release CI: libmpv/epoxy deps, stable Flutter, multipart asset upload

The v0.1.0 release job failed: media_kit_video needs libmpv-dev and
libepoxy-dev at build time. Build on stable (what's verified locally),
work on root-only runner images, upload the asset as Gitea's multipart
attachment, and reuse an existing release on re-runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
foxyzandClaude Opus 5.5 committed 2026-10-07 03:15:35 +03:00
1 parent 165cd2a7f9
commit 75d8651f17
2 files changed
+23 -14

No files matched your search

+8 -6
View File
@@ -14,15 +14,17 @@ jobs:
fetch-depth: 0
- name: Install Linux build deps
# media_kit_video links libmpv + epoxy via pkg-config. Runner images
# differ: some run as root without sudo.
run: |
if command -v apt-get >/dev/null; then
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev
fi
SUDO=sudo; [ "$(id -u)" = 0 ] && SUDO=
$SUDO apt-get update
$SUDO apt-get install -y clang cmake ninja-build pkg-config libgtk-3-dev \
liblzma-dev g++ libmpv-dev libepoxy-dev xz-utils unzip curl python3
- name: Setup Flutter (beta)
- name: Setup Flutter (stable)
run: |
git clone https://github.com/flutter/flutter.git -b beta --depth 1 ~/flutter
git clone https://github.com/flutter/flutter.git -b stable --depth 1 ~/flutter
echo "$HOME/flutter/bin" >> $GITHUB_PATH
- name: Build tarball
+15 -8
View File
@@ -35,15 +35,22 @@ else
fi
export REL_TAG="$TAG" REL_VER="$VER" REL_NOTES="$NOTES"
echo "creating release $TAG on $REPO ..."
REL_ID="$(curl -fsS -H "Authorization: token $TOKEN" -H 'Content-Type: application/json' \
-d "$(python3 -c 'import json,os; print(json.dumps({"tag_name": os.environ["REL_TAG"], "name": os.environ["REL_TAG"], "body": "Watch together " + os.environ["REL_VER"] + "\n\n" + os.environ["REL_NOTES"], "draft": False, "prerelease": False}))')" \
"$SERVER/api/v1/repos/$REPO/releases" \
| python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')"
API="$SERVER/api/v1/repos/$REPO"
# Re-runs reuse the release for this tag instead of failing on a duplicate.
REL_ID="$(curl -fsS -H "Authorization: token $TOKEN" "$API/releases/tags/$TAG" 2>/dev/null \
| python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])' 2>/dev/null || true)"
if [[ -z "$REL_ID" ]]; then
echo "creating release $TAG on $REPO ..."
REL_ID="$(curl -fsS -H "Authorization: token $TOKEN" -H 'Content-Type: application/json' \
-d "$(python3 -c 'import json,os; print(json.dumps({"tag_name": os.environ["REL_TAG"], "name": os.environ["REL_TAG"], "body": "Watch together " + os.environ["REL_VER"] + "\n\n" + os.environ["REL_NOTES"], "draft": False, "prerelease": False}))')" \
"$API/releases" \
| python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')"
fi
echo "release id: $REL_ID"
echo "uploading $ASSET ..."
curl -fsS -H "Authorization: token $TOKEN" -H 'Content-Type: application/gzip' \
--data-binary "@$TARBALL" \
"$SERVER/api/v1/repos/$REPO/releases/$REL_ID/assets?name=$ASSET" > /dev/null
# Gitea's asset API takes a multipart form with an `attachment` field.
curl -fsS -H "Authorization: token $TOKEN" \
-F "attachment=@$TARBALL;type=application/gzip" \
"$API/releases/$REL_ID/assets?name=$ASSET" > /dev/null
echo "published $TAG."