Skip to content

Commit

Permalink
Fix V8 on Android CI build (software-mansion#3748)
Browse files Browse the repository at this point in the history
## Description

This PR fixes the Android V8 CI that wasn't running because `env` is not available in `concurrency.group` context:

<img width="757" alt="Zrzut ekranu 2022-11-7 o 13 41 37" src="https://user-images.githubusercontent.com/20516055/200313029-4201a9d0-777d-431c-ad1f-40afcaf2b17b.png">

Instead, we should use `${{ github.ref }}` to differentiate jobs for different branches/PRs.
  • Loading branch information
tomekzaw authored and fluiddot committed Jun 5, 2023
1 parent 9371a88 commit 87db0c5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 29 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build-v8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ on:
branches:
- main

env:
REACT_NATIVE_VERSION: "0.70.5"

jobs:
build:
runs-on: ubuntu-latest
env:
REACT_NATIVE_VERSION: "0.70.5"
concurrency:
group: build_v8-${{ env.REACT_NATIVE_VERSION }}
group: build-v8-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Check out
Expand Down
41 changes: 15 additions & 26 deletions .github/workflows/helper/configureV8.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
fs = require('fs');

function patchFile(path, find, replace) {
fs.readFile(path, 'utf8', function (err, data) {
if (err) {
return console.log(err);
}
data = data.replace(find, replace);

fs.writeFile(path, data, function (err) {
if (err) {
return console.log(err);
}
});
});
let data = fs.readFileSync(path, 'utf8');
data = data.replace(find, replace);
fs.writeFileSync(path, data);
}

const buildGradle = 'app/android/app/build.gradle';

patchFile(buildGradle, 'enableHermes: true,', 'enableHermes: false,');

patchFile(
'app/android/app/build.gradle',
'enableHermes: true,',
'enableHermes: false,'
buildGradle,
'android {',
`android {
packagingOptions {
// Make sure libjsc.so does not packed in APK
exclude "**/libjsc.so"
}
`
);

const mainApplicationPath =
Expand Down Expand Up @@ -48,14 +48,3 @@ patchFile(
@Override
protected String getJSMainModuleName() {`
);

patchFile(
mainApplicationPath,
'android {',
`android {
packagingOptions {
// Make sure libjsc.so does not packed in APK
exclude "**/libjsc.so"
}
`
);

0 comments on commit 87db0c5

Please sign in to comment.