mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-06-11 08:20:25 +01:00
Compare commits
1 Commits
ci/auto-up
...
feat/ci-bu
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b04cd5541a |
11
.github/workflows/build-apps.yml
vendored
11
.github/workflows/build-apps.yml
vendored
@@ -12,10 +12,13 @@ on:
|
|||||||
branches: [develop, master]
|
branches: [develop, master]
|
||||||
|
|
||||||
# Exposed to `expo prebuild` (app.config.js → extra.build) so Settings can show the
|
# Exposed to `expo prebuild` (app.config.js → extra.build) so Settings can show the
|
||||||
# branch + commit a CI build was made from. EAS cloud builds use EAS_BUILD_* instead.
|
# 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:
|
env:
|
||||||
EXPO_PUBLIC_GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
|
EXPO_PUBLIC_GIT_BRANCH: ${{ github.head_ref || github.ref_name }}
|
||||||
EXPO_PUBLIC_GIT_COMMIT: ${{ github.sha }}
|
EXPO_PUBLIC_GIT_COMMIT: ${{ github.sha }}
|
||||||
|
EXPO_PUBLIC_GIT_RUN_NUMBER: ${{ github.run_number }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-android-phone:
|
build-android-phone:
|
||||||
@@ -237,7 +240,9 @@ jobs:
|
|||||||
- name: 🚀 Build iOS app
|
- name: 🚀 Build iOS app
|
||||||
env:
|
env:
|
||||||
EXPO_TV: 0
|
EXPO_TV: 0
|
||||||
run: eas build -p ios --local --non-interactive
|
# `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
|
- name: 📅 Set date tag
|
||||||
run: echo "DATE_TAG=$(date +%d-%m-%Y_%H-%M-%S)" >> $GITHUB_ENV
|
run: echo "DATE_TAG=$(date +%d-%m-%Y_%H-%M-%S)" >> $GITHUB_ENV
|
||||||
@@ -362,7 +367,7 @@ jobs:
|
|||||||
- name: 🚀 Build iOS app
|
- name: 🚀 Build iOS app
|
||||||
env:
|
env:
|
||||||
EXPO_TV: 1
|
EXPO_TV: 1
|
||||||
run: eas build -p ios --local --non-interactive
|
run: eas build -p ios --local --non-interactive --profile ci_tv
|
||||||
|
|
||||||
- name: 📅 Set date tag
|
- name: 📅 Set date tag
|
||||||
run: echo "DATE_TAG=$(date +%d-%m-%Y_%H-%M-%S)" >> $GITHUB_ENV
|
run: echo "DATE_TAG=$(date +%d-%m-%Y_%H-%M-%S)" >> $GITHUB_ENV
|
||||||
|
|||||||
@@ -33,6 +33,12 @@ const buildMeta = {
|
|||||||
process.env.EAS_BUILD_PROFILE ||
|
process.env.EAS_BUILD_PROFILE ||
|
||||||
process.env.EXPO_PUBLIC_BUILD_PROFILE ||
|
process.env.EXPO_PUBLIC_BUILD_PROFILE ||
|
||||||
null,
|
null,
|
||||||
|
// GitHub Actions run number (#2098) — lets anyone map a sideloaded CI build back
|
||||||
|
// to its Actions run (artifacts + logs) without Expo access. Null outside CI.
|
||||||
|
runNumber:
|
||||||
|
process.env.GITHUB_RUN_NUMBER ||
|
||||||
|
process.env.EXPO_PUBLIC_GIT_RUN_NUMBER ||
|
||||||
|
null,
|
||||||
builtAt: new Date().toISOString(),
|
builtAt: new Date().toISOString(),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export const UserInfo: React.FC<Props> = ({ ...props }) => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
// Graduated build identifier — see utils/version.ts:
|
// Graduated build identifier — see utils/version.ts:
|
||||||
// dev → "0.54.1 · branch · commit", develop/CI → "0.54.1 · commit", production → "0.54.1 (42)".
|
// dev → "0.54.1 · branch · commit", develop/CI → "0.54.1 · commit · #run", production → "0.54.1".
|
||||||
const { display: version } = getVersionInfo();
|
const { display: version } = getVersionInfo();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
8
eas.json
8
eas.json
@@ -97,6 +97,14 @@
|
|||||||
"credentialsSource": "local",
|
"credentialsSource": "local",
|
||||||
"config": "ios-production.yml"
|
"config": "ios-production.yml"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"ci": {
|
||||||
|
"extends": "production",
|
||||||
|
"autoIncrement": false
|
||||||
|
},
|
||||||
|
"ci_tv": {
|
||||||
|
"extends": "production_tv",
|
||||||
|
"autoIncrement": false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"submit": {
|
"submit": {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export interface BuildMeta {
|
|||||||
commit?: string | null;
|
commit?: string | null;
|
||||||
branch?: string | null;
|
branch?: string | null;
|
||||||
profile?: string | null;
|
profile?: string | null;
|
||||||
|
runNumber?: string | null;
|
||||||
builtAt?: string | null;
|
builtAt?: string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -22,8 +23,10 @@ export interface VersionInfo {
|
|||||||
commit: string | null;
|
commit: string | null;
|
||||||
/** Git branch the build was made from, e.g. "develop". */
|
/** Git branch the build was made from, e.g. "develop". */
|
||||||
branch: string | null;
|
branch: string | null;
|
||||||
/** EAS build profile, e.g. "production", "preview", or null for local. */
|
/** EAS build profile, e.g. "production", "ci", "preview", or null for local. */
|
||||||
profile: string | null;
|
profile: string | null;
|
||||||
|
/** GitHub Actions run number the build came from, e.g. "2098". Null outside CI. */
|
||||||
|
runNumber: string | null;
|
||||||
isDev: boolean;
|
isDev: boolean;
|
||||||
isProduction: boolean;
|
isProduction: boolean;
|
||||||
/** Graduated label for the Settings "App version" row (see tiering below). */
|
/** Graduated label for the Settings "App version" row (see tiering below). */
|
||||||
@@ -34,13 +37,13 @@ export interface VersionInfo {
|
|||||||
* Resolve a graduated version string for Settings.
|
* Resolve a graduated version string for Settings.
|
||||||
*
|
*
|
||||||
* Tiering (most → least detailed):
|
* Tiering (most → least detailed):
|
||||||
* - dev / local build → `version · branch · commit` (full context for debugging)
|
* - dev / local build → `version · branch · commit` (full context for debugging)
|
||||||
* - develop / CI / preview → `version · commit` (pin the exact source)
|
* - develop / CI / preview → `version · commit · #run` (pin the exact source; the
|
||||||
* - production (store / TestFlight) → `version (build)` (store-correlatable; the
|
* Actions run number maps the build to its run — artifacts + logs — without
|
||||||
* build number lets TestFlight reports pin a build whose version isn't a
|
* Expo access)
|
||||||
* published release. Note: TestFlight and the public App Store ship the same
|
* - production (store / TestFlight) → `version` (build number intentionally
|
||||||
* binary — telling them apart needs a runtime iOS receipt check, intentionally
|
* not shown: TestFlight already displays it to testers, and the commit pins the
|
||||||
* not done here.)
|
* binary better)
|
||||||
*/
|
*/
|
||||||
export function getVersionInfo(): VersionInfo {
|
export function getVersionInfo(): VersionInfo {
|
||||||
// Read native/config values defensively — a version string must never crash Settings
|
// Read native/config values defensively — a version string must never crash Settings
|
||||||
@@ -60,6 +63,7 @@ export function getVersionInfo(): VersionInfo {
|
|||||||
const commit = meta.commit ?? null;
|
const commit = meta.commit ?? null;
|
||||||
const branch = meta.branch ?? null;
|
const branch = meta.branch ?? null;
|
||||||
const profile = meta.profile ?? null;
|
const profile = meta.profile ?? null;
|
||||||
|
const runNumber = meta.runNumber ?? null;
|
||||||
const isDev = __DEV__ === true;
|
const isDev = __DEV__ === true;
|
||||||
const isProduction =
|
const isProduction =
|
||||||
typeof profile === "string" && profile.startsWith("production");
|
typeof profile === "string" && profile.startsWith("production");
|
||||||
@@ -68,10 +72,12 @@ export function getVersionInfo(): VersionInfo {
|
|||||||
if (isDev) {
|
if (isDev) {
|
||||||
display = [version ?? "dev", branch, commit].filter(Boolean).join(" · ");
|
display = [version ?? "dev", branch, commit].filter(Boolean).join(" · ");
|
||||||
} else if (isProduction) {
|
} else if (isProduction) {
|
||||||
display =
|
display = version ?? build ?? "N/A";
|
||||||
version && build ? `${version} (${build})` : (version ?? build ?? "N/A");
|
|
||||||
} else {
|
} else {
|
||||||
display = [version, commit].filter(Boolean).join(" · ") || version || "N/A";
|
display =
|
||||||
|
[version, commit, runNumber && `#${runNumber}`]
|
||||||
|
.filter(Boolean)
|
||||||
|
.join(" · ") || "N/A";
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -80,6 +86,7 @@ export function getVersionInfo(): VersionInfo {
|
|||||||
commit,
|
commit,
|
||||||
branch,
|
branch,
|
||||||
profile,
|
profile,
|
||||||
|
runNumber,
|
||||||
isDev,
|
isDev,
|
||||||
isProduction,
|
isProduction,
|
||||||
display,
|
display,
|
||||||
|
|||||||
Reference in New Issue
Block a user