Skip to content

Release

Release #7

Workflow file for this run

name: Release
on: [workflow_dispatch]
# push:
# tags: "v*"
jobs:
build-linux:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- exec_postfix: "x86_64-v3"
add_rustflags: "-Ctarget-feature=+crt-static,-bmi2 -Ctarget-cpu=x86-64-v3"
- exec_postfix: "x86_64-v2"
add_rustflags: "-Ctarget-feature=+crt-static -Ctarget-cpu=x86-64-v2"
- exec_postfix: "x86_64-v1"
add_rustflags: "-Ctarget-feature=+crt-static"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build
env:
RUSTFLAGS: '${{ matrix.add_rustflags }} -Cinline-threshold=500'
run: |
rustup override set 1.79.0
rustup target add x86_64-unknown-linux-musl
cargo build --release --target x86_64-unknown-linux-musl
mv target/x86_64-unknown-linux-musl/release/pretty-perft pretty-perft-linux-${{ matrix.exec_postfix }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: pretty-perft-linux-${{ matrix.exec_postfix }}
path: pretty-perft-linux-${{ matrix.exec_postfix }}
build-windows:
runs-on: windows-latest
strategy:
matrix:
include:
- exec_postfix: "x86_64-v3"
add_rustflags: "-Ctarget-feature=+crt-static,-bmi2 -Ctarget-cpu=x86-64-v3"
- exec_postfix: "x86_64-v2"
add_rustflags: "-Ctarget-feature=+crt-static -Ctarget-cpu=x86-64-v2"
- exec_postfix: "x86_64-v1"
add_rustflags: "-Ctarget-feature=+crt-static"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build
env:
RUSTFLAGS: '${{ matrix.add_rustflags }} -Cinline-threshold=500'
run: |
rustup override set 1.79.0
cargo build --release
mv .\target\release\pretty-perft.exe pretty-perft-windows-${{ matrix.exec_postfix }}.exe
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: pretty-perft-windows-${{ matrix.exec_postfix }}
path: pretty-perft-windows-${{ matrix.exec_postfix }}.exe
build-macos:
runs-on: macos-12
strategy:
matrix:
include:
- exec_postfix: "x86_64-v3"
toolchain: x86_64-apple-darwin
add_rustflags: "-Ctarget-feature=+crt-static,-bmi2 -Ctarget-cpu=x86-64-v3"
- exec_postfix: "x86_64-v2"
toolchain: x86_64-apple-darwin
add_rustflags: "-Ctarget-feature=+crt-static -Ctarget-cpu=x86-64-v2"
- exec_postfix: "x86_64-v1"
toolchain: x86_64-apple-darwin
add_rustflags: "-Ctarget-feature=+crt-static"
- exec_postfix: "aarch64"
toolchain: aarch64-apple-darwin
add_rustflags: "-Ctarget-feature=+crt-static"
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build
env:
RUSTFLAGS: '${{ matrix.add_rustflags }} -Cinline-threshold=500'
CFLAGS: '${{ matrix.cflags }}'
run: |
rustup override set 1.79.0
rustup target add ${{ matrix.toolchain }}
cargo build --release --target ${{ matrix.toolchain }}
mv target/${{ matrix.toolchain }}/release/pretty-perft pretty-perft-macOS-${{ matrix.exec_postfix }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: pretty-perft-macOS-${{ matrix.exec_postfix }}
path: pretty-perft-macOS-${{ matrix.exec_postfix }}
release:
if: github.repository == 'sroelants/pretty-perft'
needs: [build-linux, build-windows, build-macos]
name: Publish release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: pretty-perft-linux-x86_64-v1
- uses: actions/download-artifact@v4
with:
name: pretty-perft-linux-x86_64-v2
- uses: actions/download-artifact@v4
with:
name: pretty-perft-linux-x86_64-v3
- uses: actions/download-artifact@v4
with:
name: pretty-perft-windows-x86_64-v1
- uses: actions/download-artifact@v4
with:
name: pretty-perft-windows-x86_64-v2
- uses: actions/download-artifact@v4
with:
name: pretty-perft-windows-x86_64-v3
- uses: actions/download-artifact@v4
with:
name: pretty-perft-macOS-x86_64-v1
- uses: actions/download-artifact@v4
with:
name: pretty-perft-macOS-x86_64-v2
- uses: actions/download-artifact@v4
with:
name: pretty-perft-macOS-x86_64-v3
- uses: actions/download-artifact@v4
with:
name: pretty-perft-macOS-aarch64
- name: Install hub
run: sudo apt-get update && sudo apt-get install -y hub
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
tag_name="${GITHUB_REF##*/}"
ls -l
chmod +x pretty-perft-linux-x86_64-v3
chmod +x pretty-perft-linux-x86_64-v2
chmod +x pretty-perft-linux-x86_64-v1
mv pretty-perft-windows-x86_64-v3.exe pretty-perft-${tag_name}-x86_64-v3.exe
mv pretty-perft-windows-x86_64-v2.exe pretty-perft-${tag_name}-x86_64-v2.exe
mv pretty-perft-windows-x86_64-v1.exe pretty-perft-${tag_name}-x86_64-v1.exe
mv pretty-perft-linux-x86_64-v3 pretty-perft-${tag_name}-x86_64-v3
mv pretty-perft-linux-x86_64-v2 pretty-perft-${tag_name}-x86_64-v2
mv pretty-perft-linux-x86_64-v1 pretty-perft-${tag_name}-x86_64-v1
mv pretty-perft-macOS-x86_64-v3 pretty-perft-${tag_name}-macOS-x86_64-v3
mv pretty-perft-macOS-x86_64-v2 pretty-perft-${tag_name}-macOS-x86_64-v2
mv pretty-perft-macOS-x86_64-v1 pretty-perft-${tag_name}-macOS-x86_64-v1
mv pretty-perft-macOS-aarch64 pretty-perft-${tag_name}-macOS-aarch64
sha256sum pretty-perft-* > checksums.txt
echo "$tag_name" > release_description.txt
cat RELEASE_NOTES.md >> release_description.txt
gh release create --draft -F release_description.txt \
"${tag_name}" \
"checksums.txt#Checksums" \
"pretty-perft-${tag_name}-x86_64-v3.exe#pretty-perft - Windows (x86_64 - V3)" \
"pretty-perft-${tag_name}-x86_64-v2.exe#pretty-perft - Windows (x86_64 - V2)" \
"pretty-perft-${tag_name}-x86_64-v1.exe#pretty-perft - Windows (x86_64 - V1)" \
"pretty-perft-${tag_name}-x86_64-v3#pretty-perft - Linux (x86_64 - V3)" \
"pretty-perft-${tag_name}-x86_64-v2#pretty-perft - Linux (x86_64 - V2)" \
"pretty-perft-${tag_name}-x86_64-v1#pretty-perft - Linux (x86_64 - V1)" \
"pretty-perft-${tag_name}-macOS-aarch64#pretty-perft - macOS (ARM)" \
"pretty-perft-${tag_name}-macOS-x86_64-v3#pretty-perft - macOS (x86_64 - V3)" \
"pretty-perft-${tag_name}-macOS-x86_64-v2#pretty-perft - macOS (x86_64 - V2)" \
"pretty-perft-${tag_name}-macOS-x86_64-v1#pretty-perft - macOS (x86_64 - V1)" \