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
46 - binaries: x86-64-avx2
47 config: {os: macos-12}
50 working-directory: src
51 shell: ${{ matrix.config.shell }}
53 - uses: actions/checkout@v3
57 - name: Download required linux packages
58 if: runner.os == 'Linux'
61 - name: Setup msys and install required packages
62 if: runner.os == 'Windows'
63 uses: msys2/setup-msys2@v2
65 msystem: ${{ matrix.config.msys_sys }}
66 install: mingw-w64-${{ matrix.config.msys_env }} make git zip
68 - name: Download the used network from the fishtest framework
71 - name: Check compiler
74 - name: Test help target
80 # Compile profile guided builds
82 - name: Compile ${{ matrix.binaries }} build
84 make -j2 profile-build ARCH=$BINARY COMP=$COMP
85 make strip ARCH=$BINARY COMP=$COMP
86 mv ./stockfish$EXT ../stockfish-$NAME-$BINARY$EXT
88 - name: Remove non src files
93 git clone https://github.com/official-stockfish/Stockfish.wiki.git ../wiki
96 - name: Create directory.
100 cp -r wiki stockfish/
102 cp stockfish-$NAME-$BINARY$EXT stockfish/
103 cp "Top CPU Contributors.txt" stockfish/
104 cp Copying.txt stockfish/
105 cp AUTHORS stockfish/
106 cp CITATION.cff stockfish/
107 cp README.md stockfish/
110 if: runner.os != 'Windows'
113 tar -cvf stockfish-$NAME-$BINARY.tar stockfish
116 if: runner.os == 'Windows'
119 zip -r stockfish-$NAME-$BINARY.zip stockfish
121 - name: Upload binaries
122 if: runner.os != 'Windows'
123 uses: actions/upload-artifact@v3
125 name: stockfish-${{ matrix.config.os }}-${{ matrix.binaries }}
126 path: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.tar
128 # Artifacts automatically get zipped
129 # to avoid double zipping, we use the unzipped directory
130 - name: Upload binaries
131 if: runner.os == 'Windows'
132 uses: actions/upload-artifact@v3
134 name: stockfish-${{ matrix.config.os }}-${{ matrix.binaries }}
138 if: startsWith(github.ref_name, 'sf_') && github.ref_type == 'tag'
139 uses: softprops/action-gh-release@v1
141 files: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.${{ matrix.config.archive_ext }}
143 - name: Get last commit sha
145 run: echo "COMMIT_SHA=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV
147 - name: Get commit date
149 run: echo "COMMIT_DATE=$(git show -s --date=format:'%Y%m%d' --format=%cd HEAD)" >> $GITHUB_ENV
151 # Make sure that an old ci which still runs on master doesn't recreate a prerelease
152 - name: Check Pullable Commits
156 CHANGES=$(git rev-list HEAD..origin/master --count)
157 echo "CHANGES=$CHANGES" >> $GITHUB_ENV
160 if: github.ref_name == 'master' && env.CHANGES == '0'
161 continue-on-error: true
162 uses: softprops/action-gh-release@v1
164 name: Stockfish dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
165 tag_name: stockfish-dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
167 files: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.${{ matrix.config.archive_ext }}