mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-11 16:30:24 +01:00
Some checks failed
🏗️ Build Apps / 🤖 Build Android APK (Phone) (push) Has been cancelled
🏗️ Build Apps / 🤖 Build Android APK (TV) (push) Has been cancelled
🏗️ Build Apps / 🍎 Build iOS IPA (Phone) (push) Has been cancelled
🏗️ Build Apps / 🍎 Build iOS IPA (Phone - Unsigned) (push) Has been cancelled
🏗️ Build Apps / 🍎 Build tvOS IPA (push) Has been cancelled
🏗️ Build Apps / 🍎 Build tvOS IPA (Unsigned) (push) Has been cancelled
🔒 Lockfile Consistency Check / 🔍 Check bun.lock and package.json consistency (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (actions) (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (javascript-typescript) (push) Has been cancelled
🏷️🔀Merge Conflict Labeler / 🏷️ Labeling Merge Conflicts (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (typecheck) (push) Has been cancelled
🛡️ Trivy Security Scan / 🔎 Filesystem scan (push) Has been cancelled
🚦 Security & Quality Gate / 📝 Validate PR Title (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Vulnerable Dependencies (push) Has been cancelled
🚦 Security & Quality Gate / 🚑 Expo Doctor Check (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (check) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (format) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (i18n:check) (push) Has been cancelled
🚦 Security & Quality Gate / 🔍 Lint & Test (lint) (push) Has been cancelled
Co-authored-by: retardgerman <78982850+retardgerman@users.noreply.github.com>
70 lines
1.8 KiB
JavaScript
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,
|
|
};
|
|
};
|