Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
161 changes: 0 additions & 161 deletions .github/workflows/android-build.yml

This file was deleted.

42 changes: 34 additions & 8 deletions mobile/ContainerBuilds.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,47 @@ QT_MAJOR=$(shell echo $(QT_VERSION) | cut -d. -f1)
# arm: armeabi-v7a
# x86_64: x86_64
# x86: x86
ARCH?=$(shell uname -m)
ARCH?=arm64

# Use the same pre-built Docker image as CI (see ci/Jenkinsfile.android)
DOCKER_IMAGE := harbor.status.im/status-im/status-desktop-build:1.0.6-qt$(QT_VERSION)-android

# Map architecture to Android ABI
ifeq ($(ARCH), arm64)
ANDROID_ABI := arm64-v8a
else ifeq ($(ARCH), arm)
ANDROID_ABI := armeabi-v7a
else
ANDROID_ABI := x86_64
endif

# Package type (apk or aab)
PACKAGE_TYPE?=apk

$(TARGET): $(STATUS_DESKTOP_NIM_FILES) $(STATUS_DESKTOP_UI_FILES) $(STATUS_Q_FILES) $(STATUS_Q_UI_FILES) $(STATUS_GO_FILES) $(DOTHERSIDE_FILES) $(OPENSSL_FILES) $(QRCODEGEN_FILES) $(WRAPPER_APP_FILES)
@echo "Building GitHub task $(TARGET) for architecture $(ARCH)"
act -j android-build --container-architecture linux/amd64 --artifact-server-path $(BIN_PATH) -W .github/workflows/android-build.yml --input architecture=$(ARCH) --input qt_version=$(QT_VERSION) -r
@unzip -o $(BIN_PATH)/1/$(TARGET_PREFIX)/$(TARGET_PREFIX).zip -d $(BIN_PATH)
touch $(TARGET)
@echo "Building $(TARGET) for architecture $(ARCH) using Docker image $(DOCKER_IMAGE)"
@mkdir -p $(BIN_PATH)
@docker run --rm \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's just terrible. If we want to do that we should run whole of mobile/ContainerBuilds.mk inside a container and not modify this makefile.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh i see what you mean, I can make that change, change to this file was needed to get rid of reference to .github/workflows/android-build.yml

--platform linux/amd64 \
--entrypoint="" \
-v $(ROOT_DIR)/..:/home/jenkins/workspace/status-desktop \
-w /home/jenkins/workspace/status-desktop/mobile \
-e ARCH=$(ARCH) \
-e ANDROID_ABI=$(ANDROID_ABI) \
-e QT_VERSION=$(QT_VERSION) \
-e PACKAGE_TYPE=$(PACKAGE_TYPE) \
-e MAKEFLAGS="-j$$(nproc) V=0" \
$(DOCKER_IMAGE) \
bash -c "export QMAKE=\$$(which qmake) && make ARCH=$(ARCH) PACKAGE_TYPE=$(PACKAGE_TYPE)"
@echo "Build completed: $(TARGET)"
@touch $(TARGET)

run: $(TARGET)
@echo "Running GitHub task"
@echo "Running $(TARGET)"
@APP=$(TARGET) QT_MAJOR=$(QT_MAJOR) ADB=$(shell which adb) EMULATOR=$(shell which emulator) AVDMANAGER=$(shell which avdmanager) SDKMANAGER=$(shell which sdkmanager) $(RUN_SCRIPT)

clean:
@echo "Cleaning GitHub task"
@docker rm -f $(shell docker ps -a --format '{{.Names}}' | grep Android-Build-APK)
@echo "Cleaning container builds"
@rm -rf $(ROOT_DIR)/bin $(ROOT_DIR)/build $(ROOT_DIR)/lib

default: $(TARGET)
21 changes: 12 additions & 9 deletions mobile/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ This section is for users who want to get up and running quickly with minimal te

### Prerequisites
- Docker
- [act](https://github.com/nektos/act) (GitHub Actions local runner)
- ADB (Android Debug Bridge)
- Android Emulator

Expand All @@ -30,7 +29,7 @@ This section is for users who want to get up and running quickly with minimal te
brew install docker --cask
# Start docker
open -a Docker
brew install act android-platform-tools android-commandlinetools xcbeautify
brew install android-platform-tools android-commandlinetools xcbeautify
```

```bash
Expand All @@ -47,24 +46,28 @@ sdkmanager --install \
"system-images;android-35;google_apis;arm64-v8a"
```

- Install [act](https://nektosact.com/installation/index.html)

2. **Verify installation:**
```bash
docker --version
adb --version
emulator --version
avdmanager --version
sdkmanager --version
act --version
```

2. **Running the app**
3. **Building the app**
```bash
make -f mobile/ContainerBuilds.mk
```

4. **Running the app**
```bash
# Linux and MacOS
make -f mobile/ContainerBuilds.mk run
```

### What Happens Behind the Scenes
- The build process uses GitHub Actions containers to ensure consistent builds
- All required tools and dependencies are provided by the container
- The built APK is copied from the container to the local `bin` directory
- The build process uses the same pre-built Docker image as the CI pipeline (`harbor.status.im/status-im/status-desktop-build:1.0.6-qt6.9.2-android`)
- All required tools and dependencies (Qt 6.9.2, Android SDK/NDK, Go, Nim) are provided by the container
- The container runs on linux/amd64 platform for consistency, even on ARM macOS machines
- The built APK/AAB is available in the `mobile/bin/android/qt6/` directory