Build with the Fennec SDK instead of a Fennec OS checkout

sf-ui is a git dependency on fennec/sdk (v0.1.0), sf-pack comes from the
SDK too. The release CI no longer clones the OS (no SMARTFOX_TOKEN) and
runs in the runner image on the build runner, cleaning up after itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Tamas Csikel
2026-10-25 18:03:12 +01:00
parent 4a621558d8
commit 72d9412a85
4 changed files with 50 additions and 36 deletions

View File

@@ -1,41 +1,62 @@
# On a tag (v1.2.3): build inside a SmartFox checkout (sf-ui lives there),
# publish a release with the two store assets.
# On a tag (v1.2.3): build the app and publish a release with the two store
# assets. sf-ui and sf-pack come from the Fennec SDK (public).
#
# Secrets:
# SMARTFOX_TOKEN read access to bluefox/fox-in-the-box (it is private)
# Runner hygiene (shared host, little disk): runs in the runner image that is
# already on the host (no image pull), uses no `uses:` actions (no action
# cache), and deletes everything it made at the end. The image is Ubuntu
# 24.04: its glibc is older than the TV's (Debian trixie), so the binary runs.
name: release
on:
push:
tags: ["v*"]
jobs:
release:
runs-on: ubuntu-latest
runs-on: build
container:
image: debian:trixie
image: docker.gitea.com/runner-images:ubuntu-latest
env:
SMARTFOX_REPO: gitea.bluefox.support/bluefox/fox-in-the-box
W: /tmp/fennec-netflex
CARGO_HOME: /tmp/fennec-netflex/cargo
RUSTUP_HOME: /tmp/fennec-netflex/rustup
CARGO_TARGET_DIR: /tmp/fennec-netflex/target
CARGO_INCREMENTAL: "0"
SDK_GIT: https://gitea.bluefox.support/fennec/sdk
SDK_TAG: v0.1.0
steps:
- name: Checkout
run: |
mkdir -p "$W"
git clone --depth 1 --branch "$GITHUB_REF_NAME" \
"${GITHUB_SERVER_URL%%://*}://oauth2:${{ secrets.GITHUB_TOKEN }}@${GITHUB_SERVER_URL#*://}/${GITHUB_REPOSITORY}.git" "$W/src"
v=$(sed -n 's/^version *= *"\(.*\)".*/\1/p' "$W/src/app.toml" | head -1)
[ "v$v" = "$GITHUB_REF_NAME" ] || { echo "tag $GITHUB_REF_NAME, but app.toml says $v" >&2; exit 1; }
- name: Toolchain
run: |
export DEBIAN_FRONTEND=noninteractive
apt-get update -qq
apt-get install -y -qq --no-install-recommends build-essential pkg-config curl ca-certificates git jq \
apt-get install -y -qq --no-install-recommends build-essential pkg-config \
libfontconfig1-dev libfreetype-dev libxkbcommon-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev >/dev/null
git clone --depth 1 "https://oauth2:${{ secrets.SMARTFOX_TOKEN }}@${SMARTFOX_REPO}.git" work
git clone --depth 1 --branch "$GITHUB_REF_NAME" \
"${GITHUB_SERVER_URL%%://*}://oauth2:${{ secrets.GITHUB_TOKEN }}@${GITHUB_SERVER_URL#*://}/${GITHUB_REPOSITORY}.git" work/apps/netflex-tv
rm -rf /var/lib/apt/lists/*
curl -sSf https://sh.rustup.rs | sh -s -- -y -q --profile minimal --no-modify-path
"$CARGO_HOME/bin/cargo" install -q --locked --git "$SDK_GIT" --tag "$SDK_TAG" sf-pack
- name: Build
run: |
curl -sSf https://sh.rustup.rs | sh -s -- -y -q --profile minimal
export PATH="$HOME/.cargo/bin:$PATH"
cd work/apps/netflex-tv && ./package.sh
export PATH="$CARGO_HOME/bin:$PATH"
"$W/src/package.sh"
- name: Release
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
api="$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases"
id=$(curl -fsS -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \
-d "{\"tag_name\":\"$GITHUB_REF_NAME\",\"name\":\"$GITHUB_REF_NAME\"}" "$api" | jq -r .id)
for f in work/apps/netflex-tv/dist/*; do
-d "{\"tag_name\":\"$GITHUB_REF_NAME\",\"name\":\"$GITHUB_REF_NAME\"}" "$api" \
| grep -o '"id":[0-9]*' | head -1 | cut -d: -f2)
for f in "$W"/src/dist/*; do
curl -fsS -H "Authorization: token $TOKEN" -F "attachment=@$f" "$api/$id/assets?name=$(basename "$f")" >/dev/null
done
- name: Clean up
if: always()
run: |
rm -rf "$W"
df -h / | tail -1