Skip to content

Commit

Permalink
chore: remove FOSS builds
Browse files Browse the repository at this point in the history
if they ever become necessary - or if we want to set up flavours again - this might be handy as a reverse guide
  • Loading branch information
Rexogamer committed Aug 17, 2024
1 parent 4533c87 commit 2b9a33c
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 92 deletions.
61 changes: 10 additions & 51 deletions .github/workflows/build-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,60 +26,19 @@ jobs:
- name: Bundle the JS
run: yarn react-native bundle --platform android --entry-file ./index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
- name: Build the app
run: yarn react-native build-android --tasks assembleRegularDebug
run: yarn react-native build-android --tasks assembleDebug
- name: Rename debug APKs
run: |
mv app-regular-arm64-v8a-debug.apk RVMob-Debug-${{ github.sha }}-arm64-v8a.apk
mv app-regular-armeabi-v7a-debug.apk RVMob-Debug-${{ github.sha }}-armeabi-v7a.apk
mv app-regular-x86_64-debug.apk RVMob-Debug-${{ github.sha }}-x86_64.apk
mv app-regular-x86-debug.apk RVMob-Debug-${{ github.sha }}-x86.apk
working-directory: /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/regular/debug/
mv app-arm64-v8a-debug.apk RVMob-Debug-${{ github.sha }}-arm64-v8a.apk
mv app-armeabi-v7a-debug.apk RVMob-Debug-${{ github.sha }}-armeabi-v7a.apk
mv app-x86_64-debug.apk RVMob-Debug-${{ github.sha }}-x86_64.apk
mv app-x86-debug.apk RVMob-Debug-${{ github.sha }}-x86.apk
working-directory: /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/debug/
- name: Upload debug APK
uses: actions/upload-artifact@v4
with:
name: regular-artifact
path: |
/home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/regular/debug/RVMob-Debug-${{ github.sha }}-arm64-v8a.apk
/home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/regular/debug/RVMob-Debug-${{ github.sha }}-armeabi-v7a.apk
/home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/regular/debug/RVMob-Debug-${{ github.sha }}-x86_64.apk
/home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/regular/debug/RVMob-Debug-${{ github.sha }}-x86.apk
build-android-debug-foss:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Enable Corepack
run: corepack enable
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'microsoft'
- name: Install dependencies and prepare assets
run: yarn install && npx react-native-asset
- name: Bundle the JS
run: yarn react-native bundle --platform android --entry-file ./index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
- name: Build the app
run: yarn react-native build-android --tasks assembleFossDebug
- name: Rename debug APKs
run: |
mv app-foss-arm64-v8a-debug.apk RVMob-Debug-${{ github.sha }}-FOSS-arm64-v8a.apk
mv app-foss-armeabi-v7a-debug.apk RVMob-Debug-${{ github.sha }}-FOSS-armeabi-v7a.apk
mv app-foss-x86_64-debug.apk RVMob-Debug-${{ github.sha }}-FOSS-x86_64.apk
mv app-foss-x86-debug.apk RVMob-Debug-${{ github.sha }}-FOSS-x86.apk
working-directory: /home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/foss/debug/
- name: Upload debug APK
uses: actions/upload-artifact@v4
with:
name: foss-artifact
path: |
/home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/foss/debug/RVMob-Debug-${{ github.sha }}-FOSS-arm64-v8a.apk
/home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/foss/debug/RVMob-Debug-${{ github.sha }}-FOSS-armeabi-v7a.apk
/home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/foss/debug/RVMob-Debug-${{ github.sha }}-FOSS-x86_64.apk
/home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/foss/debug/RVMob-Debug-${{ github.sha }}-FOSS-x86.apk
/home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/debug/RVMob-Debug-${{ github.sha }}-arm64-v8a.apk
/home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/debug/RVMob-Debug-${{ github.sha }}-armeabi-v7a.apk
/home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/debug/RVMob-Debug-${{ github.sha }}-x86_64.apk
/home/runner/work/rvmob/rvmob/android/app/build/outputs/apk/debug/RVMob-Debug-${{ github.sha }}-x86.apk
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,20 @@ npx react-native-asset
# for web:
yarn web

