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 }}
19 name: "Android NDK aarch64",
21 compiler: aarch64-linux-android21-clang++,
27 name: "Android NDK arm",
29 compiler: armv7a-linux-androideabi21-clang++,
40 config: {compiler: armv7a-linux-androideabi21-clang++}
42 config: {compiler: aarch64-linux-android21-clang++}
43 - binaries: armv7-neon
44 config: {compiler: aarch64-linux-android21-clang++}
47 working-directory: src
48 shell: ${{ matrix.config.shell }}
50 - uses: actions/checkout@v3
54 - name: Download required linux packages
55 if: runner.os == 'Linux'
58 sudo apt install qemu-user
60 - name: Download the used network from the fishtest framework
64 - name: Check compiler
66 if [ $COMP == ndk ]; then
67 ANDROID_ROOT=/usr/local/lib/android
68 ANDROID_SDK_ROOT=$ANDROID_ROOT/sdk
69 SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager
70 echo "y" | $SDKMANAGER "ndk;21.4.7075529"
71 ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/21.4.7075529
72 export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
76 - name: Test help target
80 # Compile profile guided builds
82 - name: Compile ${{ matrix.binaries }} build
84 if [ $COMP == ndk ]; then
85 ANDROID_ROOT=/usr/local/lib/android
86 ANDROID_SDK_ROOT=$ANDROID_ROOT/sdk
87 SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager
88 echo "y" | $SDKMANAGER "ndk;21.4.7075529"
89 ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/21.4.7075529
90 export PATH=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin:$PATH
91 export LDFLAGS="-static -Wno-unused-command-line-argument"
94 make -j2 profile-build ARCH=$BINARY COMP=$COMP WINE_PATH=$EMU
95 make strip ARCH=$BINARY COMP=$COMP
96 mv ./stockfish$EXT ../stockfish-android-$BINARY$EXT
98 - name: Remove non src files
99 run: rm -f *.o .depend *.nnue
101 - name: Create tar archive.
106 cp stockfish-android-$BINARY$EXT stockfish/
107 cp "Top CPU Contributors.txt" stockfish/
108 cp Copying.txt stockfish/
109 cp AUTHORS stockfish/
110 tar -cvf stockfish-android-$BINARY.tar stockfish
112 - name: Upload binaries
113 uses: actions/upload-artifact@v3
115 name: stockfish-android-${{ matrix.binaries }}
117 stockfish-android-${{ matrix.binaries }}.tar