Update main.yml
This commit is contained in:
parent
bb203afaeb
commit
8852ba83a4
1 changed files with 28 additions and 13 deletions
41
.github/workflows/main.yml
vendored
41
.github/workflows/main.yml
vendored
|
|
@ -23,6 +23,34 @@ jobs:
|
|||
npm install --legacy-peer-deps --ignore-scripts
|
||||
npm install react-native-svg expo-updates --legacy-peer-deps --ignore-scripts
|
||||
|
||||
- name: Force Fix JSX Syntax (Player.tsx)
|
||||
run: |
|
||||
# Используем Python для более умной замены, чтобы не плодить вложенные фрагменты
|
||||
python3 -c "
|
||||
import os
|
||||
path = 'components/Player.tsx'
|
||||
if os.path.exists(path):
|
||||
with open(path, 'r') as f:
|
||||
content = f.read()
|
||||
|
||||
# Убираем возможные кривые фрагменты из прошлого билда
|
||||
content = content.replace('<><Text', '<Text').replace('</Text></>', '</Text>')
|
||||
|
||||
# Находим блок с таймингами и оборачиваем его ОДИН РАЗ
|
||||
old_block = '<Text style={s.timeText}>{fmt(progress)}</Text>\n <Text style={s.timeText}>{fmt(duration)}</Text>'
|
||||
new_block = '<>\n <Text style={s.timeText}>{fmt(progress)}</Text>\n <Text style={s.timeText}>{fmt(duration)}</Text>\n </>'
|
||||
|
||||
if old_block in content:
|
||||
content = content.replace(old_block, new_block)
|
||||
else:
|
||||
# Запасной вариант, если отступы другие
|
||||
content = content.replace('{fmt(progress)}</Text>', '{fmt(progress)}</Text>').replace('<Text style={s.timeText}>{fmt(progress)}', '<><Text style={s.timeText}>{fmt(progress)}')
|
||||
content = content.replace('{fmt(duration)}</Text>', '{fmt(duration)}</Text></>')
|
||||
|
||||
with open(path, 'w') as f:
|
||||
f.write(content)
|
||||
"
|
||||
|
||||
- name: Prepare app.json
|
||||
run: |
|
||||
cat << 'EOF' > app.json
|
||||
|
|
@ -54,18 +82,6 @@ jobs:
|
|||
};
|
||||
EOF
|
||||
|
||||
- name: Patch Player Syntax
|
||||
run: |
|
||||
node -e "
|
||||
const fs = require('fs');
|
||||
const p = 'components/Player.tsx';
|
||||
if (fs.existsSync(p)) {
|
||||
let c = fs.readFileSync(p, 'utf8');
|
||||
c = c.replace(/<Text[^>]*>\{fmt\(progress\)\}<\/Text>\s*<Text[^>]*>\{fmt\(duration\)\}<\/Text>/, m => '<>' + m + '</>');
|
||||
fs.writeFileSync(p, c, 'utf8');
|
||||
}
|
||||
"
|
||||
|
||||
- name: Expo prebuild
|
||||
run: npx expo prebuild --platform ios --clean --no-install
|
||||
|
||||
|
|
@ -86,7 +102,6 @@ jobs:
|
|||
run: |
|
||||
WORKSPACE_PATH=$(find ios -maxdepth 1 -name "*.xcworkspace" | head -1)
|
||||
SCHEME_NAME=$(basename "$WORKSPACE_PATH" .xcworkspace)
|
||||
|
||||
export NODE_BINARY=$(which node)
|
||||
|
||||
xcodebuild build \
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue