mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-11 16:30:24 +01:00
Migrate the dynamic Expo config and all 12 local config plugins from CommonJS .js to typed TypeScript: - app.config.js -> app.config.ts (typed ConfigContext/ExpoConfig, behavior-identical port) - plugins/*.js -> plugins/*.ts with `ConfigPlugin` typings from expo/config-plugins; plugin options are now type-checked (withGitPod) - app.json plugin references updated to the .ts paths - imports unified on expo/config-plugins (some plugins used the @expo/config-plugins alias) Node evaluates the config at prebuild time and cannot parse TypeScript plugin modules on its own (verified empirically: Expo transpiles app.config.ts itself but not its imports), so the documented tsx approach is used: `import "tsx/cjs"` at the top of app.config.ts plus tsx as a devDependency. Validation: resolved prebuild configs (expo config --type prebuild) are byte-identical to the old JS config for both mobile and TV (modulo plugin path extensions and the builtAt timestamp); full `bun run prebuild` and `bun run prebuild:tv` pass and all Android plugin mods are present in the generated project (media3 exclusions, gradle properties, cast activity, network security config, alert colors).
442 lines
15 KiB
YAML
442 lines
15 KiB
YAML
name: 🏗️ Build Apps
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
pull_request:
|
|
branches: [develop, master]
|
|
push:
|
|
branches: [develop, master]
|
|
|
|
# Exposed to `expo prebuild` (app.config.ts → extra.build) so Settings can show the
|
|
# branch + commit + Actions run a CI build was made from. EAS cloud builds use
|
|
# EAS_BUILD_* instead. The run number maps a sideloaded build back to its Actions
|
|
# run (artifacts + logs) without needing Expo access.
|
|
env:
|
|
EXPO_PUBLIC_GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
|
|
EXPO_PUBLIC_GIT_COMMIT: ${{ github.sha }}
|
|
EXPO_PUBLIC_GIT_RUN_NUMBER: ${{ github.run_number }}
|
|
|
|
jobs:
|
|
build-android-phone:
|
|
if: (!contains(github.event.head_commit.message, '[skip ci]'))
|
|
runs-on: ubuntu-24.04
|
|
name: 🤖 Build Android APK (Phone)
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: 🗑️ Free Disk Space
|
|
uses: BRAINSia/free-disk-space@7048ffbf50819342ac964ef3998a51c2564a8a75 # v2.1.3
|
|
with:
|
|
tool-cache: false
|
|
mandb: true
|
|
android: false
|
|
dotnet: true
|
|
haskell: true
|
|
large-packages: true
|
|
docker-images: true
|
|
swap-storage: false
|
|
|
|
- name: 📥 Checkout code
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
show-progress: false
|
|
|
|
- name: 🍞 Setup Bun
|
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: 💾 Cache Bun dependencies
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: ~/.bun/install/cache
|
|
key: ${{ runner.os }}-${{ runner.arch }}-bun-develop-${{ hashFiles('bun.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ runner.arch }}-bun-develop
|
|
${{ runner.os }}-bun-develop
|
|
|
|
- name: 📦 Install dependencies and reload submodules
|
|
run: |
|
|
bun install --frozen-lockfile
|
|
bun run submodule-reload
|
|
|
|
- name: 💾 Cache Gradle global
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: 🛠️ Generate project files
|
|
run: bun run prebuild
|
|
|
|
- name: 💾 Cache project Gradle (.gradle)
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: android/.gradle
|
|
key: ${{ runner.os }}-android-gradle-develop-${{ hashFiles('android/**/build.gradle', 'android/gradle/wrapper/gradle-wrapper.properties') }}
|
|
restore-keys: ${{ runner.os }}-android-gradle-develop
|
|
|
|
- name: 🚀 Build APK
|
|
env:
|
|
EXPO_TV: 0
|
|
run: bun run build:android:local
|
|
|
|
- name: 📅 Set date tag
|
|
run: echo "DATE_TAG=$(date +%d-%m-%Y_%H-%M-%S)" >> $GITHUB_ENV
|
|
|
|
- name: 📤 Upload APK artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: streamyfin-android-phone-apk-${{ env.DATE_TAG }}
|
|
path: |
|
|
android/app/build/outputs/apk/release/*.apk
|
|
retention-days: 7
|
|
|
|
build-android-tv:
|
|
if: (!contains(github.event.head_commit.message, '[skip ci]'))
|
|
runs-on: ubuntu-24.04
|
|
name: 🤖 Build Android APK (TV)
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: 🗑️ Free Disk Space
|
|
uses: BRAINSia/free-disk-space@7048ffbf50819342ac964ef3998a51c2564a8a75 # v2.1.3
|
|
with:
|
|
tool-cache: false
|
|
mandb: true
|
|
android: false
|
|
dotnet: true
|
|
haskell: true
|
|
large-packages: true
|
|
docker-images: true
|
|
swap-storage: false
|
|
|
|
- name: 📥 Checkout code
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
show-progress: false
|
|
|
|
- name: 🍞 Setup Bun
|
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: 💾 Cache Bun dependencies
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: ~/.bun/install/cache
|
|
key: ${{ runner.os }}-${{ runner.arch }}-bun-develop-${{ hashFiles('bun.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ runner.arch }}-bun-develop
|
|
${{ runner.os }}-bun-develop
|
|
|
|
- name: 📦 Install dependencies and reload submodules
|
|
run: |
|
|
bun install --frozen-lockfile
|
|
bun run submodule-reload
|
|
|
|
- name: 💾 Cache Gradle global
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: |
|
|
~/.gradle/caches
|
|
~/.gradle/wrapper
|
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gradle-
|
|
|
|
- name: 🛠️ Generate project files
|
|
run: bun run prebuild:tv
|
|
|
|
- name: 💾 Cache project Gradle (.gradle)
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: android/.gradle
|
|
key: ${{ runner.os }}-android-gradle-develop-${{ hashFiles('android/**/build.gradle', 'android/gradle/wrapper/gradle-wrapper.properties') }}
|
|
restore-keys: ${{ runner.os }}-android-gradle-develop
|
|
|
|
- name: 🚀 Build APK
|
|
env:
|
|
EXPO_TV: 1
|
|
run: bun run build:android:local
|
|
|
|
- name: 📅 Set date tag
|
|
run: echo "DATE_TAG=$(date +%d-%m-%Y_%H-%M-%S)" >> $GITHUB_ENV
|
|
|
|
- name: 📤 Upload APK artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: streamyfin-android-tv-apk-${{ env.DATE_TAG }}
|
|
path: |
|
|
android/app/build/outputs/apk/release/*.apk
|
|
retention-days: 7
|
|
|
|
build-ios-phone:
|
|
if: (!contains(github.event.head_commit.message, '[skip ci]') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'streamyfin/streamyfin'))
|
|
runs-on: macos-26
|
|
name: 🍎 Build iOS IPA (Phone)
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: 📥 Checkout code
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
show-progress: false
|
|
|
|
- name: 🍞 Setup Bun
|
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: 💾 Cache Bun dependencies
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: ~/.bun/install/cache
|
|
key: ${{ runner.os }}-bun-cache-${{ hashFiles('bun.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-bun-cache
|
|
|
|
- name: 📦 Install dependencies and reload submodules
|
|
run: |
|
|
bun install --frozen-lockfile
|
|
bun run submodule-reload
|
|
|
|
- name: 🛠️ Generate project files
|
|
run: bun run prebuild
|
|
|
|
- name: 🔧 Setup Xcode
|
|
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1
|
|
with:
|
|
# renovate: datasource=custom.xcode depName=xcode versioning=loose
|
|
xcode-version: "26.5"
|
|
|
|
- name: 🏗️ Setup EAS
|
|
uses: expo/expo-github-action@eab7a230208c952974db8c3245cfd78402c7b385 # main
|
|
with:
|
|
eas-version: latest
|
|
token: ${{ secrets.EXPO_TOKEN }}
|
|
eas-cache: true
|
|
|
|
- name: 🚀 Build iOS app
|
|
env:
|
|
EXPO_TV: 0
|
|
# `ci` profile (extends production, autoIncrement off): keeps CI builds out of
|
|
# the production version tier and stops them inflating the store build counter.
|
|
run: eas build -p ios --local --non-interactive --profile ci
|
|
|
|
- name: 📅 Set date tag
|
|
run: echo "DATE_TAG=$(date +%d-%m-%Y_%H-%M-%S)" >> $GITHUB_ENV
|
|
|
|
- name: 📤 Upload IPA artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: streamyfin-ios-phone-ipa-${{ env.DATE_TAG }}
|
|
path: build-*.ipa
|
|
retention-days: 7
|
|
|
|
build-ios-phone-unsigned:
|
|
if: (!contains(github.event.head_commit.message, '[skip ci]'))
|
|
runs-on: macos-26
|
|
name: 🍎 Build iOS IPA (Phone - Unsigned)
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: 📥 Checkout code
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
show-progress: false
|
|
|
|
- name: 🍞 Setup Bun
|
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: 💾 Cache Bun dependencies
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: ~/.bun/install/cache
|
|
key: ${{ runner.os }}-bun-cache-${{ hashFiles('bun.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-bun-cache
|
|
|
|
- name: 📦 Install dependencies and reload submodules
|
|
run: |
|
|
bun install --frozen-lockfile
|
|
bun run submodule-reload
|
|
|
|
- name: 🛠️ Generate project files
|
|
run: bun run prebuild
|
|
|
|
- name: 🔧 Setup Xcode
|
|
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1
|
|
with:
|
|
# renovate: datasource=custom.xcode depName=xcode versioning=loose
|
|
xcode-version: "26.5"
|
|
|
|
- name: 🚀 Build iOS app
|
|
env:
|
|
EXPO_TV: 0
|
|
run: bun run ios:unsigned-build ${{ github.event_name == 'pull_request' && '-- --verbose' || '' }}
|
|
|
|
- name: 📅 Set date tag
|
|
run: echo "DATE_TAG=$(date +%d-%m-%Y_%H-%M-%S)" >> $GITHUB_ENV
|
|
|
|
- name: 📤 Upload IPA artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: streamyfin-ios-phone-unsigned-ipa-${{ env.DATE_TAG }}
|
|
path: build/*.ipa
|
|
retention-days: 7
|
|
|
|
build-ios-tv:
|
|
# Temporarily disabled until feat/tv-interface is merged (TV UI not ready).
|
|
# Re-enable by removing the `false &&` prefix below.
|
|
if: false && (!contains(github.event.head_commit.message, '[skip ci]') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'streamyfin/streamyfin'))
|
|
runs-on: macos-26
|
|
name: 🍎 Build tvOS IPA
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: 📥 Checkout code
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
show-progress: false
|
|
|
|
- name: 🍞 Setup Bun
|
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: 💾 Cache Bun dependencies
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: ~/.bun/install/cache
|
|
key: ${{ runner.os }}-bun-cache-${{ hashFiles('bun.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-bun-cache
|
|
|
|
- name: 📦 Install dependencies and reload submodules
|
|
run: |
|
|
bun install --frozen-lockfile
|
|
bun run submodule-reload
|
|
|
|
- name: 🛠️ Generate project files
|
|
run: bun run prebuild:tv
|
|
|
|
- name: 🔧 Setup Xcode
|
|
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1
|
|
with:
|
|
# renovate: datasource=custom.xcode depName=xcode versioning=loose
|
|
xcode-version: "26.5"
|
|
|
|
- name: 🏗️ Setup EAS
|
|
uses: expo/expo-github-action@eab7a230208c952974db8c3245cfd78402c7b385 # main
|
|
with:
|
|
eas-version: latest
|
|
token: ${{ secrets.EXPO_TOKEN }}
|
|
eas-cache: true
|
|
|
|
- name: 🚀 Build iOS app
|
|
env:
|
|
EXPO_TV: 1
|
|
run: eas build -p ios --local --non-interactive --profile ci_tv
|
|
|
|
- name: 📅 Set date tag
|
|
run: echo "DATE_TAG=$(date +%d-%m-%Y_%H-%M-%S)" >> $GITHUB_ENV
|
|
|
|
- name: 📤 Upload IPA artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: streamyfin-ios-tv-ipa-${{ env.DATE_TAG }}
|
|
path: build-*.ipa
|
|
retention-days: 7
|
|
|
|
build-ios-tv-unsigned:
|
|
# Unsigned tvOS build is enabled (compiles without Apple credentials).
|
|
# The signed tvOS job above stays disabled until tvOS provisioning
|
|
# profiles are set up in EAS (app + TopShelf targets).
|
|
if: (!contains(github.event.head_commit.message, '[skip ci]'))
|
|
runs-on: macos-26
|
|
name: 🍎 Build tvOS IPA (Unsigned)
|
|
permissions:
|
|
contents: read
|
|
|
|
steps:
|
|
- name: 📥 Checkout code
|
|
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha || github.sha }}
|
|
fetch-depth: 0
|
|
submodules: recursive
|
|
show-progress: false
|
|
|
|
- name: 🍞 Setup Bun
|
|
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
|
|
with:
|
|
bun-version: latest
|
|
|
|
- name: 💾 Cache Bun dependencies
|
|
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
|
|
with:
|
|
path: ~/.bun/install/cache
|
|
key: ${{ runner.os }}-bun-cache-${{ hashFiles('bun.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-bun-cache
|
|
|
|
- name: 📦 Install dependencies and reload submodules
|
|
run: |
|
|
bun install --frozen-lockfile
|
|
bun run submodule-reload
|
|
|
|
- name: 🛠️ Generate project files
|
|
run: bun run prebuild:tv
|
|
|
|
- name: 🔧 Setup Xcode
|
|
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1
|
|
with:
|
|
# renovate: datasource=custom.xcode depName=xcode versioning=loose
|
|
xcode-version: "26.5"
|
|
|
|
- name: 🚀 Build iOS app
|
|
env:
|
|
EXPO_TV: 1
|
|
run: bun run ios:unsigned-build:tv ${{ github.event_name == 'pull_request' && '-- --verbose' || '' }}
|
|
|
|
- name: 📅 Set date tag
|
|
run: echo "DATE_TAG=$(date +%d-%m-%Y_%H-%M-%S)" >> $GITHUB_ENV
|
|
|
|
- name: 📤 Upload IPA artifact
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
with:
|
|
name: streamyfin-ios-tv-unsigned-ipa-${{ env.DATE_TAG }}
|
|
path: build/*.ipa
|
|
retention-days: 7
|