6 name: ${{ matrix.config.name }} ${{ matrix.binaries }}
7 runs-on: ${{ matrix.config.os }}
9 COMPILER: ${{ matrix.config.compiler }}
10 COMP: ${{ matrix.config.comp }}
11 EXT: ${{ matrix.config.ext }}
12 SDE: ${{ matrix.config.sde }}
13 NAME: ${{ matrix.config.simple_name }}
14 BINARY: ${{ matrix.binaries }}
18 - name: Ubuntu 20.04 GCC
25 sde: /home/runner/work/Stockfish/Stockfish/.output/sde-temp-files/sde-external-9.14.0-2022-10-25-lin/sde -future --
26 - name: MacOS 12 Apple Clang
33 - name: Windows 2022 Mingw-w64 GCC x86_64
42 sde: /d/a/Stockfish/Stockfish/.output/sde-temp-files/sde-external-9.14.0-2022-10-25-win/sde.exe -future --
56 config: { os: macos-12 }
58 config: { os: windows-2022}
59 - binaries: x86-64-avx2
60 config: { os: macos-12 }
61 - binaries: x86-64-bmi2
62 config: { os: macos-12 }
63 - binaries: x86-64-avxvnni
64 config: { os: macos-12 }
65 - binaries: x86-64-avxvnni
66 config: { ubuntu-20.04 }
67 - binaries: x86-64-avx512
68 config: { os: macos-12 }
69 - binaries: x86-64-vnni256
70 config: { os: macos-12 }
71 - binaries: x86-64-vnni512
72 config: { os: macos-12 }
75 working-directory: src
76 shell: ${{ matrix.config.shell }}
78 - uses: actions/checkout@v3
82 - name: Download required Linux packages
83 if: runner.os == 'Linux'
86 sudo apt install g++-multilib g++-11-multilib
88 - name: Install fixed GCC on Linux
89 if: runner.os == 'Linux'
90 uses: egor-tensin/setup-gcc@v1
94 - name: Setup msys and install required packages
95 if: runner.os == 'Windows'
96 uses: msys2/setup-msys2@v2
98 msystem: ${{ matrix.config.msys_sys }}
99 install: mingw-w64-${{ matrix.config.msys_env }} make git zip
101 - name: Download SDE package
102 if: runner.os == 'Linux' || runner.os == 'Windows'
103 uses: petarpetrovt/setup-sde@v2.1
105 environmentVariableName: SDE_DIR
108 - name: Download the used network from the fishtest framework
111 - name: Extract the bench number from the commit history
113 for hash in $(git rev-list -100 HEAD); do
114 benchref=$(git show -s $hash | tac | grep -m 1 -o -x '[[:space:]]*\b[Bb]ench[ :]\+[1-9][0-9]\{5,7\}\b[[:space:]]*' | sed 's/[^0-9]//g') && break || true
116 [[ -n "$benchref" ]] && echo "benchref=$benchref" >> $GITHUB_ENV && echo "From commit: $hash" && echo "Reference bench: $benchref" || echo "No bench found"
118 - name: Check compiler
121 - name: Test help target
127 # Compile profile guided builds
129 - name: Compile ${{ matrix.binaries }} build
131 make -j2 profile-build ARCH=$BINARY COMP=$COMP WINE_PATH="$SDE"
132 make strip ARCH=$BINARY COMP=$COMP
133 WINE_PATH="$SDE" ../tests/signature.sh $benchref
134 mv ./stockfish$EXT ../stockfish-$NAME-$BINARY$EXT
136 - name: Remove non src files
139 - name: Download wiki
141 git clone https://github.com/official-stockfish/Stockfish.wiki.git ../wiki
144 - name: Create directory.
148 cp -r wiki stockfish/
150 cp stockfish-$NAME-$BINARY$EXT stockfish/
151 cp "Top CPU Contributors.txt" stockfish/
152 cp Copying.txt stockfish/
153 cp AUTHORS stockfish/
154 cp CITATION.cff stockfish/
155 cp README.md stockfish/
158 if: runner.os != 'Windows'
161 tar -cvf stockfish-$NAME-$BINARY.tar stockfish
164 if: runner.os == 'Windows'
167 zip -r stockfish-$NAME-$BINARY.zip stockfish
169 - name: Upload binaries
170 if: runner.os != 'Windows'
171 uses: actions/upload-artifact@v3
173 name: stockfish-${{ matrix.config.os }}-${{ matrix.binaries }}
174 path: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.tar
176 # Artifacts automatically get zipped
177 # to avoid double zipping, we use the unzipped directory
178 - name: Upload binaries
179 if: runner.os == 'Windows'
180 uses: actions/upload-artifact@v3
182 name: stockfish-${{ matrix.config.os }}-${{ matrix.binaries }}
186 if: startsWith(github.ref_name, 'sf_') && github.ref_type == 'tag'
187 uses: softprops/action-gh-release@v1
189 files: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.${{ matrix.config.archive_ext }}
191 - name: Get last commit sha
193 run: echo "COMMIT_SHA=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV
195 - name: Get commit date
197 run: echo "COMMIT_DATE=$(git show -s --date=format:'%Y%m%d' --format=%cd HEAD)" >> $GITHUB_ENV
199 # Make sure that an old ci which still runs on master doesn't recreate a prerelease
200 - name: Check Pullable Commits
204 CHANGES=$(git rev-list HEAD..origin/master --count)
205 echo "CHANGES=$CHANGES" >> $GITHUB_ENV
208 if: github.ref_name == 'master' && env.CHANGES == '0'
209 continue-on-error: true
210 uses: softprops/action-gh-release@v1
212 name: Stockfish dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
213 tag_name: stockfish-dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
215 files: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.${{ matrix.config.archive_ext }}