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:
@@ -1,41 +1,62 @@
|
|||||||
# On a tag (v1.2.3): build inside a SmartFox checkout (sf-ui lives there),
|
# On a tag (v1.2.3): build the app and publish a release with the two store
|
||||||
# publish a release with the two store assets.
|
# assets. sf-ui and sf-pack come from the Fennec SDK (public).
|
||||||
#
|
#
|
||||||
# Secrets:
|
# Runner hygiene (shared host, little disk): runs in the runner image that is
|
||||||
# SMARTFOX_TOKEN read access to bluefox/fox-in-the-box (it is private)
|
# 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
|
name: release
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags: ["v*"]
|
tags: ["v*"]
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: build
|
||||||
container:
|
container:
|
||||||
image: debian:trixie
|
image: docker.gitea.com/runner-images:ubuntu-latest
|
||||||
env:
|
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:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
run: |
|
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 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 \
|
libfontconfig1-dev libfreetype-dev libxkbcommon-dev \
|
||||||
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev >/dev/null
|
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev >/dev/null
|
||||||
git clone --depth 1 "https://oauth2:${{ secrets.SMARTFOX_TOKEN }}@${SMARTFOX_REPO}.git" work
|
rm -rf /var/lib/apt/lists/*
|
||||||
git clone --depth 1 --branch "$GITHUB_REF_NAME" \
|
curl -sSf https://sh.rustup.rs | sh -s -- -y -q --profile minimal --no-modify-path
|
||||||
"${GITHUB_SERVER_URL%%://*}://oauth2:${{ secrets.GITHUB_TOKEN }}@${GITHUB_SERVER_URL#*://}/${GITHUB_REPOSITORY}.git" work/apps/netflex-tv
|
"$CARGO_HOME/bin/cargo" install -q --locked --git "$SDK_GIT" --tag "$SDK_TAG" sf-pack
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
curl -sSf https://sh.rustup.rs | sh -s -- -y -q --profile minimal
|
export PATH="$CARGO_HOME/bin:$PATH"
|
||||||
export PATH="$HOME/.cargo/bin:$PATH"
|
"$W/src/package.sh"
|
||||||
cd work/apps/netflex-tv && ./package.sh
|
|
||||||
- name: Release
|
- name: Release
|
||||||
env:
|
env:
|
||||||
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
api="$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases"
|
api="$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY/releases"
|
||||||
id=$(curl -fsS -H "Authorization: token $TOKEN" -H "Content-Type: application/json" \
|
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)
|
-d "{\"tag_name\":\"$GITHUB_REF_NAME\",\"name\":\"$GITHUB_REF_NAME\"}" "$api" \
|
||||||
for f in work/apps/netflex-tv/dist/*; do
|
| 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
|
curl -fsS -H "Authorization: token $TOKEN" -F "attachment=@$f" "$api/$id/assets?name=$(basename "$f")" >/dev/null
|
||||||
done
|
done
|
||||||
|
- name: Clean up
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
rm -rf "$W"
|
||||||
|
df -h / | tail -1
|
||||||
|
|||||||
3
Cargo.lock
generated
3
Cargo.lock
generated
@@ -4864,7 +4864,8 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "sf-ui"
|
name = "sf-ui"
|
||||||
version = "0.2.1"
|
version = "0.1.0"
|
||||||
|
source = "git+https://gitea.bluefox.support/fennec/sdk?tag=v0.1.0#f00e8c68479ec5271d06be5737d5c60a831c944e"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"glow 0.16.0",
|
"glow 0.16.0",
|
||||||
|
|||||||
12
Cargo.toml
12
Cargo.toml
@@ -8,11 +8,9 @@ license = "GPL-3.0-only"
|
|||||||
publish = false
|
publish = false
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# The SmartFox UI kit: Liquid Glass, TV components, images. This repository
|
# The Fennec OS UI kit (Fennec SDK): Liquid Glass, TV components, images.
|
||||||
# is built inside a SmartFox checkout, at apps/netflex-tv (the release CI
|
# Working on sf-ui next to this app: see README.md.
|
||||||
# clones SmartFox and puts it there). With a public sf-ui this can become
|
sf-ui = { git = "https://gitea.bluefox.support/fennec/sdk", tag = "v0.1.0" }
|
||||||
# a git dependency: sf-ui = { git = "<SmartFox repo URL>" }.
|
|
||||||
sf-ui = { path = "../../crates/sf-ui" }
|
|
||||||
slint = "1.18"
|
slint = "1.18"
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
@@ -24,7 +22,7 @@ ureq = { version = "3", features = ["json"] }
|
|||||||
|
|
||||||
# Video playback (GStreamer) only on Linux, the TV.
|
# Video playback (GStreamer) only on Linux, the TV.
|
||||||
[target.'cfg(target_os = "linux")'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
sf-ui = { path = "../../crates/sf-ui", features = ["video"] }
|
sf-ui = { git = "https://gitea.bluefox.support/fennec/sdk", tag = "v0.1.0", features = ["video"] }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
slint-build = "1.18"
|
slint-build = "1.18"
|
||||||
@@ -33,5 +31,5 @@ slint-build = "1.18"
|
|||||||
lto = "thin"
|
lto = "thin"
|
||||||
strip = true
|
strip = true
|
||||||
|
|
||||||
# Not part of the SmartFox workspace: this is its own repository.
|
# Its own workspace (not part of any checkout around it).
|
||||||
[workspace]
|
[workspace]
|
||||||
|
|||||||
18
package.sh
18
package.sh
@@ -2,9 +2,10 @@
|
|||||||
# Builds the two store release assets into dist/: app.toml and
|
# Builds the two store release assets into dist/: app.toml and
|
||||||
# support.bluefox.netflex-<version>.tar.zst.
|
# support.bluefox.netflex-<version>.tar.zst.
|
||||||
#
|
#
|
||||||
# Runs inside a SmartFox checkout (this repo at apps/netflex-tv), on Debian
|
# Build on Debian trixie or older (the TV's glibc), with the GStreamer dev
|
||||||
# trixie or older (the TV's glibc), with the GStreamer dev packages:
|
# packages (libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev) and
|
||||||
# libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
|
# sf-pack from the Fennec SDK:
|
||||||
|
# cargo install --locked --git https://gitea.bluefox.support/fennec/sdk --tag v0.1.0 sf-pack
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
@@ -14,12 +15,5 @@ rm -rf pkg dist
|
|||||||
mkdir -p pkg/bin
|
mkdir -p pkg/bin
|
||||||
cp app.toml icon.png pkg/
|
cp app.toml icon.png pkg/
|
||||||
install -m755 "$target/release/netflex-tv" pkg/bin/netflex-tv
|
install -m755 "$target/release/netflex-tv" pkg/bin/netflex-tv
|
||||||
|
sf-pack build pkg dist
|
||||||
# sf-pack from PATH, else the one in the SmartFox checkout around us.
|
sf-pack verify dist
|
||||||
if command -v sf-pack >/dev/null; then
|
|
||||||
pack=(sf-pack)
|
|
||||||
else
|
|
||||||
pack=(cargo run -q --release --manifest-path ../../Cargo.toml -p sf-pack --)
|
|
||||||
fi
|
|
||||||
"${pack[@]}" build pkg dist
|
|
||||||
"${pack[@]}" verify dist
|
|
||||||
|
|||||||
Reference in New Issue
Block a user