Skip to content

Commit 5c905a5

Browse files
apk
1 parent 3d46829 commit 5c905a5

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ jobs:
110110
if: ${{ matrix.platform == 'android' }}
111111
with:
112112
name: 'AndroidAPK${{ matrix.react-native-version }}'
113-
path: ./Apps/BRNPlayground/android/app/build/outputs/apk/release
113+
path: ./Apps/BRNPlayground/apk
114114
- name: Upload iOS App
115115
uses: actions/upload-artifact@v4
116116
if: ${{ matrix.platform == 'ios' }}

Package/gulpfile.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,12 +103,19 @@ const buildAndroid = async () => {
103103
const buildAndroidRNTA = async () => {
104104
const basekitBuildProp = basekitBuild ? "-PBASEKIT_BUILD=1" : "";
105105
exec(`./gradlew app:assembleRelease --stacktrace --info ${basekitBuildProp}`, '../Apps/BRNPlayground/android');
106-
const baseKitOrFull = basekitBuild ? '-basekit' : '-full';
107-
const oldPath = '../Apps/BRNPlayground/android/app/build/outputs/apk/release/app-release.apk';
108-
const newPath = `../Apps/BRNPlayground/android/app/build/outputs/apk/release/app-release${baseKitOrFull}.apk`;
106+
const baseKitOrFull = basekitBuild ? '-basekit' : '';
107+
const srcFile = '../Apps/BRNPlayground/android/app/build/outputs/apk/release/app-release.apk';
108+
const newName = `app-release${baseKitOrFull}.apk`;
109109

110-
fs.rename(oldPath, newPath, function (err) {
111-
if (err) throw err;
110+
const apkFolder = '../Apps/BRNPlayground/apk';
111+
if (!fs.existsSync(apkFolder)) {
112+
fs.mkdirSync(apkFolder, { recursive: true });
113+
}
114+
await new Promise(resolve => {
115+
gulp.src(srcFile)
116+
.pipe(rename(newName))
117+
.pipe(gulp.dest(apkFolder))
118+
.on('end', resolve);
112119
});
113120
};
114121

0 commit comments

Comments
 (0)