Skip to content

Commit

Permalink
chore: manual release process + npm audit fix (#125)
Browse files Browse the repository at this point in the history
* chore: manual release instructions
* chore: npm audit fix

---------

Signed-off-by: Iuri Pereira <[email protected]>
  • Loading branch information
iuricmp authored Aug 2, 2024
1 parent 4a0d6b0 commit 531f503
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 19 deletions.
30 changes: 19 additions & 11 deletions mobile/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
check-program = $(foreach exec,$(1),$(if $(shell PATH="$(PATH)" which $(exec)),,$(error "Missing deps: no '$(exec)' in PATH")))
check-file = $(foreach file,$(1),$(if $(wildcard $(file)),,$(error "Missing file: $(file)")))

node_modules: package.json package-lock.json
$(call check-program, npm)
Expand All @@ -9,14 +10,28 @@ ios: node_modules # Run the iOS app
npx expo run:ios
.PHONY: ios

ios.release: node_modules # Run the iOS app in release mode
# - IOS

ios.release_mode: node_modules # Run the iOS app in release mode
npx expo run:ios --configuration Release
.PHONY: ios.release
.PHONY: ios.release_mode

ios.release_production: node_modules
$(call check-file, GoogleService-Info.plist)
eas build --platform ios --profile production
.PHONY: ios.release_production

# - Android

android: node_modules # Run the Android app
npx expo run:android
.PHONY: android

android.release_production: node_modules
$(call check-file, google-services.json)
eas build --platform android --profile production
.PHONY: android.release_production

android.reverse:
$(call check-program, adb)
$(if $(ANDROID_DEVICE),,$(eval ANDROID_DEVICE = $(shell adb devices | tail +2 | head -1 | cut -f 1)))
Expand Down Expand Up @@ -50,6 +65,8 @@ asdf.install_tools: asdf.add_plugins
@echo "Installing asdf tools..."
@asdf install

# - Other

clean:
$(call check-program, npm)

Expand All @@ -75,15 +92,6 @@ clean_install: clean node_modules
cd ios && pod install
.PHONY: clean_install

release.ios: node_modules
npm run build
eas build --platform ios --profile production
.PHONY: release.ios

release.android: node_modules
eas build --platform android --profile production
.PHONY: elease.android

help:
@echo "Available make commands:"
@cat Makefile | grep '^[a-z]' | grep -v '=' | cut -d: -f1 | sort | sed 's/^/ /'
Expand Down
22 changes: 19 additions & 3 deletions mobile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ To launch Android Studio, in a terminal enter:
make asdf.install_tools
```

If you get an error like "https://github.com/CocoaPods/CLAide.git (at master@97b765e) is not yet checked out" then reinstall cocoapods like this:
If you get an error like "https://github.com/CocoaPods/CLAide.git (at master@97b765e) is not yet checked out" then reinstall cocoapods like this:

```sh
asdf uninstall cocoapods
Expand All @@ -96,7 +96,7 @@ make asdf.install_tools

```sh
# to build and run on ios:
make ios
make ios
```

### Build for Android
Expand All @@ -120,10 +120,26 @@ make asdf.install_tools

```sh
# to build and run on android:
make android
make android

# to start Metro Bundler:
make start
```

## Manual release to Google Play Store and Apple App Store

The manual release process uses the [`eas`](https://docs.expo.dev/build/setup/#install-the-latest-eas-cli) CLI to submit the app to the stores.

### Apple App Store

1. Download the `GoogleService-Info.plist` file from the Firebase Console.
2. Run `make ios.release_production` to build the app.
3. After the build is complete, submit it to the App Store running `eas submit --platform ios`

### Google Play Store

1. Download the `google-services.json` file from the Firebase Console.
2. Run `make android.release_production` to build the app.
3. After the build is complete, submit it to the Play Store running `eas submit --platform android`
You'll need to have a [service account json file](https://developers.google.com/android/management/service-account) to authenticate with Google Play Store.

4 changes: 2 additions & 2 deletions mobile/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
}
}
},
"buildNumber": "9"
"buildNumber": "12"
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/images/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "tech.berty.dsocial.android",
"versionCode": "9"
"versionCode": "12"
},
"web": {
"favicon": "./assets/images/favicon.png"
Expand Down
6 changes: 3 additions & 3 deletions mobile/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 531f503

Please sign in to comment.