Skip to content

Commit 6caffba

Browse files
committed
Merge #368: ci, gha: Build Android artifacts
8d3533a ci, gha: Build Android artifacts (Hennadii Stepanov) Pull request description: This PR reintroduces downloadable binary artifacts for macOS and Windows as it was on now decommissioned Cirrus CI. Unfortunately, the implementation is suboptimal due to various reasons. For example, - A container is used as building the `qt` package in depends fails using the default Android installation in Ubuntu [image](https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md). - Caching, both for depends and ccache, does not work as expected within a container. --- The artifacts are available for downloading from https://github.com/bitcoin-core/gui-qml/actions/workflows/artifacts.yml. Also refer to GitHub documentation: https://docs.github.com/en/actions/managing-workflow-runs/downloading-workflow-artifacts. Links for build artifacts: [![Android ARM 32-bit APK](https://img.shields.io/badge/OS-Andorid_ARM32-green)](https://github.com/bitcoin-core/gui-qml/suites/17611385186/artifacts/1006627194) [![Android ARM 64-bit APK](https://img.shields.io/badge/OS-Andorid_ARM64-green)](https://github.com/bitcoin-core/gui-qml/suites/17611385186/artifacts/1006627197) [![Android x86-64 APK](https://img.shields.io/badge/OS-Andorid_AMD64-green)](https://github.com/bitcoin-core/gui-qml/suites/17611385186/artifacts/1006627201) [![macOS Apple Silicon](https://img.shields.io/badge/OS-macOS%20Apple%20Silicon-green)](https://github.com/bitcoin-core/gui-qml/suites/17611385186/artifacts/1006627204) [![macOS Intel](https://img.shields.io/badge/OS-macOS%20Intel-green)](https://github.com/bitcoin-core/gui-qml/suites/17611385186/artifacts/1006627206) [![Windows](https://img.shields.io/badge/OS-Windows-green)](https://github.com/bitcoin-core/gui-qml/suites/17611385186/artifacts/1006627209) ACKs for top commit: jarolrod: ACK 8d3533a Tree-SHA512: d6cdd0e176694d47eae40b06bad7c4294845cd28cd0f00444d8197cf2ab77647429c49b8a5067c9065ecb856b8ee4538b9d4658abd1139dabe29064ed0e161d4
2 parents ee4dc7d + 8d3533a commit 6caffba

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

.github/workflows/artifacts.yml

+65
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,68 @@ jobs:
122122
with:
123123
name: ${{ matrix.host.artifact }}
124124
path: src/qt/${{ matrix.host.gui_exe }}
125+
126+
android:
127+
name: ${{ matrix.host.name }}
128+
runs-on: ubuntu-latest
129+
container: ubuntu:22.04
130+
131+
strategy:
132+
fail-fast: false
133+
matrix:
134+
host:
135+
- name: 'Android ARM 64-bit APK'
136+
triplet: 'aarch64-linux-android'
137+
artifact: 'unsecure_android_arm64'
138+
- name: 'Android ARM 32-bit APK'
139+
triplet: 'armv7a-linux-android'
140+
artifact: 'unsecure_android_arm32'
141+
- name: 'Android x86_64 APK'
142+
triplet: 'x86_64-linux-android'
143+
artifact: 'unsecure_android_x86_64'
144+
145+
env:
146+
ANDROID_HOME: '/tmp/Android'
147+
ANDROID_API_LEVEL: '28'
148+
ANDROID_BUILD_TOOLS_VERSION: '28.0.3'
149+
ANDROID_NDK_VERSION: '23.2.8568313'
150+
ANDROID_TOOLS_URL: 'https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip'
151+
152+
steps:
153+
- name: Checkout
154+
uses: actions/checkout@v4
155+
156+
- name: Install dependency packages
157+
run: |
158+
apt-get update
159+
apt-get install --no-install-recommends -y autoconf automake ca-certificates curl g++ gradle lbzip2 libtool make openjdk-8-jdk patch pkg-config python3 unzip xz-utils
160+
161+
- name: Install Android tools
162+
run: |
163+
curl --location --fail ${{ env.ANDROID_TOOLS_URL }} -o android-tools.zip
164+
mkdir -p ${{ env.ANDROID_HOME }}
165+
unzip -o android-tools.zip -d ${{ env.ANDROID_HOME }}
166+
yes | ${{ env.ANDROID_HOME }}/cmdline-tools/bin/sdkmanager --sdk_root=${{ env.ANDROID_HOME }} --install "build-tools;${{ env.ANDROID_BUILD_TOOLS_VERSION }}" "platform-tools" "platforms;android-31" "platforms;android-${{ env.ANDROID_API_LEVEL }}" "ndk;${{ env.ANDROID_NDK_VERSION }}"
167+
168+
- name: Build depends
169+
run: |
170+
cd depends
171+
make -j$(nproc) HOST=${{ matrix.host.triplet }} ANDROID_SDK=${{ env.ANDROID_HOME }} ANDROID_NDK=${{ env.ANDROID_HOME }}/ndk/${{ env.ANDROID_NDK_VERSION }} ANDROID_API_LEVEL=${{ env.ANDROID_API_LEVEL }} ANDROID_TOOLCHAIN_BIN=${{ env.ANDROID_HOME }}/ndk/${{ env.ANDROID_NDK_VERSION }}/toolchains/llvm/prebuilt/linux-x86_64/bin
172+
173+
- name: Configure
174+
run: |
175+
./autogen.sh
176+
./configure CONFIG_SITE=$PWD/depends/${{ matrix.host.triplet }}/share/config.site --disable-dependency-tracking --disable-tests --disable-bench --disable-fuzz-binary || (cat config.log; false)
177+
178+
- name: Build GUI
179+
run: |
180+
make -j$(nproc) -C src/qt bitcoin-qt
181+
182+
- name: Build APK
183+
run: |
184+
make -j$(nproc) -C src/qt apk
185+
186+
- uses: actions/upload-artifact@v3
187+
with:
188+
name: ${{ matrix.host.artifact }}
189+
path: src/qt/android/build/outputs/apk/debug/android-debug.apk

0 commit comments

Comments
 (0)