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 NAME: ${{ matrix.config.simple_name }}
13 BINARY: ${{ matrix.binaries }}
17 - name: Ubuntu 20.04 GCC
24 - name: MacOS 12 Apple Clang
31 - name: Windows 2022 Mingw-w64 GCC x86_64
47 - binaries: x86-64-avx2
48 config: { os: macos-12 }
49 - binaries: x86-64-bmi2
50 config: { os: macos-12 }
53 working-directory: src
54 shell: ${{ matrix.config.shell }}
56 - uses: actions/checkout@v3
60 - name: Download required linux packages
61 if: runner.os == 'Linux'
64 - name: Setup msys and install required packages
65 if: runner.os == 'Windows'
66 uses: msys2/setup-msys2@v2
68 msystem: ${{ matrix.config.msys_sys }}
69 install: mingw-w64-${{ matrix.config.msys_env }} make git zip
71 - name: Download the used network from the fishtest framework
74 - name: Check compiler
77 - name: Test help target
83 # Compile profile guided builds
85 - name: Compile ${{ matrix.binaries }} build
87 make -j2 profile-build ARCH=$BINARY COMP=$COMP
88 make strip ARCH=$BINARY COMP=$COMP
89 mv ./stockfish$EXT ../stockfish-$NAME-$BINARY$EXT
91 - name: Remove non src files
96 git clone https://github.com/official-stockfish/Stockfish.wiki.git ../wiki
99 - name: Create directory.
103 cp -r wiki stockfish/
105 cp stockfish-$NAME-$BINARY$EXT stockfish/
106 cp "Top CPU Contributors.txt" stockfish/
107 cp Copying.txt stockfish/
108 cp AUTHORS stockfish/
109 cp CITATION.cff stockfish/
110 cp README.md stockfish/
113 if: runner.os != 'Windows'
116 tar -cvf stockfish-$NAME-$BINARY.tar stockfish
119 if: runner.os == 'Windows'
122 zip -r stockfish-$NAME-$BINARY.zip stockfish
124 - name: Upload binaries
125 if: runner.os != 'Windows'
126 uses: actions/upload-artifact@v3
128 name: stockfish-${{ matrix.config.os }}-${{ matrix.binaries }}
129 path: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.tar
131 # Artifacts automatically get zipped
132 # to avoid double zipping, we use the unzipped directory
133 - name: Upload binaries
134 if: runner.os == 'Windows'
135 uses: actions/upload-artifact@v3
137 name: stockfish-${{ matrix.config.os }}-${{ matrix.binaries }}
141 if: startsWith(github.ref_name, 'sf_') && github.ref_type == 'tag'
142 uses: softprops/action-gh-release@v1
144 files: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.${{ matrix.config.archive_ext }}
146 - name: Get last commit sha
148 run: echo "COMMIT_SHA=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV
150 - name: Get commit date
152 run: echo "COMMIT_DATE=$(git show -s --date=format:'%Y%m%d' --format=%cd HEAD)" >> $GITHUB_ENV
154 # Make sure that an old ci which still runs on master doesn't recreate a prerelease
155 - name: Check Pullable Commits
159 CHANGES=$(git rev-list HEAD..origin/master --count)
160 echo "CHANGES=$CHANGES" >> $GITHUB_ENV
163 if: github.ref_name == 'master' && env.CHANGES == '0'
164 continue-on-error: true
165 uses: softprops/action-gh-release@v1
167 name: Stockfish dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
168 tag_name: stockfish-dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
170 files: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.${{ matrix.config.archive_ext }}