]> git.sesse.net Git - stockfish/blob - .github/workflows/stockfish.yml
create prereleases upon push to master
[stockfish] / .github / workflows / stockfish.yml
1 name: Stockfish
2 on:
3   push:
4     tags:        
5       - '*' 
6     branches:
7       - master
8       - tools
9       - github_ci
10   pull_request:
11     branches:
12       - master
13       - tools
14 jobs:
15   Prerelease:
16     runs-on: ubuntu-latest
17     steps:
18       - uses: actions/checkout@v3
19         with:
20           fetch-depth: 0
21
22       # returns null if no pre-release exists
23       - name: Get Commit SHA of Latest Pre-release
24         run: |
25           # Install required packages
26           sudo apt-get update
27           sudo apt-get install -y curl jq
28
29           echo "COMMIT_SHA=$(jq -r 'map(select(.prerelease)) | first | .tag_name' <<< $(curl -s https://api.github.com/repos/${{ github.repository_owner }}/Stockfish/releases))" >> $GITHUB_ENV
30
31       # delete old previous pre-release and tag
32       - uses: dev-drprasad/delete-tag-and-release@v0.2.1
33         if: env.COMMIT_SHA != 'null'
34         with:
35           tag_name: ${{ env.COMMIT_SHA }}
36         env:
37           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38
39   Sanitizers:
40     uses: ./.github/workflows/stockfish_sanitizers.yml
41   Tests:
42     uses: ./.github/workflows/stockfish_test.yml
43   Compiles:
44     uses: ./.github/workflows/stockfish_compile_test.yml
45   Binaries:
46     if: github.ref == 'refs/heads/master' || (startsWith(github.ref_name, 'sf_') && github.ref_type == 'tag')
47     uses: ./.github/workflows/stockfish_binaries.yml
48   ARM_Binaries:
49     if: github.ref == 'refs/heads/master' || (startsWith(github.ref_name, 'sf_') && github.ref_type == 'tag')
50     uses: ./.github/workflows/stockfish_arm_binaries.yml