- packaging/stockfish.sh fetches the pinned official universal build (SHA-256 checked) for Linux and Windows and the source archive for the release. - deb/rpm/Arch, AppImage, Flatpak, tarball and Windows zip ship it unmodified (AppImage: added after linuxdeploy, packed with appimagetool). - The app resolves the built-in engine at run time (EngineConfig::builtin), adds it on first start (or a system stockfish), and offers engines found on the computer in Settings > Engines. - install.sh installs Stockfish into ~/.local/lib/chesspenguin. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
136 lines
4.8 KiB
YAML
136 lines
4.8 KiB
YAML
# Builds release packages on a version tag (v0.1.0, v0.2.0-beta.1, ...) and publishes a GitHub Release.
|
|
# Manual runs (workflow_dispatch) build everything and keep it as workflow artifacts only.
|
|
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags: ["v*"]
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
version:
|
|
runs-on: ubuntu-24.04
|
|
outputs:
|
|
version: ${{ steps.v.outputs.version }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- id: v
|
|
name: Read and check the version
|
|
run: |
|
|
version=$(grep -m1 '^version' Cargo.toml | cut -d'"' -f2)
|
|
if [[ "${GITHUB_REF_TYPE}" == "tag" && "${GITHUB_REF_NAME}" != "v${version}" ]]; then
|
|
echo "::error::Tag ${GITHUB_REF_NAME} does not match Cargo.toml version ${version}"
|
|
exit 1
|
|
fi
|
|
echo "version=${version}" >> "${GITHUB_OUTPUT}"
|
|
|
|
linux:
|
|
needs: version
|
|
# Oldest supported runner: binaries and the AppImage then run on older glibc too.
|
|
runs-on: ubuntu-22.04
|
|
env:
|
|
VERSION: ${{ needs.version.outputs.version }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
- name: System libraries
|
|
run: sudo apt-get update && sudo apt-get install -y pkg-config libasound2-dev libxkbcommon-dev libwayland-dev libfuse2
|
|
- run: cargo build --release --locked -p chesspenguin
|
|
- name: Stockfish
|
|
run: packaging/stockfish.sh linux build/stockfish
|
|
- name: Tarball
|
|
run: |
|
|
name="ChessPenguin-${VERSION}-linux-x86_64"
|
|
mkdir -p "dist/${name}"
|
|
cp target/release/chesspenguin LICENSE README.md THIRD_PARTY_NOTICES.md "dist/${name}/"
|
|
cp -r packaging/icons packaging/*.desktop examples build/stockfish "dist/${name}/"
|
|
tar -C dist -czf "dist/${name}.tar.gz" "${name}"
|
|
rm -rf "dist/${name}"
|
|
- name: deb, rpm and Arch Linux packages
|
|
run: |
|
|
curl -fsSL -o /tmp/nfpm.deb https://github.com/goreleaser/nfpm/releases/download/v2.48.0/nfpm_2.48.0_amd64.deb
|
|
sudo dpkg -i /tmp/nfpm.deb
|
|
nfpm package -f packaging/nfpm.yaml -p deb -t dist/
|
|
nfpm package -f packaging/nfpm.yaml -p rpm -t dist/
|
|
nfpm package -f packaging/nfpm.yaml -p archlinux -t dist/
|
|
- name: AppImage
|
|
run: packaging/build-appimage.sh dist
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: linux
|
|
path: dist/*
|
|
|
|
flatpak:
|
|
needs: version
|
|
runs-on: ubuntu-24.04
|
|
container:
|
|
image: ghcr.io/flathub-infra/flatpak-github-actions:freedesktop-25.08
|
|
options: --privileged
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6
|
|
with:
|
|
bundle: ChessPenguin-${{ needs.version.outputs.version }}-x86_64.flatpak
|
|
manifest-path: packaging/flatpak/io.github.vrubelroman.chessPenguin.yml
|
|
cache-key: flatpak-builder-${{ github.sha }}
|
|
upload-artifact: false
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: flatpak
|
|
path: ChessPenguin-*.flatpak
|
|
|
|
windows:
|
|
needs: version
|
|
runs-on: windows-latest
|
|
env:
|
|
VERSION: ${{ needs.version.outputs.version }}
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: Swatinem/rust-cache@v2
|
|
- run: cargo build --release --locked -p chesspenguin
|
|
- name: Stockfish
|
|
shell: bash
|
|
run: packaging/stockfish.sh windows build/stockfish
|
|
- name: Zip
|
|
shell: pwsh
|
|
run: |
|
|
$name = "ChessPenguin-$env:VERSION-windows-x86_64"
|
|
New-Item -ItemType Directory -Force -Path "dist/$name" | Out-Null
|
|
Copy-Item target/release/chesspenguin.exe "dist/$name/ChessPenguin.exe"
|
|
Copy-Item LICENSE, README.md, THIRD_PARTY_NOTICES.md "dist/$name/"
|
|
Copy-Item -Recurse examples, build/stockfish "dist/$name/"
|
|
Compress-Archive -Path "dist/$name" -DestinationPath "dist/$name.zip"
|
|
Remove-Item -Recurse "dist/$name"
|
|
- uses: actions/upload-artifact@v7
|
|
with:
|
|
name: windows
|
|
path: dist/*
|
|
|
|
publish:
|
|
needs: [version, linux, flatpak, windows]
|
|
if: github.ref_type == 'tag'
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: actions/download-artifact@v8
|
|
with:
|
|
path: dist
|
|
merge-multiple: true
|
|
- name: Stockfish source (GPL-3.0 source offer for the bundled engine)
|
|
run: packaging/stockfish.sh source dist
|
|
- name: Checksums
|
|
run: cd dist && sha256sum * > SHA256SUMS.txt
|
|
- uses: softprops/action-gh-release@v3
|
|
with:
|
|
files: dist/*
|
|
generate_release_notes: true
|
|
# v1.0.0-beta.1 and similar tags become pre-releases.
|
|
prerelease: ${{ contains(github.ref_name, '-') }}
|