# for android:
yarn android # regular version
# OR
yarn android-foss # FOSS flavour
# then start Metro:
# for android, run the following then press `a`:
yarn start
```

CLI commands:

| Command | Description |
| ------------------- | ----------------------------------------- |
| `yarn start` | Starts Metro (the dev server). |
| `yarn test` | Tests to see if everything is working. |
| `yarn web` | Runs the web app. |
| `yarn android` | Runs the Android app. |
| `yarn android-foss` | Runs the Android app's FOSS flavour. |
| `yarn ios` | Runs the iOS app (broken/requires a Mac). |
| `yarn lint` | Checks the code syntax using ESLint. |
| Command | Description |
| -------------- | ----------------------------------------- |
| `yarn start` | Starts Metro (the dev server). |
| `yarn test` | Tests to see if everything is working. |
| `yarn web` | Runs the web app. |
| `yarn android` | Runs the Android app. |
| `yarn ios` | Runs the iOS app (broken/requires a Mac). |
| `yarn lint` | Checks the code syntax using ESLint. |

For more information, see a list of `react-native`'s commands [here](https://github.com/react-native-community/cli/blob/master/docs/commands.md). You can access them by running `yarn react-native`.

Expand Down
18 changes: 1 addition & 17 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ react {
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
debuggableVariants = ["regularDebug", "fossDebug"]
// debuggableVariants = ["liteDebug", "prodDebug"]
/* Bundling */
// A list containing the node command and its flags. Default is just 'node'.
// nodeExecutableAndArgs = ["node"]
Expand Down Expand Up @@ -127,22 +127,6 @@ android {
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}

flavorDimensions "featureSet"
productFlavors {
// regular build with non-free dependencies
regular {
versionNameSuffix "-regular"
buildConfigField "boolean", "IS_FOSS", "false"
}

// build without non-free dependencies (no notifications)
foss {
applicationIdSuffix ".foss"
versionNameSuffix "-foss"
buildConfigField "boolean", "IS_FOSS", "true"
}
}
}

dependencies {
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
"private": true,
"scripts": {
"clean": "react-native clean",
"android": "react-native run-android --active-arch-only --appIdSuffix=debug --mode=regularDebug",
"android-foss": "FOSS=true react-native run-android --active-arch-only --appIdSuffix=foss.debug --mode=fossDebug",
"android-release": "react-native build-android --tasks assembleRegularRelease",
"android-release-foss": "FOSS=true react-native build-android --tasks assembleFossRelease",
"android": "react-native run-android --active-arch-only --appIdSuffix=debug --mode=debug",
"android-release": "react-native build-android --tasks assembleRelease",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
Expand Down
2 changes: 0 additions & 2 deletions react-native.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
const isFoss = process.env.FOSS;

module.exports = {
project: {
ios: {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import ReleaseIcon from '../../../../../../assets/images/icon_release.svg';
import DebugIcon from '../../../../../../assets/images/icon_debug.svg';

const AppIcon = getBundleId().match('debug') ? DebugIcon : ReleaseIcon;
const isFoss = getBundleId().match('foss');

export const AppInfoSection = () => {
return (
Expand All @@ -29,9 +28,6 @@ export const AppInfoSection = () => {
</View>
<View style={{alignItems: 'center', marginVertical: 16}}>
<Text type={'h1'}>RVMob v{app.version}</Text>
{isFoss ? (
<Text colour={currentTheme.foregroundSecondary}>FOSS build</Text>
) : null}
<View
style={{
justifyContent: 'center',
Expand Down

0 comments on commit 2b9a33c

Please sign in to comment.