-
Notifications
You must be signed in to change notification settings - Fork 13
148 lines (131 loc) · 4.36 KB
/
build-fairy-sf-binaries.yml
File metadata and controls
148 lines (131 loc) · 4.36 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
name: Build Fairy-Stockfish Binaries
on:
workflow_dispatch:
inputs:
fairy_sf_tag:
type: string
default: fairy_sf_14
description: Fairy-Stockfish repo tag
required: true
create_pull_request:
type: boolean
description: Create PR with new binaries
jobs:
linux_x86-64:
runs-on: ubuntu-latest
env:
binary: fairy-stockfish_x86-64_linux
steps:
- name: Clone Fairy-Stockfish @ tag:${{ inputs.fairy_sf_tag }}
uses: actions/checkout@master
with:
repository: fairy-stockfish/Fairy-Stockfish
ref: refs/tags/${{ inputs.fairy_sf_tag }}
- name: Build
run: |
cd src
make clean
make -j build COMP=gcc ARCH=x86-64 EXE=${{ env.binary }}
strip ${{ env.binary }}
- uses: actions/upload-artifact@v3
with:
name: dir-${{ env.binary }}
path: src/${{ env.binary }}
windows_x86-64:
runs-on: windows-2022
env:
binary: fairy-stockfish_x86-64_windows
steps:
- name: Clone Fairy-Stockfish @ tag:${{ inputs.fairy_sf_tag }}
uses: actions/checkout@master
with:
repository: fairy-stockfish/Fairy-Stockfish
ref: refs/tags/${{ inputs.fairy_sf_tag }}
- name: Build
run: |
cd src
make clean
make -j build COMP=mingw ARCH=x86-64 EXE=${{ env.binary }}.exe
strip ${{ env.binary }}.exe
- uses: actions/upload-artifact@v3
with:
name: dir-${{ env.binary }}
path: src/${{ env.binary }}.exe
macos_x86-64:
runs-on: macos-12
env:
binary: fairy-stockfish_x86-64_macos
steps:
- name: Clone Fairy-Stockfish @ tag:${{ inputs.fairy_sf_tag }}
uses: actions/checkout@master
with:
repository: fairy-stockfish/Fairy-Stockfish
ref: refs/tags/${{ inputs.fairy_sf_tag }}
- name: Build
run: |
cd src
make clean
make -j build COMP=clang ARCH=x86-64 EXE=${{ env.binary }}
strip ${{ env.binary }}
- uses: actions/upload-artifact@v3
with:
name: dir-${{ env.binary }}
path: src/${{ env.binary }}
macos_arm64:
runs-on: macos-12
env:
binary: fairy-stockfish_arm64_macos
steps:
- name: Clone Fairy-Stockfish @ tag:${{ inputs.fairy_sf_tag }}
uses: actions/checkout@master
with:
repository: fairy-stockfish/Fairy-Stockfish
ref: refs/tags/${{ inputs.fairy_sf_tag }}
- name: Build
run: |
cd src
make clean
make -j build COMP=clang ARCH=apple-silicon EXE=${{ env.binary }}
strip ${{ env.binary }}
- uses: actions/upload-artifact@v3
with:
name: dir-${{ env.binary }}
path: src/${{ env.binary }}
create_pr:
if: github.event.inputs.create_pull_request == 'true'
runs-on: ubuntu-latest
needs:
- linux_x86-64
- windows_x86-64
- macos_x86-64
- macos_arm64
env:
COMMIT_PATH: src/cli_chess/modules/engine/binaries
BRANCH_NAME: workflow/update-binaries-${{github.run_id}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Clone cli-chess
uses: actions/checkout@v3
- name: Download Fairy-Stockfish artifacts
uses: actions/download-artifact@v4.1.7
with:
path: ${{ env.COMMIT_PATH }}
- name: Extract and make binaries executable
run: |
find dir-* -type f -exec mv -f '{}' ./ ';'
chmod +x fairy-stockfish*
rm -rf dir-*
ls -la
working-directory: ${{ env.COMMIT_PATH }}
- name: Create pull request
run: |
cd $COMMIT_PATH
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git checkout -b $BRANCH_NAME
git add fairy-stockfish*
git commit -m "Update Fairy-Stockfish binaries"
git push -u origin $BRANCH_NAME
gh pr create -B master -H $BRANCH_NAME \
--title "Update Fairy-Stockfish binaries using tag@${{ inputs.fairy_sf_tag }}" \
--body "Generated from GitHub workflow [run #${{github.run_id}}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"