fix: resolve pnpm monorepo Metro bundling + add GitHub release workflow
- Add babel-preset-expo as explicit devDep (fixes "Cannot find module" crash) - Configure metro.config.js with watchFolders for pnpm workspace root - Bump expo devDep to ~54.0.34, remove duplicate deps/devDeps - Add .github/workflows/release.yml: signed APK on git tag vX.Y.Z Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
name: Release APK
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- 'v*.*.*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '20'
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v4
|
||||
with:
|
||||
version: 9
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: artifacts/postiz-mobile
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Install Expo CLI
|
||||
run: pnpm add -g expo-cli@latest || true
|
||||
|
||||
- name: Set up Android SDK
|
||||
uses: android-actions/setup-android@v3
|
||||
|
||||
- name: Accept Android SDK licenses
|
||||
run: yes | sdkmanager --licenses || true
|
||||
|
||||
- name: Install SDK components
|
||||
run: |
|
||||
sdkmanager "platform-tools" "platforms;android-35" "build-tools;35.0.0" "ndk;28.2.13676358"
|
||||
|
||||
- name: Decode keystore
|
||||
run: |
|
||||
mkdir -p ~/.config/postiz-mobile
|
||||
echo "${{ secrets.KEYSTORE_B64 }}" | base64 -d > ~/.config/postiz-mobile/postiz-mobile.jks
|
||||
cat > ~/.config/postiz-mobile/signing.env <<EOF
|
||||
KEYSTORE_PATH=~/.config/postiz-mobile/postiz-mobile.jks
|
||||
KEYSTORE_ALIAS=${{ secrets.KEYSTORE_ALIAS }}
|
||||
KEYSTORE_STORE_PASSWORD=${{ secrets.KEYSTORE_STORE_PASSWORD }}
|
||||
KEYSTORE_KEY_PASSWORD=${{ secrets.KEYSTORE_KEY_PASSWORD }}
|
||||
EOF
|
||||
chmod 600 ~/.config/postiz-mobile/signing.env ~/.config/postiz-mobile/postiz-mobile.jks
|
||||
|
||||
- name: Build signed APK
|
||||
working-directory: artifacts/postiz-mobile
|
||||
run: ./build-apk.sh
|
||||
|
||||
- name: Find built APK
|
||||
id: apk
|
||||
run: |
|
||||
APK=$(ls artifacts/postiz-mobile/dist/*.apk | sort | tail -1)
|
||||
echo "path=$APK" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Create GitHub Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
name: "Postiz Mobile ${{ github.ref_name }}"
|
||||
body: |
|
||||
## Postiz Mobile ${{ github.ref_name }}
|
||||
|
||||
APK signé pour Android — installation directe (sideload).
|
||||
|
||||
### Installation
|
||||
1. Activer "Sources inconnues" sur l'appareil
|
||||
2. Transférer l'APK et ouvrir pour installer
|
||||
files: ${{ steps.apk.outputs.path }}
|
||||
draft: false
|
||||
prerelease: ${{ contains(github.ref_name, '-') }}
|
||||
@@ -1,3 +1,16 @@
|
||||
const { getDefaultConfig } = require("expo/metro-config");
|
||||
const path = require("path");
|
||||
|
||||
module.exports = getDefaultConfig(__dirname);
|
||||
const projectRoot = __dirname;
|
||||
const workspaceRoot = path.resolve(projectRoot, "../..");
|
||||
|
||||
const config = getDefaultConfig(projectRoot);
|
||||
|
||||
// pnpm monorepo: expose workspace root node_modules to Metro
|
||||
config.watchFolders = [workspaceRoot];
|
||||
config.resolver.nodeModulesPaths = [
|
||||
path.resolve(projectRoot, "node_modules"),
|
||||
path.resolve(workspaceRoot, "node_modules"),
|
||||
];
|
||||
|
||||
module.exports = config;
|
||||
|
||||
@@ -7,10 +7,13 @@
|
||||
"dev": "EXPO_PACKAGER_PROXY_URL=https://$REPLIT_EXPO_DEV_DOMAIN EXPO_PUBLIC_DOMAIN=$REPLIT_DEV_DOMAIN EXPO_PUBLIC_REPL_ID=$REPL_ID REACT_NATIVE_PACKAGER_HOSTNAME=$REPLIT_DEV_DOMAIN pnpm exec expo start --localhost --port $PORT",
|
||||
"build": "node scripts/build.js",
|
||||
"serve": "node server/serve.js",
|
||||
"typecheck": "tsc -p tsconfig.json --noEmit"
|
||||
"typecheck": "tsc -p tsconfig.json --noEmit",
|
||||
"android": "expo run:android",
|
||||
"ios": "expo run:ios"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.25.2",
|
||||
"babel-preset-expo": "~54.0.10",
|
||||
"@expo-google-fonts/inter": "^0.4.0",
|
||||
"@expo/cli": "54.0.23",
|
||||
"@expo/ngrok": "^4.1.0",
|
||||
@@ -23,7 +26,7 @@
|
||||
"@ungap/structured-clone": "^1.3.0",
|
||||
"@workspace/api-client-react": "workspace:*",
|
||||
"babel-plugin-react-compiler": "^19.0.0-beta-e993439-20250117",
|
||||
"expo": "~54.0.27",
|
||||
"expo": "~54.0.34",
|
||||
"expo-blur": "~15.0.8",
|
||||
"expo-constants": "~18.0.11",
|
||||
"expo-font": "~14.0.10",
|
||||
@@ -61,6 +64,9 @@
|
||||
"expo-clipboard": "~8.0.8",
|
||||
"expo-notifications": "~0.32.17",
|
||||
"expo-secure-store": "~15.0.8",
|
||||
"react-native-calendars": "^1.1314.0"
|
||||
"react-native-calendars": "^1.1314.0",
|
||||
"expo": "~54.0.34",
|
||||
"react": "19.1.0",
|
||||
"react-native": "0.81.5"
|
||||
}
|
||||
}
|
||||
|
||||
Generated
+36
-21
@@ -407,9 +407,6 @@ importers:
|
||||
expo-secure-store:
|
||||
specifier: ~15.0.8
|
||||
version: 15.0.8(expo@54.0.34)
|
||||
expo-task-manager:
|
||||
specifier: ~14.0.9
|
||||
version: 14.0.9(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))
|
||||
react-native-calendars:
|
||||
specifier: ^1.1314.0
|
||||
version: 1.1314.0(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)
|
||||
@@ -453,8 +450,11 @@ importers:
|
||||
babel-plugin-react-compiler:
|
||||
specifier: ^19.0.0-beta-e993439-20250117
|
||||
version: 19.0.0-beta-ebf51a3-20250411
|
||||
babel-preset-expo:
|
||||
specifier: ~54.0.10
|
||||
version: 54.0.10(@babel/core@7.29.0)(@babel/runtime@7.28.6)(expo@54.0.34)(react-refresh@0.18.0)
|
||||
expo:
|
||||
specifier: ~54.0.27
|
||||
specifier: ~54.0.34
|
||||
version: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
||||
expo-blur:
|
||||
specifier: ~15.0.8
|
||||
@@ -3556,12 +3556,6 @@ packages:
|
||||
react-native-web:
|
||||
optional: true
|
||||
|
||||
expo-task-manager@14.0.9:
|
||||
resolution: {integrity: sha512-GKWtXrkedr4XChHfTm5IyTcSfMtCPxzx89y4CMVqKfyfROATibrE/8UI5j7UC/pUOfFoYlQvulQEvECMreYuUA==}
|
||||
peerDependencies:
|
||||
expo: '*'
|
||||
react-native: '*'
|
||||
|
||||
expo-web-browser@15.0.11:
|
||||
resolution: {integrity: sha512-r2LS4Ro6DgUPZkcaEfgt8mp9eJuoA93x11Jh7S6utFe0FEzvUNn2yFhxg8XVwESaaHGt2k5V8LuK36rsp0BeIw==}
|
||||
peerDependencies:
|
||||
@@ -5581,9 +5575,6 @@ packages:
|
||||
resolution: {integrity: sha512-wH590V9VNgYH9g3lH9wWjTrUoKsjLF6sGLjhR4sH1LWpLmCOH0Zf7PukhDA8BiS7KHe4oPNkcTHqYkj7SOGUOw==}
|
||||
engines: {node: '>=20'}
|
||||
|
||||
unimodules-app-loader@6.0.8:
|
||||
resolution: {integrity: sha512-fqS8QwT/MC/HAmw1NKCHdzsPA6WaLm0dNmoC5Pz6lL+cDGYeYCNdHMO9fy08aL2ZD7cVkNM0pSR/AoNRe+rslA==}
|
||||
|
||||
universalify@2.0.1:
|
||||
resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==}
|
||||
engines: {node: '>= 10.0.0'}
|
||||
@@ -8783,6 +8774,38 @@ snapshots:
|
||||
- '@babel/core'
|
||||
- supports-color
|
||||
|
||||
babel-preset-expo@54.0.10(@babel/core@7.29.0)(@babel/runtime@7.28.6)(expo@54.0.34)(react-refresh@0.18.0):
|
||||
dependencies:
|
||||
'@babel/helper-module-imports': 7.28.6
|
||||
'@babel/plugin-proposal-decorators': 7.29.0(@babel/core@7.29.0)
|
||||
'@babel/plugin-proposal-export-default-from': 7.27.1(@babel/core@7.29.0)
|
||||
'@babel/plugin-syntax-export-default-from': 7.28.6(@babel/core@7.29.0)
|
||||
'@babel/plugin-transform-class-static-block': 7.28.6(@babel/core@7.29.0)
|
||||
'@babel/plugin-transform-export-namespace-from': 7.27.1(@babel/core@7.29.0)
|
||||
'@babel/plugin-transform-flow-strip-types': 7.27.1(@babel/core@7.29.0)
|
||||
'@babel/plugin-transform-modules-commonjs': 7.28.6(@babel/core@7.29.0)
|
||||
'@babel/plugin-transform-object-rest-spread': 7.28.6(@babel/core@7.29.0)
|
||||
'@babel/plugin-transform-parameters': 7.27.7(@babel/core@7.29.0)
|
||||
'@babel/plugin-transform-private-methods': 7.28.6(@babel/core@7.29.0)
|
||||
'@babel/plugin-transform-private-property-in-object': 7.28.6(@babel/core@7.29.0)
|
||||
'@babel/plugin-transform-runtime': 7.29.0(@babel/core@7.29.0)
|
||||
'@babel/preset-react': 7.28.5(@babel/core@7.29.0)
|
||||
'@babel/preset-typescript': 7.28.5(@babel/core@7.29.0)
|
||||
'@react-native/babel-preset': 0.81.5(@babel/core@7.29.0)
|
||||
babel-plugin-react-compiler: 1.0.0
|
||||
babel-plugin-react-native-web: 0.21.2
|
||||
babel-plugin-syntax-hermes-parser: 0.29.1
|
||||
babel-plugin-transform-flow-enums: 0.0.2(@babel/core@7.29.0)
|
||||
debug: 4.4.3
|
||||
react-refresh: 0.18.0
|
||||
resolve-from: 5.0.0
|
||||
optionalDependencies:
|
||||
'@babel/runtime': 7.28.6
|
||||
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
||||
transitivePeerDependencies:
|
||||
- '@babel/core'
|
||||
- supports-color
|
||||
|
||||
babel-preset-jest@29.6.3(@babel/core@7.29.0):
|
||||
dependencies:
|
||||
'@babel/core': 7.29.0
|
||||
@@ -9585,12 +9608,6 @@ snapshots:
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
expo-task-manager@14.0.9(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)):
|
||||
dependencies:
|
||||
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
||||
react-native: 0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)
|
||||
unimodules-app-loader: 6.0.8
|
||||
|
||||
expo-web-browser@15.0.11(expo@54.0.34)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0)):
|
||||
dependencies:
|
||||
expo: 54.0.34(@babel/core@7.29.0)(@expo/metro-runtime@6.1.2)(expo-router@6.0.23)(react-native@0.81.5(@babel/core@7.29.0)(@types/react@19.1.17)(react@19.1.0))(react@19.1.0)(typescript@5.9.3)
|
||||
@@ -11934,8 +11951,6 @@ snapshots:
|
||||
|
||||
unicorn-magic@0.4.0: {}
|
||||
|
||||
unimodules-app-loader@6.0.8: {}
|
||||
|
||||
universalify@2.0.1: {}
|
||||
|
||||
unpipe@1.0.0: {}
|
||||
|
||||
Reference in New Issue
Block a user