Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 121 additions & 0 deletions .github/workflows/development-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
name: Development Debug APK

on:
push:
branches: [development]
pull_request:
branches: [development]
workflow_dispatch:

env:
EXPO_TOKEN: ${{ secrets.EXPO_TOKEN }}
NODE_OPTIONS: --openssl-legacy-provider

jobs:
build-dev-apk:
runs-on: ubuntu-latest
steps:
- name: 🏗 Checkout repository
uses: actions/checkout@v4

- name: 🏗 Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"

- name: 📦 Install dependencies
run: |
npm ci --include=dev
npm install -g eas-cli@latest

- name: 📱 Setup EAS build cache
uses: actions/cache@v3
with:
path: ~/.eas-build-local
key: ${{ runner.os }}-eas-build-local-${{ hashFiles('**/package.json') }}
restore-keys: |
${{ runner.os }}-eas-build-local-

- name: 🔄 Verify EAS CLI installation
run: |
echo "EAS CLI version:"
eas --version

- name: 📋 Fix package.json main entry
run: |
if ! command -v jq &> /dev/null; then
sudo apt-get update && sudo apt-get install -y jq
fi
cp package.json package.json.bak
jq '.main = "node_modules/expo/AppEntry.js"' package.json > package.json.tmp && mv package.json.tmp package.json
cat package.json | grep "main"

- name: 📋 Update metro.config.js for SVG support
run: |
if [ -f ./metro.config.js ]; then
cp ./metro.config.js ./metro.config.js.backup
cat > ./metro.config.js << 'EOFMARKER'
/* eslint-disable @typescript-eslint/no-var-requires */
const { getDefaultConfig } = require('expo/metro-config');
const config = getDefaultConfig(__dirname);
const { transformer, resolver } = config;
config.transformer = {
...transformer,
babelTransformerPath: require.resolve('react-native-svg-transformer/expo'),
};
config.resolver = {
...resolver,
assetExts: resolver.assetExts.filter(ext => ext !== 'svg'),
sourceExts: [...resolver.sourceExts, 'svg'],
};
module.exports = config;
EOFMARKER
fi

# ----------------------------------------------------------
# PREBUILD - Generate native Android files
# ----------------------------------------------------------
- name: 🏗 Run Prebuild (Generate Android files)
run: |
echo "Running prebuild to generate Android directory..."
npx expo prebuild --platform android --clean

# ----------------------------------------------------------
# DEVELOPMENT build - Debug APK only
# ----------------------------------------------------------
- name: 📱 Build Debug APK (development profile)
run: |
export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"

echo "Building debug APK for development branch using EAS cloud build..."

# Build and wait for completion
eas build --platform android --profile debug-apk --non-interactive --wait

echo "Development debug APK build completed! 🎉"
echo ""
echo "The development APK has been built successfully!"
echo "To download your debug APK:"
echo "1. Visit your EAS dashboard at: https://expo.dev/accounts/[your-account]/projects/streamify/builds"
echo "2. Look for the latest completed debug build"
echo "3. Click on it to download the APK file"
echo ""
echo "Alternatively, you can run: eas build:list --platform android --limit 5"
echo "to see your recent builds and their download links."
env:
NODE_ENV: development

- name: 🔍 Print Gradle log (if failed)
if: failure()
run: |
LOG=$(ls -t ./logs/*.log 2>/dev/null | head -n1)
if [ -f "$LOG" ]; then cat "$LOG"; else echo "No gradle log found"; fi

- name: 📦 Upload debug APK
if: always()
uses: actions/upload-artifact@v4
with:
name: app-dev-apk
path: ./**/*.apk
retention-days: 7
15 changes: 12 additions & 3 deletions .github/workflows/react-native-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ name: React Native CI/CD

on:
push:
branches: [main, master, development]
branches: [main, master]
paths-ignore:
- "**.md"
- "LICENSE"
- "docs/**"
pull_request:
branches: [main, master, development]
branches: [main, master]
workflow_dispatch:
inputs:
buildType:
Expand All @@ -32,7 +32,7 @@ jobs:

build-and-deploy:
needs: check-skip
if: (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')) || github.event_name == 'workflow_dispatch'
if: (github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')) || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: 🏗 Checkout repository
Expand Down Expand Up @@ -105,8 +105,15 @@ jobs:
# PRODUCTION build (standalone, offline, no Metro required)
# ----------------------------------------------------------

<<<<<<< HEAD
- name: 📱 Build Production APK (main/master)
if: >
(github.event.inputs.buildType == 'all' || github.event.inputs.buildType == 'prod-apk' || github.event_name == 'push')
&& (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
=======
- name: 📱 Build Production APK
if: github.event.inputs.buildType == 'all' || github.event.inputs.buildType == 'prod-apk' || github.event_name == 'push'
>>>>>>> 2477e6e38407734f1c6cfbcb833da731b0594232
run: |
export NODE_OPTIONS="--openssl-legacy-provider --max_old_space_size=4096"

Expand All @@ -129,6 +136,8 @@ jobs:
env:
NODE_ENV: production



- name: 🔍 Print Gradle log (if failed)
if: failure()
run: |
Expand Down
19 changes: 17 additions & 2 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";
import { enableScreens } from "react-native-screens";
import TrackPlayer from "react-native-track-player";
import TrackPlayer from "./utils/safeTrackPlayer";
import {
View,
TouchableOpacity,
Expand All @@ -23,6 +23,9 @@ import { MaterialIcons } from "@expo/vector-icons";
// Context
import { PlayerProvider } from "./contexts/PlayerContext";

// API
import { initializeDynamicInstances } from "./components/core/api";

// Components
import { MiniPlayer } from "./components/MiniPlayer";
import { FullPlayerModal } from "./components/FullPlayerModal";
Expand All @@ -43,7 +46,7 @@ enableScreens();
// Register the playback service for proper media session integration
try {
TrackPlayer.registerPlaybackService(() =>
require("./services/playbackService"),
require("./services/playbackService")
);
console.log("[App] Playback service registered successfully");
} catch (error) {
Expand Down Expand Up @@ -377,6 +380,18 @@ export default function App() {
GoogleSansSemiBold: require("./assets/fonts/GoogleSansSemiBold.ttf"),
GoogleSansBold: require("./assets/fonts/GoogleSansBold.ttf"),
});

// Fetch Invidious instances on app startup
useEffect(() => {
const fetchInstances = async () => {
console.log("[App] Fetching Invidious instances from Uma repository...");
await initializeDynamicInstances();
console.log("[App] Invidious instances update complete");
};

fetchInstances();
}, []);

// const [showLoadingScreen, setShowLoadingScreen] = useState(true);
// const [isLoadingComplete, setIsLoadingComplete] = useState(false);

Expand Down
1 change: 1 addition & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"expo": {
"newArchEnabled": false,
"name": "Streamify",
"slug": "streamify-mobile",
"scheme": "streamify",
Expand Down
1 change: 0 additions & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module.exports = function (api) {
return {
presets: ["babel-preset-expo"],
plugins: [
"react-native-reanimated/plugin",
[
"module:react-native-dotenv",
{
Expand Down
Loading
Loading