Files
streamyfin/app.config.js
Gauvino 64105a8bac feat(settings): graduated version tracking + Jellyfin clientInfo auto-sync
Settings "App version" now shows a graduated build identifier (utils/version.ts,
read defensively so it never crashes the screen):
- dev / local            -> "0.54.1 - branch - commit"
- develop / CI / preview  -> "0.54.1 - commit"
- production (store/TestFlight) -> "0.54.1 (42)"

app.config.js injects extra.build {commit, branch, profile, builtAt} from
EAS_BUILD_* / GITHUB_* / local git; build-apps.yml passes the PR branch+commit.
JellyfinProvider now sends APP_VERSION (auto-synced from expo-application) in its
clientInfo/auth header instead of a hardcoded "0.54.1". Version scheme unchanged.
2026-06-09 16:11:59 +02:00

70 lines
1.8 KiB
JavaScript

const { execFileSync } = require("node:child_process");
// Build metadata, injected into `extra.build` and read at runtime via
// expo-constants (see utils/version.ts). Sources in priority order:
// EAS cloud build → GitHub Actions → explicit EXPO_PUBLIC_* → local git → null.
const git = (args) => {
try {
return execFileSync("git", args, { stdio: ["ignore", "pipe", "ignore"] })
.toString()
.trim();
} catch {
return null;
}
};
const buildMeta = {
commit:
(
process.env.EAS_BUILD_GIT_COMMIT_HASH ||
process.env.GITHUB_SHA ||
process.env.EXPO_PUBLIC_GIT_COMMIT ||
git(["rev-parse", "HEAD"]) ||
""
).slice(0, 7) || null,
branch:
process.env.EAS_BUILD_GIT_BRANCH ||
process.env.GITHUB_HEAD_REF ||
process.env.GITHUB_REF_NAME ||
process.env.EXPO_PUBLIC_GIT_BRANCH ||
git(["rev-parse", "--abbrev-ref", "HEAD"]) ||
null,
profile:
process.env.EAS_BUILD_PROFILE ||
process.env.EXPO_PUBLIC_BUILD_PROFILE ||
null,
builtAt: new Date().toISOString(),
};
module.exports = ({ config }) => {
if (process.env.EXPO_TV !== "1") {
config.plugins.push("expo-background-task");
config.plugins.push([
"react-native-google-cast",
{ useDefaultExpandedMediaControls: true },
]);
config.plugins.push([
"expo-camera",
{
cameraPermission:
"Allow Streamyfin to access the camera to scan QR codes for TV login.",
},
]);
}
// Only override googleServicesFile if env var is set
const androidConfig = {};
if (process.env.GOOGLE_SERVICES_JSON) {
androidConfig.googleServicesFile = process.env.GOOGLE_SERVICES_JSON;
}
config.extra = { ...config.extra, build: buildMeta };
return {
...(Object.keys(androidConfig).length > 0 && { android: androidConfig }),
...config,
};
};