6 name: ${{ matrix.config.name }} ${{ matrix.binaries }}
7 runs-on: ${{ matrix.config.os }}
9 COMPILER: ${{ matrix.config.compiler }}
10 COMP: ${{ matrix.config.comp }}
11 EMU: ${{ matrix.config.emu }}
12 EXT: ${{ matrix.config.ext }}
13 OS: ${{ matrix.config.os }}
14 BINARY: ${{ matrix.binaries }}
18 - name: Android NDK aarch64
20 compiler: aarch64-linux-android21-clang++
24 - name: Android NDK arm
26 compiler: armv7a-linux-androideabi21-clang++
36 config: {compiler: armv7a-linux-androideabi21-clang++}
38 config: {compiler: aarch64-linux-android21-clang++}
39 - binaries: armv7-neon
40 config: {compiler: aarch64-linux-android21-clang++}
43 working-directory: src
44 shell: ${{ matrix.config.shell }}
46 - uses: actions/checkout@v3
50 - name: Download required linux packages
51 if: runner.os == 'Linux'
54 sudo apt install qemu-user
57 if: runner.os == 'Linux'
59 if [ $COMP == ndk ]; then
61 ANDROID_ROOT=/usr/local/lib/android
62 ANDROID_SDK_ROOT=$ANDROID_ROOT/sdk
63 SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager
64 echo "y" | $SDKMANAGER "ndk;$NDKV"
65 ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/$NDKV
66 ANDROID_NDK_BIN=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin
67 echo "ANDROID_NDK_BIN=$ANDROID_NDK_BIN" >> $GITHUB_ENV
70 - name: Download the used network from the fishtest framework
73 - name: Check compiler
75 if [ $COMP == ndk ]; then
76 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
80 - name: Test help target
86 # Compile profile guided builds
88 - name: Compile ${{ matrix.binaries }} build
90 if [ $COMP == ndk ]; then
91 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
92 export LDFLAGS="-static -Wno-unused-command-line-argument"
95 make -j2 profile-build ARCH=$BINARY COMP=$COMP WINE_PATH=$EMU
96 make strip ARCH=$BINARY COMP=$COMP
97 mv ./stockfish$EXT ../stockfish-android-$BINARY$EXT
99 - name: Remove non src files
100 run: rm -f *.o .depend *.nnue
102 - name: Download wiki
104 git clone https://github.com/official-stockfish/Stockfish.wiki.git ../wiki
108 - name: Create tar archive.
112 cp -r wiki stockfish/
114 cp stockfish-android-$BINARY$EXT stockfish/
115 cp "Top CPU Contributors.txt" stockfish/
116 cp Copying.txt stockfish/
117 cp AUTHORS stockfish/
118 tar -cvf stockfish-android-$BINARY.tar stockfish
120 - name: Upload binaries
121 uses: actions/upload-artifact@v3
123 name: stockfish-android-${{ matrix.binaries }}
124 path: stockfish-android-${{ matrix.binaries }}.tar