forked from official-stockfish/Stockfish
-
Notifications
You must be signed in to change notification settings - Fork 1
207 lines (190 loc) · 7.38 KB
/
Copy pathstockfish.yml
File metadata and controls
207 lines (190 loc) · 7.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
name: Stockfish
on:
push:
tags:
- "*"
branches:
- master
- tools
- github_ci
pull_request:
branches:
- master
- tools
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
Prerelease:
name: Prerelease
if: github.repository == 'official-stockfish/Stockfish' && (github.ref == 'refs/heads/master' || (startsWith(github.ref_name, 'sf_') && github.ref_type == 'tag'))
runs-on: ubuntu-latest
needs: [Matrix, Compilation, ARMCompilation, UniversalCompilation]
permissions:
contents: write # For deleting/creating a prerelease
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
fetch-depth: 0
# returns null if no pre-release exists
- name: Get Commit SHA of Latest Pre-release
run: |
# Install required packages
sudo apt-get update
sudo apt-get install -y curl jq
echo "COMMIT_SHA_TAG=$(jq -r 'map(select(.prerelease)) | first | .tag_name' <<< $(curl -s https://api.github.com/repos/${{ github.repository_owner }}/Stockfish/releases))" >> $GITHUB_ENV
# delete old previous pre-release and tag
- run: gh release delete ${{ env.COMMIT_SHA_TAG }} --cleanup-tag
if: env.COMMIT_SHA_TAG != 'null'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Make sure that an old ci that still runs on master doesn't recreate a prerelease
- name: Check Pullable Commits
id: check_commits
run: |
git fetch
CHANGES=$(git rev-list HEAD..origin/master --count)
echo "CHANGES=$CHANGES" >> $GITHUB_ENV
- name: Get last commit SHA
id: last_commit
run: echo "COMMIT_SHA=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV
- name: Get commit date
id: commit_date
run: echo "COMMIT_DATE=$(git show -s --date=format:'%Y%m%d' --format=%cd HEAD)" >> $GITHUB_ENV
- name: Official Release?
id: official_release
# Check for "Official release version of Stockfish" in the commit message
run: |
if git log -1 --pretty=%B | grep -q "Official release version of Stockfish"; then
echo "OFFICIAL_RELEASE=true" >> $GITHUB_ENV
else
echo "OFFICIAL_RELEASE=false" >> $GITHUB_ENV
fi
# Get recent commits for release body
- name: Get commits in this push
id: recent_commits
run: |
COMMITS=$(git log \
--format="- [\`%h\`](https://github.com/${{ github.repository }}/commit/%H) *%s*" \
${{ github.event.before }}..HEAD)
echo "COMMITS<<EOF" >> $GITHUB_OUTPUT
echo "$COMMITS" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
# Create a new pre-release, the other upload_binaries.yml will upload the binaries
# to this pre-release.
- name: Create Prerelease
if: github.ref_name == 'master' && env.CHANGES == '0' && env.OFFICIAL_RELEASE == 'false'
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
with:
name: Stockfish dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
tag_name: stockfish-dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
prerelease: true
body: |
Precompiled binaries of the latest Stockfish development version, built automatically on every commit.
> [!NOTE]
> For stable, thoroughly tested builds use the [official releases](https://github.com/official-stockfish/Stockfish/releases).
> Pre-releases may contain bugs.
*Some platforms ship a **universal binary** that automatically selects the best
instruction set for your CPU - no manual selection needed.*
---
## Commits
${{ steps.recent_commits.outputs.COMMITS }}
[View all commits →](https://github.com/${{ github.repository }}/commits/master)
Matrix:
name: Prepare matrices
runs-on: ubuntu-latest
outputs:
macos_matrix: ${{ steps.set-macos-matrix.outputs.macos_matrix }}
arm_matrix: ${{ steps.set-arm-matrix.outputs.arm_matrix }}
universal_matrix: ${{ steps.set-universal-matrix.outputs.universal_matrix }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- id: set-macos-matrix
run: |
MACOS_MATRIX=$(jq -c '.' .github/ci/macos_matrix.json)
echo "MACOS_MATRIX=$MACOS_MATRIX" >> $GITHUB_OUTPUT
- id: set-arm-matrix
run: |
ARM_MATRIX=$(jq -c '.' .github/ci/arm_matrix.json)
echo "ARM_MATRIX=$ARM_MATRIX" >> $GITHUB_OUTPUT
- id: set-universal-matrix
run: |
UNIVERSAL_MATRIX=$(jq -c '.' .github/ci/universal_matrix.json)
echo "UNIVERSAL_MATRIX=$UNIVERSAL_MATRIX" >> $GITHUB_OUTPUT
# Testing Jobs
IWYU:
name: IWYU
uses: ./.github/workflows/iwyu.yml
Sanitizers:
name: Sanitizers
if: ${{ always() }}
uses: ./.github/workflows/sanitizers.yml
Tests:
name: Tests
if: ${{ always() }}
uses: ./.github/workflows/tests.yml
Matetrack:
name: Matetrack
if: ${{ always() }}
uses: ./.github/workflows/matetrack.yml
Games:
name: Games
if: ${{ always() }}
uses: ./.github/workflows/games.yml
CompilerCheck:
name: Compiler check
if: ${{ always() }}
uses: ./.github/workflows/avx2_compilers.yml
# Release Jobs
Compilation:
name: macOS builds
needs: [Matrix, Sanitizers, Tests, Matetrack, Games, CompilerCheck]
uses: ./.github/workflows/compilation.yml
with:
matrix: ${{ needs.Matrix.outputs.macos_matrix }}
ARMCompilation:
name: Android builds
needs: [Matrix, Sanitizers, Tests, Matetrack, Games, CompilerCheck]
uses: ./.github/workflows/arm_compilation.yml
with:
matrix: ${{ needs.Matrix.outputs.arm_matrix }}
UniversalCompilation:
name: "Universal builds"
needs: [Matrix, Sanitizers, Tests, Matetrack, Games, CompilerCheck]
uses: ./.github/workflows/universal_compilation.yml
Binaries:
if: github.repository == 'official-stockfish/Stockfish'
name: macOS uploads
needs: [Prerelease, Matrix]
uses: ./.github/workflows/upload_binaries.yml
with:
matrix: ${{ needs.Matrix.outputs.macos_matrix }}
permissions:
contents: write # For deleting/creating a (pre)release
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
ARM_Binaries:
if: github.repository == 'official-stockfish/Stockfish'
name: Android uploads
needs: [Prerelease, Matrix]
uses: ./.github/workflows/upload_binaries.yml
with:
matrix: ${{ needs.Matrix.outputs.arm_matrix }}
permissions:
contents: write # For deleting/creating a (pre)release
secrets:
token: ${{ secrets.GITHUB_TOKEN }}
Universal_Binaries:
if: github.repository == 'official-stockfish/Stockfish'
name: Universal binaries
needs: [Prerelease, Matrix]
uses: ./.github/workflows/upload_binaries.yml
with:
matrix: ${{ needs.Matrix.outputs.universal_matrix }}
permissions:
contents: write # For deleting/creating a (pre)release
secrets:
token: ${{ secrets.GITHUB_TOKEN }}