Skip to content

Commit

Permalink
Add M1 mac build (#68)
Browse files Browse the repository at this point in the history
This PR does two things:

1. It updates the action to use upload-artifacts@v4, which can properly
archive the build artifacts.
2. It adds a new job that builds Pikafish on the newly available M1
runners. I first tried to integrate that into the matrix, but the
exclude rules soon becomes very inflated, and I figured it would be
better to create a separate job for the M1 build

closes #68 

---------

Co-authored-by: xusheng <>
  • Loading branch information
PikaCat-OuO authored Feb 7, 2024
2 parents fd3fe8d + 150f971 commit 6c58de1
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 18 deletions.
71 changes: 54 additions & 17 deletions .github/workflows/pikafish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,50 @@ jobs:
wget -q https://github.com/official-pikafish/Networks/releases/download/master-net/pikafish.nnue
make -j profile-build EXE=$EXE WINE_PATH="$SDE"
make strip EXE=$EXE
cp $EXE ../
- name: Copy binary to folder
- name: Download wiki
run: |
git clone https://github.com/official-pikafish/Pikafish.wiki.git ../Wiki
cd ../Wiki
rm -rf .git
# Artifacts automatically get zipped.
# To avoid double-zipping, we use the unzipped directory
- uses: actions/upload-artifact@v4
with:
name: Pikafish-${{ matrix.config.name }}${{ matrix.arch }}
path: |
${{ env.EXE }}
Wiki
AUTHORS
CONTRIBUTING.md
Copying.txt
README.md
Top CPU Contributors.txt
Pikafish-MacOS-M1:
name: MacOS-apple-silicon
runs-on: macos-14
env:
ARCH: apple-silicon
COMPILER: clang++
COMP: clang
EXE: pikafish-apple-silicon
defaults:
run:
working-directory: src
shell: bash

steps:
- uses: actions/checkout@v4

- name: Compile apple-silicon build
run: |
cd ..
mkdir ${{ matrix.config.name }}
cp src/$EXE ${{ matrix.config.name }}
wget -q https://github.com/official-pikafish/Networks/releases/download/master-net/pikafish.nnue
make -j profile-build EXE=$EXE
make strip EXE=$EXE
cp $EXE ../
- name: Download wiki
run: |
Expand All @@ -94,11 +132,11 @@ jobs:
# Artifacts automatically get zipped.
# To avoid double-zipping, we use the unzipped directory
- uses: actions/upload-artifact@v3
with:
name: Pikafish
- uses: actions/upload-artifact@v4
with:
name: Pikafish-MacOS-M1-apple-silicon
path: |
${{ matrix.config.name }}/*
${{ env.EXE }}
Wiki
AUTHORS
CONTRIBUTING.md
Expand Down Expand Up @@ -147,18 +185,17 @@ jobs:
wget -q https://github.com/official-pikafish/Networks/releases/download/master-net/pikafish.nnue
make -j profile-build EXE=$EXE WINE_PATH=$EMU
make strip EXE=$EXE
- name: Copy binary to folder
run: |
cd ..
mkdir Android
cp src/$EXE Android
cp $EXE ../
# Artifacts automatically get zipped.
# To avoid double-zipping, we use the unzipped directory
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: Pikafish
name: Pikafish-Android-${{ matrix.arch }}
path: |
Android/*
${{ env.EXE }}
AUTHORS
CONTRIBUTING.md
Copying.txt
README.md
Top CPU Contributors.txt
3 changes: 2 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ the Stockfish developers (https://github.com/official-stockfish/Stockfish/blob/m
以往 (subarashikihibi)
陶然 (pickaxe919)
wxc
张大仙 (fengxs001)
张大仙 (fengxs001)
Xusheng

0 comments on commit 6c58de1

Please sign in to comment.