mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
create prereleases upon push to master
using github actions, create a prerelease for the latest commit to master. As such a development version will be available on github, in addition to the latest release. closes https://github.com/official-stockfish/Stockfish/pull/4622 No functional change
This commit is contained in:
parent
a46087ee30
commit
a68a1c1154
3 changed files with 104 additions and 3 deletions
24
.github/workflows/stockfish.yml
vendored
24
.github/workflows/stockfish.yml
vendored
|
@ -12,6 +12,30 @@ on:
|
||||||
- master
|
- master
|
||||||
- tools
|
- tools
|
||||||
jobs:
|
jobs:
|
||||||
|
Prerelease:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
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=$(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
|
||||||
|
- uses: dev-drprasad/delete-tag-and-release@v0.2.1
|
||||||
|
if: env.COMMIT_SHA != 'null'
|
||||||
|
with:
|
||||||
|
tag_name: ${{ env.COMMIT_SHA }}
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
Sanitizers:
|
Sanitizers:
|
||||||
uses: ./.github/workflows/stockfish_sanitizers.yml
|
uses: ./.github/workflows/stockfish_sanitizers.yml
|
||||||
Tests:
|
Tests:
|
||||||
|
|
26
.github/workflows/stockfish_arm_binaries.yml
vendored
26
.github/workflows/stockfish_arm_binaries.yml
vendored
|
@ -130,3 +130,29 @@ jobs:
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
files: stockfish-android-${{ matrix.binaries }}.tar
|
files: stockfish-android-${{ matrix.binaries }}.tar
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
# Make sure that an old ci which 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: Prerelease
|
||||||
|
if: github.ref_name == 'master' && env.CHANGES == '0'
|
||||||
|
continue-on-error: true
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
name: Stockfish dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
|
||||||
|
tag_name: stockfish-dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
|
||||||
|
prerelease: true
|
||||||
|
files: stockfish-android-${{ matrix.binaries }}.tar
|
57
.github/workflows/stockfish_binaries.yml
vendored
57
.github/workflows/stockfish_binaries.yml
vendored
|
@ -20,12 +20,14 @@ jobs:
|
||||||
compiler: g++
|
compiler: g++
|
||||||
comp: gcc
|
comp: gcc
|
||||||
shell: bash {0}
|
shell: bash {0}
|
||||||
|
archive_ext: tar
|
||||||
- name: MacOS 12 Apple Clang
|
- name: MacOS 12 Apple Clang
|
||||||
os: macos-12
|
os: macos-12
|
||||||
simple_name: macos
|
simple_name: macos
|
||||||
compiler: clang++
|
compiler: clang++
|
||||||
comp: clang
|
comp: clang
|
||||||
shell: bash {0}
|
shell: bash {0}
|
||||||
|
archive_ext: tar
|
||||||
- name: Windows 2022 Mingw-w64 GCC x86_64
|
- name: Windows 2022 Mingw-w64 GCC x86_64
|
||||||
os: windows-2022
|
os: windows-2022
|
||||||
simple_name: windows
|
simple_name: windows
|
||||||
|
@ -35,6 +37,7 @@ jobs:
|
||||||
msys_env: x86_64-gcc
|
msys_env: x86_64-gcc
|
||||||
shell: msys2 {0}
|
shell: msys2 {0}
|
||||||
ext: .exe
|
ext: .exe
|
||||||
|
archive_ext: zip
|
||||||
binaries:
|
binaries:
|
||||||
- x86-64
|
- x86-64
|
||||||
- x86-64-modern
|
- x86-64-modern
|
||||||
|
@ -60,7 +63,7 @@ jobs:
|
||||||
uses: msys2/setup-msys2@v2
|
uses: msys2/setup-msys2@v2
|
||||||
with:
|
with:
|
||||||
msystem: ${{ matrix.config.msys_sys }}
|
msystem: ${{ matrix.config.msys_sys }}
|
||||||
install: mingw-w64-${{ matrix.config.msys_env }} make git
|
install: mingw-w64-${{ matrix.config.msys_env }} make git zip
|
||||||
|
|
||||||
- name: Download the used network from the fishtest framework
|
- name: Download the used network from the fishtest framework
|
||||||
run: make net
|
run: make net
|
||||||
|
@ -90,7 +93,7 @@ jobs:
|
||||||
git clone https://github.com/official-stockfish/Stockfish.wiki.git ../wiki
|
git clone https://github.com/official-stockfish/Stockfish.wiki.git ../wiki
|
||||||
rm -rf ../wiki/.git
|
rm -rf ../wiki/.git
|
||||||
|
|
||||||
- name: Create tar archive.
|
- name: Create directory.
|
||||||
run: |
|
run: |
|
||||||
cd ..
|
cd ..
|
||||||
mkdir stockfish
|
mkdir stockfish
|
||||||
|
@ -102,16 +105,64 @@ jobs:
|
||||||
cp AUTHORS stockfish/
|
cp AUTHORS stockfish/
|
||||||
cp CITATION.cff stockfish/
|
cp CITATION.cff stockfish/
|
||||||
cp README.md stockfish/
|
cp README.md stockfish/
|
||||||
|
|
||||||
|
- name: Create tar
|
||||||
|
if: runner.os != 'Windows'
|
||||||
|
run: |
|
||||||
|
cd ..
|
||||||
tar -cvf stockfish-$NAME-$BINARY.tar stockfish
|
tar -cvf stockfish-$NAME-$BINARY.tar stockfish
|
||||||
|
|
||||||
|
- name: Create zip
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
run: |
|
||||||
|
cd ..
|
||||||
|
zip -r stockfish-$NAME-$BINARY.zip stockfish
|
||||||
|
|
||||||
- name: Upload binaries
|
- name: Upload binaries
|
||||||
|
if: runner.os != 'Windows'
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: stockfish-${{ matrix.config.os }}-${{ matrix.binaries }}
|
name: stockfish-${{ matrix.config.os }}-${{ matrix.binaries }}
|
||||||
path: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.tar
|
path: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.tar
|
||||||
|
|
||||||
|
# Artifacts automatically get zipped
|
||||||
|
# to avoid double zipping, we use the unzipped directory
|
||||||
|
- name: Upload binaries
|
||||||
|
if: runner.os == 'Windows'
|
||||||
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: stockfish-${{ matrix.config.os }}-${{ matrix.binaries }}
|
||||||
|
path: stockfish
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
if: startsWith(github.ref_name, 'sf_') && github.ref_type == 'tag'
|
if: startsWith(github.ref_name, 'sf_') && github.ref_type == 'tag'
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
with:
|
with:
|
||||||
files: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.tar
|
files: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.${{ matrix.config.archive_ext }}
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
# Make sure that an old ci which 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: Prerelease
|
||||||
|
if: github.ref_name == 'master' && env.CHANGES == '0'
|
||||||
|
continue-on-error: true
|
||||||
|
uses: softprops/action-gh-release@v1
|
||||||
|
with:
|
||||||
|
name: Stockfish dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
|
||||||
|
tag_name: stockfish-dev-${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}
|
||||||
|
prerelease: true
|
||||||
|
files: stockfish-${{ matrix.config.simple_name }}-${{ matrix.binaries }}.${{ matrix.config.archive_ext }}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue