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
49 # - x86-64-avxvnni needs more recent gcc
54 - binaries: x86-64-bmi2
55 config: { os: macos-12 }
56 #- binaries: x86-64-avxvnni
57 # config: { os: macos-12 }
58 - binaries: x86-64-avx512
59 config: { os: macos-12 }
60 - binaries: x86-64-vnni256
61 config: { os: macos-12 }
62 - binaries: x86-64-vnni512
63 config: { os: macos-12 }
66 working-directory: src
67 shell: ${{ matrix.config.shell }}
69 - uses: actions/checkout@v3
73 - name: Download required linux packages
74 if: runner.os == 'Linux'
77 - name: Setup msys and install required packages
78 if: runner.os == 'Windows'
79 uses: msys2/setup-msys2@v2
81 msystem: ${{ matrix.config.msys_sys }}
82 install: mingw-w64-${{ matrix.config.msys_env }} make git zip
84 - name: Download SDE package
85 if: runner.os == 'Linux' || runner.os == 'Windows'
86 uses: petarpetrovt/setup-sde@v2.1
88 environmentVariableName: SDE_DIR
91 - name: Download the used network from the fishtest framework
94 - name: Check compiler
97 - name: Test help target
103 # Compile profile guided builds
105 - name: Compile ${{ matrix.binaries }} build
107 make -j2 profile-build ARCH=$BINARY COMP=$COMP SDE_PATH="$SDE"
108 make strip ARCH=$BINARY COMP=$COMP
109 mv ./stockfish$EXT ../stockfish-$NAME-$BINARY$EXT
111 - name: Remove non src files
114 - name: Download wiki
116 git clone https://github.com/official-stockfish/Stockfish.wiki.git ../wiki
119 - name: Create directory.
123 cp -r wiki stockfish/
125 cp stockfish-$NAME-$BINARY$EXT stockfish/
126 cp "Top CPU Contributors.txt" stockfish/
127 cp Copying.txt stockfish/
128 cp AUTHORS stockfish/
129 cp CITATION.cff stockfish/
130 cp README.md stockfish/
133 if: runner.os != 'Windows'
136 tar -cvf stockfish-$NAME-$BINARY.tar stockfish
139 if: runner.os == 'Windows'
142 zip -r stockfish-$NAME-$BINARY.zip stockfish
144 - name: Upload binaries
145 if: runner.os != 'Windows'
146 uses: actions/upload-artifact@v3
148 name: stockfish-${{ matrix.config.os }}-${{ matrix.binaries }}
149 path: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.tar
151 # Artifacts automatically get zipped
152 # to avoid double zipping, we use the unzipped directory
153 - name: Upload binaries
154 if: runner.os == 'Windows'
155 uses: actions/upload-artifact@v3
157 name: stockfish-${{ matrix.config.os }}-${{ matrix.binaries }}
161 if: startsWith(github.ref_name, 'sf_') && github.ref_type == 'tag'
162 uses: softprops/action-gh-release@v1
164 files: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.${{ matrix.config.archive_ext }}
166 - name: Get last commit sha
168 run: echo "COMMIT_SHA=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV
170 - name: Get commit date
172 run: echo "COMMIT_DATE=$(git show -s --date=format:'%Y%m%d' --format=%cd HEAD)" >> $GITHUB_ENV
174 # Make sure that an old ci which still runs on master doesn't recreate a prerelease
175 - name: Check Pullable Commits
179 CHANGES=$(git rev-list HEAD..origin/master --count)
180 echo "CHANGES=$CHANGES" >> $GITHUB_ENV
183 if: github.ref_name == 'master' && env.CHANGES == '0'
184 continue-on-error: true
185 uses: softprops/action-gh-release@v1
187 name: Stockfish dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
188 tag_name: stockfish-dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
190 files: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.${{ matrix.config.archive_ext }}