mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-22 20:57:10 +00:00
- split into multiple jobs - remove binaries which are already covered by the universal binary superseeds https://github.com/official-stockfish/Stockfish/pull/6779 closes https://github.com/official-stockfish/Stockfish/pull/6794 No functional change Co-authored-by: Disservin <disservin.social@gmail.com>
201 lines
7.1 KiB
YAML
201 lines
7.1 KiB
YAML
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]
|
|
permissions:
|
|
contents: write # For deleting/creating a prerelease
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
# 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
|
|
|
|
# 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
|
|
Matrix:
|
|
name: Prepare matrices
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
macos_matrix: ${{ steps.set-macos-matrix.outputs.macos_matrix }}
|
|
windows_arm_matrix: ${{ steps.set-windows-arm-matrix.outputs.windows_arm_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-windows-arm-matrix
|
|
run: |
|
|
WINDOWS_ARM_MATRIX=$(jq -c '.' .github/ci/windows_arm_matrix.json)
|
|
echo "WINDOWS_ARM_MATRIX=$WINDOWS_ARM_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 }}
|
|
WindowsARMCompilation:
|
|
name: Windows ARM builds
|
|
needs: [Matrix, Sanitizers, Tests, Matetrack, Games, CompilerCheck]
|
|
uses: ./.github/workflows/compilation.yml
|
|
with:
|
|
matrix: ${{ needs.Matrix.outputs.windows_arm_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, Compilation]
|
|
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 }}
|
|
WindowsARM_Binaries:
|
|
if: github.repository == 'official-stockfish/Stockfish'
|
|
name: Windows ARM uploads
|
|
needs: [Prerelease, Matrix, WindowsARMCompilation]
|
|
uses: ./.github/workflows/upload_binaries.yml
|
|
with:
|
|
matrix: ${{ needs.Matrix.outputs.windows_arm_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, ARMCompilation]
|
|
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, UniversalCompilation]
|
|
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 }}
|