Skip to content

Commit

Permalink
apk
Browse files Browse the repository at this point in the history
  • Loading branch information
CedricGuillemet committed Oct 2, 2024
1 parent 3d46829 commit 5c905a5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ jobs:
if: ${{ matrix.platform == 'android' }}
with:
name: 'AndroidAPK${{ matrix.react-native-version }}'
path: ./Apps/BRNPlayground/android/app/build/outputs/apk/release
path: ./Apps/BRNPlayground/apk
- name: Upload iOS App
uses: actions/upload-artifact@v4
if: ${{ matrix.platform == 'ios' }}
Expand Down
17 changes: 12 additions & 5 deletions Package/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,19 @@ const buildAndroid = async () => {
const buildAndroidRNTA = async () => {
const basekitBuildProp = basekitBuild ? "-PBASEKIT_BUILD=1" : "";
exec(`./gradlew app:assembleRelease --stacktrace --info ${basekitBuildProp}`, '../Apps/BRNPlayground/android');
const baseKitOrFull = basekitBuild ? '-basekit' : '-full';
const oldPath = '../Apps/BRNPlayground/android/app/build/outputs/apk/release/app-release.apk';
const newPath = `../Apps/BRNPlayground/android/app/build/outputs/apk/release/app-release${baseKitOrFull}.apk`;
const baseKitOrFull = basekitBuild ? '-basekit' : '';
const srcFile = '../Apps/BRNPlayground/android/app/build/outputs/apk/release/app-release.apk';
const newName = `app-release${baseKitOrFull}.apk`;

fs.rename(oldPath, newPath, function (err) {
if (err) throw err;
const apkFolder = '../Apps/BRNPlayground/apk';
if (!fs.existsSync(apkFolder)) {
fs.mkdirSync(apkFolder, { recursive: true });
}
await new Promise(resolve => {
gulp.src(srcFile)
.pipe(rename(newName))
.pipe(gulp.dest(apkFolder))
.on('end', resolve);
});
};

Expand Down

0 comments on commit 5c905a5

Please sign in to comment.