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 - binaries: armv8-dotprod
37 config: {compiler: armv7a-linux-androideabi21-clang++}
39 config: {compiler: armv7a-linux-androideabi21-clang++}
41 config: {compiler: aarch64-linux-android21-clang++}
42 - binaries: armv7-neon
43 config: {compiler: aarch64-linux-android21-clang++}
46 working-directory: src
47 shell: ${{ matrix.config.shell }}
49 - uses: actions/checkout@v3
53 - name: Download required linux packages
54 if: runner.os == 'Linux'
57 sudo apt install qemu-user
60 if: runner.os == 'Linux'
62 if [ $COMP == ndk ]; then
64 ANDROID_ROOT=/usr/local/lib/android
65 ANDROID_SDK_ROOT=$ANDROID_ROOT/sdk
66 SDKMANAGER=$ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager
67 echo "y" | $SDKMANAGER "ndk;$NDKV"
68 ANDROID_NDK_ROOT=$ANDROID_SDK_ROOT/ndk/$NDKV
69 ANDROID_NDK_BIN=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin
70 echo "ANDROID_NDK_BIN=$ANDROID_NDK_BIN" >> $GITHUB_ENV
73 - name: Download the used network from the fishtest framework
76 - name: Check compiler
78 if [ $COMP == ndk ]; then
79 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
83 - name: Test help target
89 # Compile profile guided builds
91 - name: Compile ${{ matrix.binaries }} build
93 if [ $COMP == ndk ]; then
94 export PATH=${{ env.ANDROID_NDK_BIN }}:$PATH
95 export LDFLAGS="-static -Wno-unused-command-line-argument"
98 make -j2 profile-build ARCH=$BINARY COMP=$COMP WINE_PATH=$EMU
99 make strip ARCH=$BINARY COMP=$COMP
100 mv ./stockfish$EXT ../stockfish-android-$BINARY$EXT
102 - name: Remove non src files
103 run: rm -f *.o .depend *.nnue
105 - name: Download wiki
107 git clone https://github.com/official-stockfish/Stockfish.wiki.git ../wiki
111 - name: Create tar archive.
115 cp -r wiki stockfish/
117 cp stockfish-android-$BINARY$EXT stockfish/
118 cp "Top CPU Contributors.txt" stockfish/
119 cp Copying.txt stockfish/
120 cp AUTHORS stockfish/
121 cp CITATION.cff stockfish/
122 cp README.md stockfish/
123 tar -cvf stockfish-android-$BINARY.tar stockfish
125 - name: Upload binaries
126 uses: actions/upload-artifact@v3
128 name: stockfish-android-${{ matrix.binaries }}
129 path: stockfish-android-${{ matrix.binaries }}.tar
132 if: startsWith(github.ref_name, 'sf_') && github.ref_type == 'tag'
133 uses: softprops/action-gh-release@v1
135 files: stockfish-android-${{ matrix.binaries }}.tar
137 - name: Get last commit sha
139 run: echo "COMMIT_SHA=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV
141 - name: Get commit date
143 run: echo "COMMIT_DATE=$(git show -s --date=format:'%Y%m%d' --format=%cd HEAD)" >> $GITHUB_ENV
145 # Make sure that an old ci which still runs on master doesn't recreate a prerelease
146 - name: Check Pullable Commits
150 CHANGES=$(git rev-list HEAD..origin/master --count)
151 echo "CHANGES=$CHANGES" >> $GITHUB_ENV
154 if: github.ref_name == 'master' && env.CHANGES == '0'
155 continue-on-error: true
156 uses: softprops/action-gh-release@v1
158 name: Stockfish dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
159 tag_name: stockfish-dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
161 files: stockfish-android-${{ matrix.binaries }}.tar