YouTube as a Fennec OS store app
Split from the Fennec OS repository (apps/youtube). The id is now support.bluefox.youtube; casting from a phone asks for the new `dial` permission. A tag (v1.2.3) builds and publishes the store release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
4
.gitattributes
vendored
Normal file
4
.gitattributes
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
* text=auto eol=lf
|
||||||
|
*.ttf binary
|
||||||
|
*.png binary
|
||||||
|
*.gpg binary
|
||||||
52
.gitea/workflows/release.yml
Normal file
52
.gitea/workflows/release.yml
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
# On a tag (v1.2.3): build the two store assets and publish them as a release.
|
||||||
|
#
|
||||||
|
# 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.
|
||||||
|
name: release
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ["v*"]
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: build
|
||||||
|
container:
|
||||||
|
image: docker.gitea.com/runner-images:ubuntu-latest
|
||||||
|
env:
|
||||||
|
W: /tmp/fennec-youtube
|
||||||
|
CARGO_HOME: /tmp/fennec-youtube/cargo
|
||||||
|
RUSTUP_HOME: /tmp/fennec-youtube/rustup
|
||||||
|
CARGO_TARGET_DIR: /tmp/fennec-youtube/target
|
||||||
|
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: sf-pack
|
||||||
|
run: |
|
||||||
|
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: |
|
||||||
|
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" | 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
|
||||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
/pkg
|
||||||
|
/dist
|
||||||
16
README.md
Normal file
16
README.md
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
# YouTube for Fennec OS
|
||||||
|
|
||||||
|
A YouTube TV-s felülete (`youtube.com/tv`) Fennec OS store appként. Telefonról a YouTube app cast gombjával is indítható (DIAL).
|
||||||
|
|
||||||
|
- **Típus:** web app. A csomagban csak az `app.toml` és az ikon van; a TV a beépített Chromiumban nyitja meg.
|
||||||
|
- **Engedélyek:** a web appok alapengedélyei (hálózat, grafika, hang), és `dial`: a telefon castolhat ide.
|
||||||
|
- **Telepítés a TV-n:** a Fennec katalógusból jön (`fennec/store`). Kézzel: Store → Források → `https://gitea.bluefox.support/fennec/youtube`.
|
||||||
|
|
||||||
|
## Kiadás
|
||||||
|
1. Emeld a `version`-t az `app.toml`-ban, és commitold.
|
||||||
|
2. Tegyél rá egy `v<verzió>` taget, és pushold.
|
||||||
|
3. A `.gitea/workflows/release.yml` megépíti a két release-fájlt (`sf-pack`, Fennec SDK), és release-t csinál belőlük.
|
||||||
|
|
||||||
|
Helyben: `./package.sh` (kell hozzá az `sf-pack`, lásd a script fejlécét). Az eredmény a `dist/` mappába kerül.
|
||||||
|
|
||||||
|
Az app leírása: [Fennec SDK, store-app-guide.md](https://gitea.bluefox.support/fennec/sdk/src/branch/main/docs/store-app-guide.md).
|
||||||
11
app.toml
11
app.toml
@@ -1,18 +1,23 @@
|
|||||||
id = "youtube"
|
# Fennec OS store app manifest (docs/store-app-guide.md in the Fennec SDK).
|
||||||
|
id = "support.bluefox.youtube"
|
||||||
name = "YouTube"
|
name = "YouTube"
|
||||||
|
# Release versions only (1.2.3). Bump it for every release.
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
kind = "web"
|
kind = "web"
|
||||||
category = "Videó · Castolható"
|
category = "Videó · Castolható"
|
||||||
description = "A YouTube TV-s felülete. Telefonról a YouTube appban a cast ikonnal küldhetsz ide videót."
|
description = "A YouTube TV-s felülete. Telefonról a YouTube appban a cast ikonnal küldhetsz ide videót."
|
||||||
|
author = "Bluefox"
|
||||||
|
license = "MIT"
|
||||||
|
homepage = "https://gitea.bluefox.support/fennec/youtube"
|
||||||
url = "https://www.youtube.com/tv"
|
url = "https://www.youtube.com/tv"
|
||||||
icon = "youtube"
|
icon = "icon.svg"
|
||||||
accent = "#FF2D2D"
|
accent = "#FF2D2D"
|
||||||
palette = ["#ff6a5c", "#a3121c", "#16070a"]
|
palette = ["#ff6a5c", "#a3121c", "#16070a"]
|
||||||
order = 20
|
|
||||||
|
|
||||||
[web]
|
[web]
|
||||||
# A Cobalt (TV) user agent makes YouTube serve its leanback UI.
|
# A Cobalt (TV) user agent makes YouTube serve its leanback UI.
|
||||||
user_agent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0 Safari/537.36 Cobalt/25.lts.30.1034943-gold (unlike Gecko), Unknown_TV_Unknown_0/Unknown (Fennec OS, SF1, Wired)"
|
user_agent = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0 Safari/537.36 Cobalt/25.lts.30.1034943-gold (unlike Gecko), Unknown_TV_Unknown_0/Unknown (Fennec OS, SF1, Wired)"
|
||||||
|
|
||||||
|
# The YouTube app on a phone casts here (asks for the `dial` permission).
|
||||||
[dial]
|
[dial]
|
||||||
name = "YouTube"
|
name = "YouTube"
|
||||||
|
|||||||
11
icon.svg
Normal file
11
icon.svg
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="256" height="256">
|
||||||
|
<!-- Simplified, original drawing of the play-button mark. -->
|
||||||
|
<defs>
|
||||||
|
<linearGradient id="red" x1="0.33" y1="0.03" x2="0.67" y2="0.97">
|
||||||
|
<stop offset="0" stop-color="#ff3b30"/>
|
||||||
|
<stop offset="1" stop-color="#d90d1d"/>
|
||||||
|
</linearGradient>
|
||||||
|
</defs>
|
||||||
|
<path d="M3 11.2C3 8.4 5 6.6 7.8 6.4 11.4 6.1 20.6 6.1 24.2 6.4 27 6.6 29 8.4 29 11.2v9.6c0 2.8-2 4.6-4.8 4.8-3.6.3-12.8.3-16.4 0C5 25.4 3 23.6 3 20.8z" fill="url(#red)"/>
|
||||||
|
<path d="M13.2 11.6v8.8l7.6-4.4z" fill="#ffffff"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 588 B |
12
package.sh
Executable file
12
package.sh
Executable file
@@ -0,0 +1,12 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Builds the two store release assets into dist/: app.toml and
|
||||||
|
# support.bluefox.youtube-<version>.tar.zst. Needs sf-pack (Fennec SDK):
|
||||||
|
# cargo install --locked --git https://gitea.bluefox.support/fennec/sdk --tag v0.1.0 sf-pack
|
||||||
|
set -euo pipefail
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
rm -rf pkg dist
|
||||||
|
mkdir -p pkg
|
||||||
|
cp app.toml icon.svg pkg/
|
||||||
|
sf-pack build pkg dist
|
||||||
|
sf-pack verify dist
|
||||||
Reference in New Issue
Block a user