This commit is contained in:
tooomm 2026-07-05 17:36:15 +00:00 committed by GitHub
commit 62c8ec0d46
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 173 additions and 181 deletions

View file

@ -7,13 +7,13 @@
# usage: source <script> <name> [--get] [--build] [--save] [--interactive] [--set-cache <location>] # usage: source <script> <name> [--get] [--build] [--save] [--interactive] [--set-cache <location>]
# <name> sets the name of the docker image, these correspond to directories in .ci # <name> sets the name of the docker image, these correspond to directories in .ci
# --get loads the image from a previously saved image cache, will build if no image is found # --get loads the image from a previously saved image cache, will build if no image is found
# --build builds the image from the Dockerfile in .ci/$NAME # --build builds the image from the Dockerfile in .ci/$BUILD_REFERENCE
# --save stores the image, if an image was loaded it will not be stored # --save stores the image, if an image was loaded it will not be stored
# --interactive immediately starts the image interactively for debugging # --interactive immediately starts the image interactively for debugging
# --set-cache <location> sets the location to cache the image or for ccache # --set-cache <location> sets the location to cache the image or for ccache
# #
# requires: docker # requires: docker
# uses env: NAME CACHE BUILD GET SAVE INTERACTIVE # uses env: BUILD_REFERENCE CACHE BUILD GET SAVE INTERACTIVE
# (correspond to args: <name> --set-cache <cache> --build --get --save --interactive) # (correspond to args: <name> --set-cache <cache> --build --get --save --interactive)
# sets env: RUN CCACHE_DIR IMAGE_NAME RUN_ARGS RUN_OPTS BUILD_SCRIPT # sets env: RUN CCACHE_DIR IMAGE_NAME RUN_ARGS RUN_OPTS BUILD_SCRIPT
# exitcode: 1 for failure, 2 for missing dockerfile, 3 for invalid arguments # exitcode: 1 for failure, 2 for missing dockerfile, 3 for invalid arguments
@ -69,21 +69,21 @@ while [[ $# != 0 ]]; do
echo "unrecognized option: $1" echo "unrecognized option: $1"
return 3 return 3
fi fi
NAME="$1" BUILD_REFERENCE="$1"
shift shift
;; ;;
esac esac
done done
# Setup # Setup
if ! [[ $NAME ]]; then if ! [[ $BUILD_REFERENCE ]]; then
echo "no build name given" >&2 echo "no build name given" >&2
return 3 return 3
fi fi
export IMAGE_NAME="${project_name,,}_${NAME,,}" # lower case export IMAGE_NAME="${project_name,,}_${BUILD_REFERENCE,,}" # lower case
docker_dir=".ci/$NAME" docker_dir=".ci/$BUILD_REFERENCE"
if ! [[ -r $docker_dir/Dockerfile ]]; then if ! [[ -r $docker_dir/Dockerfile ]]; then
echo "could not find Dockerfile in $docker_dir" >&2 echo "could not find Dockerfile in $docker_dir" >&2
return 2 # even if the image is cached, we do not want to run if there is no way to build this image return 2 # even if the image is cached, we do not want to run if there is no way to build this image

View file

@ -7,7 +7,7 @@
# adds output to GITHUB_OUTPUT # adds output to GITHUB_OUTPUT
template_path=".ci/release_template.md" template_path=".ci/release_template.md"
body_path="/tmp/release.md" body_path="/tmp/release.md"
beta_regex='beta' beta_regex='-beta'
name_regex='set\(GIT_TAG_RELEASENAME "([[:print:]]+)")' name_regex='set\(GIT_TAG_RELEASENAME "([[:print:]]+)")'
whitespace='^\s*$' whitespace='^\s*$'
@ -23,28 +23,29 @@ fi
# create title # create title
if [[ $TAG =~ $beta_regex ]]; then if [[ $TAG =~ $beta_regex ]]; then
echo "is_beta=yes" >>"$GITHUB_OUTPUT" beta=true
echo "beta=$beta" >>"$GITHUB_OUTPUT"
title="$TAG" title="$TAG"
echo "creating beta release '$title'" echo "Creating beta release '$title'"
elif [[ ! $(cat CMakeLists.txt) =~ $name_regex ]]; then elif [[ ! $(cat CMakeLists.txt) =~ $name_regex ]]; then
echo "::error file=$0::could not find releasename in CMakeLists.txt" echo "::error file=$0::Could not find releasename in CMakeLists.txt"
exit 1 exit 1
else else
echo "is_beta=no" >>"$GITHUB_OUTPUT" beta=false
echo "beta=$beta" >>"$GITHUB_OUTPUT"
name="${BASH_REMATCH[1]}" name="${BASH_REMATCH[1]}"
version="${TAG##*-}" version="${TAG##*-}"
title="Cockatrice $version: $name" title="Cockatrice $version: $name"
no_beta=1
echo "friendly_name=$name" >>"$GITHUB_OUTPUT" echo "friendly_name=$name" >>"$GITHUB_OUTPUT"
echo "creating full release '$title'" echo "Creating full release '$title'"
fi fi
echo "title=$title" >>"$GITHUB_OUTPUT" echo "title=$title" >>"$GITHUB_OUTPUT"
# add release notes template # add release notes template
if [[ $no_beta ]]; then if [[ $beta == "false" ]]; then
body="$(cat "$template_path")" body="$(cat "$template_path")"
if [[ ! $body ]]; then if [[ ! $body ]]; then
echo "::warning file=$0::could not find release template" echo "::warning file=$0::Could not find release template"
fi fi
body="${body//--REPLACE-WITH-RELEASE-TITLE--/$title}" body="${body//--REPLACE-WITH-RELEASE-TITLE--/$title}"
else else
@ -64,13 +65,13 @@ before="${all_tags%%
"$TAG"*}" # strip line with current tag an all lines after it "$TAG"*}" # strip line with current tag an all lines after it
# note the extra newlines are needed to always have a last line # note the extra newlines are needed to always have a last line
if [[ $all_tags == "$before" ]]; then if [[ $all_tags == "$before" ]]; then
echo "::warning file=$0::could not find current tag" echo "::warning file=$0::Could not find current tag"
else else
while while
previous="${before##* previous="${before##*
}" # get the last line }" # get the last line
# skip this tag if this is a full release and it's a beta or if empty # skip this tag if this is a full release and it's a beta or if empty
[[ $no_beta && $previous =~ $beta_regex || ! $previous ]] [[ $beta == "false" && $previous =~ $beta_regex || ! $previous ]]
do do
beta_list+=" $previous" # add to list of skipped betas beta_list+=" $previous" # add to list of skipped betas
next_before="${before% next_before="${before%
@ -85,7 +86,7 @@ else
if generated_list="$(git log "$previous..$TAG" --pretty="- %s")"; then if generated_list="$(git log "$previous..$TAG" --pretty="- %s")"; then
count="$(git rev-list --count "$previous..$TAG")" count="$(git rev-list --count "$previous..$TAG")"
[[ $previous =~ $beta_regex ]] && previousreleasetype="beta release" || previousreleasetype="full release" [[ $previous =~ $beta_regex ]] && previousreleasetype="beta release" || previousreleasetype="full release"
echo "adding list of commits to release notes:" echo "Adding list of commits to release notes:"
echo "'$previous' to '$TAG' ($count commits)" echo "'$previous' to '$TAG' ($count commits)"
# --> is the markdown comment escape sequence, emojis are way better # --> is the markdown comment escape sequence, emojis are way better
generated_list="${generated_list//-->/→}" generated_list="${generated_list//-->/→}"
@ -98,15 +99,15 @@ else
if [[ $beta_list =~ $whitespace ]]; then if [[ $beta_list =~ $whitespace ]]; then
beta_list="-n there are no betas to delete!" beta_list="-n there are no betas to delete!"
else else
echo "the following betas should be deleted after publishing:" echo "The following betas should be deleted after publishing:"
echo "$beta_list" echo "$beta_list"
fi fi
body="${body//--REPLACE-WITH-BETA-LIST--/$beta_list}" body="${body//--REPLACE-WITH-BETA-LIST--/$beta_list}"
else else
echo "::warning file=$0::failed to produce git log" echo "::warning file=$0::Failed to produce git log"
fi fi
else else
echo "::warning file=$0::could not find previous tag" echo "::warning file=$0::Could not find previous tag"
fi fi
fi fi

View file

@ -7,6 +7,17 @@ permissions:
id-token: write # needed for signing certificate in attestation id-token: write # needed for signing certificate in attestation
on: on:
pull_request:
paths:
- '*/**' # matches all files not in root
- '!**.md'
- '!.github/**'
- '!.tx/**'
- '!doc/**'
- '.github/workflows/desktop-build.yml'
- 'CMakeLists.txt'
- 'vcpkg.json'
- 'vcpkg' # needed to match submodule bumps (gitlink)
push: push:
branches: branches:
- master - master
@ -22,17 +33,6 @@ on:
- 'vcpkg' # needed to match submodule bumps (gitlink) - 'vcpkg' # needed to match submodule bumps (gitlink)
tags: tags:
- '*' - '*'
pull_request:
paths:
- '*/**' # matches all files not in root
- '!**.md'
- '!.github/**'
- '!.tx/**'
- '!doc/**'
- '.github/workflows/desktop-build.yml'
- 'CMakeLists.txt'
- 'vcpkg.json'
- 'vcpkg' # needed to match submodule bumps (gitlink)
# Cancel earlier, unfinished runs of this workflow on the same branch (unless on release) # Cancel earlier, unfinished runs of this workflow on the same branch (unless on release)
concurrency: concurrency:
@ -42,7 +42,7 @@ concurrency:
jobs: jobs:
configure: configure:
name: Configure name: Configure
runs-on: ubuntu-slim runs-on: ubuntu-slim # https://github.com/actions/runner-images/blob/main/images/ubuntu-slim/ubuntu-slim-Readme.md
outputs: outputs:
tag: ${{ steps.configure.outputs.tag }} tag: ${{ steps.configure.outputs.tag }}
sha: ${{ steps.configure.outputs.sha }} sha: ${{ steps.configure.outputs.sha }}
@ -60,101 +60,101 @@ jobs:
echo "sha=$RESOLVED_SHA" >> "$GITHUB_OUTPUT" echo "sha=$RESOLVED_SHA" >> "$GITHUB_OUTPUT"
- name: "Checkout" - name: "Checkout"
if: steps.configure.outputs.tag != null if: steps.configure.outputs.tag
uses: actions/checkout@v7 uses: actions/checkout@v7
with: with:
fetch-depth: 0 # fetch all history for all branches and tags fetch-depth: 0 # fetch all history for all branches and tags
- name: "Prepare release parameters" - name: "Prepare release parameters"
id: prepare id: prepare
if: steps.configure.outputs.tag != null if: steps.configure.outputs.tag
shell: bash shell: bash
env: env:
TAG: ${{ steps.configure.outputs.tag }} TAG: ${{ steps.configure.outputs.tag }}
run: .ci/prep_release.sh run: .ci/prep_release.sh
- name: "Create release" - name: "Create release"
if: steps.configure.outputs.tag != null if: steps.configure.outputs.tag
id: create_release id: create_release
shell: bash shell: bash
env: env:
BODY_PATH: ${{ steps.prepare.outputs.body_path }}
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
tag_name: ${{ steps.configure.outputs.tag }} PRERELEASE: ${{ steps.prepare.outputs.beta }}
target: ${{ steps.configure.outputs.sha }} RELEASE_NAME: ${{ steps.prepare.outputs.title }}
release_name: ${{ steps.prepare.outputs.title }} TAG_NAME: ${{ steps.configure.outputs.tag }}
body_path: ${{ steps.prepare.outputs.body_path }} TARGET: ${{ steps.configure.outputs.sha }}
prerelease: ${{ steps.prepare.outputs.is_beta }}
run: | run: |
args=() args=()
[[ $prerelease == yes ]] && args+=(--prerelease) [[ "$PRERELEASE" == "true" ]] && args+=(--prerelease)
[[ "$PRERELEASE" == "false" ]] && args+=(--latest)
gh release create "$tag_name" --verify-tag --draft "${args[@]}" \ gh release create "$TAG_NAME" --verify-tag --draft "${args[@]}" \
--target "$target" \ --target "$TARGET" \
--title "$release_name" \ --title "$RELEASE_NAME" \
--notes-file "$body_path" --notes-file "$BODY_PATH"
build-linux: build-linux:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
# The files in ".ci/$distro$version" correspond to the values given here # The files in ".ci/$BUILD_REFERENCE" correspond to the values given here
include: include:
- distro: Arch - distro: Arch
allow-failure: yes allow-failure: true
package: skip # We are packaged in Arch already test: true # run debug build and tests
- distro: Servatrice_Debian - distro: Servatrice_Debian
version: 12 distro_version: 12
package: DEB package: DEB
server_only: yes server_only: true
test: skip
- distro: Debian - distro: Debian
version: 12 distro_version: 12
package: DEB package: DEB
test: skip # Running tests on all distros is superfluous
- distro: Debian - distro: Debian
version: 13 distro_version: 13
package: DEB package: DEB
test: true # run debug build and tests on newest distro version
- distro: Fedora - distro: Fedora
version: 43 distro_version: 43
package: RPM
test: skip # Running tests on all distros is superfluous
- distro: Fedora
version: 44
package: RPM package: RPM
- distro: Ubuntu - distro: Fedora
version: 24.04 distro_version: 44
package: DEB package: RPM
test: skip # Running tests on all distros is superfluous test: true # run debug build and tests on newest distro version
- distro: Ubuntu - distro: Ubuntu
version: 26.04 distro_version: 24.04
package: DEB package: DEB
name: ${{ matrix.distro }} ${{ matrix.version }} - distro: Ubuntu
distro_version: 26.04
package: DEB
test: true # run debug build and tests on newest distro version
name: ${{ matrix.distro }} ${{ matrix.distro_version }}
needs: configure needs: configure
runs-on: ubuntu-latest runs-on: ubuntu-latest # https://github.com/actions/runner-images/tree/main#available-images
continue-on-error: ${{ matrix.allow-failure == 'yes' }} continue-on-error: ${{ matrix.allow-failure == true }}
timeout-minutes: 70 timeout-minutes: 70
env: env:
CACHE: ${{ github.workspace }}/.cache/${{ matrix.distro }}${{ matrix.version }} # directory for caching docker image and ccache BUILD_REFERENCE: ${{ matrix.distro }}${{ matrix.distro_version }}
CACHE_DIR: ${{ github.workspace }}/.cache/${{ matrix.distro }}${{ matrix.distro_version }} # directory for caching docker image and ccache
CCACHE_EVICTION_AGE: 7d CCACHE_EVICTION_AGE: 7d
CCACHE_SIZE: 550M # space of all repo is 10Gi: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy CCACHE_SIZE: 550M # space of all repo is 10Gi: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
CMAKE_GENERATOR: 'Ninja' CMAKE_GENERATOR: Ninja
NAME: ${{ matrix.distro }}${{ matrix.version }}
steps: steps:
- name: "Checkout" - name: "Checkout"
@ -166,16 +166,16 @@ jobs:
env: env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
with: with:
key: ccache-${{ matrix.distro }}${{ matrix.version }}-${{ env.BRANCH_NAME }} key: ccache-${{ matrix.distro }}${{ matrix.distro_version }}-${{ env.BRANCH_NAME }}
path: ${{ env.CACHE }} path: ${{ env.CACHE_DIR }}
restore-keys: ccache-${{ matrix.distro }}${{ matrix.version }}- restore-keys: ccache-${{ matrix.distro }}${{ matrix.distro_version }}-
- name: "Build ${{ matrix.distro }} ${{ matrix.version }} Docker image" - name: "Build ${{ matrix.distro }} ${{ matrix.distro_version }} Docker image"
shell: bash shell: bash
run: source .ci/docker.sh --build run: source .ci/docker.sh --build
- name: "Build debug and test" - name: "Build debug and test"
if: matrix.test != 'skip' if: matrix.test == true
shell: bash shell: bash
run: | run: |
source .ci/docker.sh source .ci/docker.sh
@ -184,26 +184,26 @@ jobs:
- name: "Build release package" - name: "Build release package"
id: build id: build
if: matrix.package != 'skip' if: matrix.package
shell: bash shell: bash
env: env:
SUFFIX: '-${{ matrix.distro }}${{ matrix.version }}' PACKAGE: ${{ matrix.package }}
package: '${{ matrix.package }}' PACKAGE_SUFFIX: "-${{ matrix.distro }}${{ matrix.distro_version }}"
server_only: '${{ matrix.server_only }}' SERVER_ONLY: ${{ matrix.server_only }}
run: | run: |
source .ci/docker.sh source .ci/docker.sh
args=() args=()
[[ $server_only == yes ]] && args+=(--no-client) [[ "$GITHUB_REF" == "refs/heads/master" ]] && args+=(--evict-ccache "$CCACHE_EVICTION_AGE")
[[ $GITHUB_REF == "refs/heads/master" ]] && args+=(--evict-ccache "$CCACHE_EVICTION_AGE") [[ "$SERVER_ONLY" == "true" ]] && args+=(--no-client)
args+=(--ccache "$CCACHE_SIZE") args+=(--ccache "$CCACHE_SIZE")
args+=(--cmake-generator "$CMAKE_GENERATOR") args+=(--cmake-generator "$CMAKE_GENERATOR")
args+=(--suffix "$SUFFIX") args+=(--suffix "$PACKAGE_SUFFIX")
RUN --server --release --package "$package" "${args[@]}" RUN --server --release --package "$PACKAGE" "${args[@]}"
# Delete used cache to emulate a ccache update. See https://github.com/actions/cache/issues/342 # Delete used cache to emulate a ccache update. See https://github.com/actions/cache/issues/342
- name: "Delete remote compiler cache (ccache)" - name: "Delete remote compiler cache (ccache)"
if: github.ref == 'refs/heads/master' && steps.ccache_restore.outputs.cache-hit if: github.ref == 'refs/heads/master' && steps.ccache_restore.outputs.cache-hit == 'true'
continue-on-error: true continue-on-error: true
env: env:
CACHE_PRIMARY_KEY: ${{ steps.ccache_restore.outputs.cache-primary-key }} CACHE_PRIMARY_KEY: ${{ steps.ccache_restore.outputs.cache-primary-key }}
@ -218,11 +218,11 @@ jobs:
uses: actions/cache/save@v6 uses: actions/cache/save@v6
with: with:
key: ${{ steps.ccache_restore.outputs.cache-primary-key }} key: ${{ steps.ccache_restore.outputs.cache-primary-key }}
path: ${{ env.CACHE }} path: ${{ env.CACHE_DIR }}
- name: "Upload artifact" - name: "Upload artifact"
id: upload_artifact id: upload_artifact
if: matrix.package != 'skip' if: matrix.package
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7
with: with:
archive: false archive: false
@ -231,14 +231,14 @@ jobs:
- name: "Upload to release" - name: "Upload to release"
id: upload_release id: upload_release
if: matrix.package != 'skip' && needs.configure.outputs.tag != null if: matrix.package && needs.configure.outputs.tag
shell: bash shell: bash
env: env:
asset_name: ${{ steps.build.outputs.fullname }} ASSET_NAME: ${{ steps.build.outputs.fullname }}
asset_path: ${{ steps.build.outputs.path }} ASSET_PATH: ${{ steps.build.outputs.path }}
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
tag_name: ${{ needs.configure.outputs.tag }} TAG_NAME: ${{ needs.configure.outputs.tag }}
run: gh release upload "$tag_name" "$asset_path#$asset_name" run: gh release upload "$TAG_NAME" "$ASSET_PATH#$ASSET_NAME"
- name: "Attest binary provenance" - name: "Attest binary provenance"
id: attestation id: attestation
@ -262,87 +262,79 @@ jobs:
matrix: matrix:
include: include:
- os: macOS - os: macOS
target: 13 os_target_version: 13
runner: macos-15-intel runner: macos-15-intel # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md
ccache_eviction_age: 7d
cmake_generator: Ninja cmake_generator: Ninja
make_package: 1 make_package: true
override_target: 13
package_suffix: "-macOS13_Intel"
qt_version: 6.11.0 qt_version: 6.11.0
qt_arch: clang_64 qt_arch: clang_64
qt_modules: qtimageformats qtmultimedia qtwebsockets qt_modules: qtimageformats qtmultimedia qtwebsockets
soc: Intel soc: Intel
type: Release type: Release
use_ccache: 1 use_ccache: true
xcode: "16.4" xcode: 26.3
- os: macOS - os: macOS
target: 14 os_target_version: 14
runner: macos-14 runner: macos-14 # https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
ccache_eviction_age: 7d
cmake_generator: Ninja cmake_generator: Ninja
make_package: 1 make_package: true
package_suffix: "-macOS14"
qt_version: 6.11.0 qt_version: 6.11.0
qt_arch: clang_64 qt_arch: clang_64
qt_modules: qtimageformats qtmultimedia qtwebsockets qt_modules: qtimageformats qtmultimedia qtwebsockets
soc: Apple soc: Apple
type: Release type: Release
use_ccache: 1 use_ccache: true
xcode: "15.4" xcode: 16.2
- os: macOS - os: macOS
target: 15 os_target_version: 15
runner: macos-15 runner: macos-15 # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md
ccache_eviction_age: 7d
cmake_generator: Ninja cmake_generator: Ninja
make_package: 1 make_package: true
package_suffix: "-macOS15"
qt_version: 6.11.0 qt_version: 6.11.0
qt_arch: clang_64 qt_arch: clang_64
qt_modules: qtimageformats qtmultimedia qtwebsockets qt_modules: qtimageformats qtmultimedia qtwebsockets
soc: Apple soc: Apple
type: Release type: Release
use_ccache: 1 use_ccache: true
xcode: "16.4" xcode: 26.3
- os: macOS - os: macOS
target: 15 os_target_version: 15
runner: macos-15 runner: macos-15 # https://github.com/actions/runner-images/blob/main/images/macos/macos-15-arm64-Readme.md
ccache_eviction_age: 7d
cmake_generator: Ninja cmake_generator: Ninja
qt_version: 6.11.0 qt_version: 6.11.0
qt_arch: clang_64 qt_arch: clang_64
qt_modules: qtimageformats qtmultimedia qtwebsockets qt_modules: qtimageformats qtmultimedia qtwebsockets
soc: Apple soc: Apple
type: Debug type: Debug
use_ccache: 1 use_ccache: true
xcode: "16.4" xcode: 26.3
- os: Windows - os: Windows
target: 10 os_target_version: 10
runner: windows-2025 runner: windows-2025 # https://github.com/actions/runner-images/blob/main/images/windows/Windows2025-Readme.md
cmake_generator: "Visual Studio 18 2026" cmake_generator: Visual Studio 18 2026
cmake_generator_platform: x64 cmake_generator_platform: x64
make_package: 1 make_package: true
package_suffix: "-Win10"
qt_version: 6.11.0 qt_version: 6.11.0
qt_arch: win64_msvc2022_64 qt_arch: win64_msvc2022_64
qt_modules: qtimageformats qtmultimedia qtwebsockets qt_modules: qtimageformats qtmultimedia qtwebsockets
type: Release type: Release
name: ${{ matrix.os }} ${{ matrix.target }}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} name: ${{ matrix.os }} ${{ matrix.os_target_version }}${{ case(matrix.soc == 'Intel', ' Intel', '') }}${{ case(matrix.type == 'Debug', ' Debug', '') }}
needs: configure needs: configure
runs-on: ${{ matrix.runner }} runs-on: ${{ matrix.runner }}
timeout-minutes: 100 timeout-minutes: 100
env: env:
CCACHE_DIR: ${{ github.workspace }}/.cache/ CCACHE_DIR: ${{ github.workspace }}/.cache/
CCACHE_EVICTION_AGE: 7d
CCACHE_SIZE: 550M # space of all repo is 10Gi: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy CCACHE_SIZE: 550M # space of all repo is 10Gi: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
steps: steps:
@ -351,28 +343,10 @@ jobs:
with: with:
submodules: recursive submodules: recursive
- name: "[Windows] Add msbuild to PATH" - name: "[macOS] Install ccache"
if: matrix.os == 'Windows' if: matrix.os == 'macOS' && matrix.use_ccache == true
id: add-msbuild
uses: microsoft/setup-msbuild@v3
with:
msbuild-architecture: x64
- name: "[macOS] Setup ccache"
if: matrix.os == 'macOS' && matrix.use_ccache == 1
run: brew install ccache run: brew install ccache
- name: "[macOS] Restore compiler cache (ccache)"
if: matrix.os == 'macOS' && matrix.use_ccache == 1
id: ccache_restore
uses: actions/cache/restore@v6
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
with:
key: ccache-${{ matrix.runner }}-${{ matrix.soc }}-${{ matrix.type }}-${{ env.BRANCH_NAME }}
path: ${{ env.CCACHE_DIR }}
restore-keys: ccache-${{ matrix.runner }}-${{ matrix.soc }}-${{ matrix.type }}-
- name: "Install aqtinstall" - name: "Install aqtinstall"
run: pipx install aqtinstall run: pipx install aqtinstall
@ -389,13 +363,13 @@ jobs:
id: restore_qt id: restore_qt
uses: actions/cache/restore@v6 uses: actions/cache/restore@v6
with: with:
key: thin-qt-macos-${{ matrix.soc }}-${{ steps.resolve_qt_version.outputs.version }} key: Qt-${{ steps.resolve_qt_version.outputs.version }}-macOS${{ case(matrix.soc == 'Intel', '-Intel', '') }}-thin
path: ${{ github.workspace }}/Qt path: ${{ github.workspace }}/Qt
# Using jurplel/install-qt-action to install Qt without using brew # Using jurplel/install-qt-action to install Qt without using brew
# Qt build using vcpkg either just fails or takes too long to build # Qt build using vcpkg either just fails or takes too long to build
- name: "[macOS] Install fat Qt ${{ steps.resolve_qt_version.outputs.version }}" - name: "[macOS] Install fat Qt ${{ steps.resolve_qt_version.outputs.version }}"
if: matrix.os == 'macOS' && steps.restore_qt.outputs.cache-hit != 'true' if: matrix.os == 'macOS' && steps.restore_qt.outputs.cache-hit == ''
uses: jurplel/install-qt-action@v4 uses: jurplel/install-qt-action@v4
with: with:
arch: ${{ matrix.qt_arch }} arch: ${{ matrix.qt_arch }}
@ -405,16 +379,21 @@ jobs:
version: ${{ steps.resolve_qt_version.outputs.version }} version: ${{ steps.resolve_qt_version.outputs.version }}
- name: "[macOS] Create thin Qt libraries" - name: "[macOS] Create thin Qt libraries"
if: matrix.os == 'macOS' && steps.restore_qt.outputs.cache-hit != 'true' if: matrix.os == 'macOS' && steps.restore_qt.outputs.cache-hit == ''
run: .ci/thin_macos_qtlib.sh run: .ci/thin_macos_qtlib.sh
- name: "[macOS] Cache thin Qt libraries" - name: "[macOS] Cache thin Qt libraries"
if: matrix.os == 'macOS' && steps.restore_qt.outputs.cache-hit != 'true' if: matrix.os == 'macOS' && steps.restore_qt.outputs.cache-hit == ''
uses: actions/cache/save@v6 uses: actions/cache/save@v6
with: with:
key: thin-qt-macos-${{ matrix.soc }}-${{ steps.resolve_qt_version.outputs.version }} key: Qt-${{ steps.resolve_qt_version.outputs.version }}-macOS${{ case(matrix.soc == 'Intel', '-Intel', '') }}-thin
path: ${{ github.workspace }}/Qt path: ${{ github.workspace }}/Qt
- name: "[Windows] Install NSIS"
if: matrix.os == 'Windows'
shell: bash
run: choco install nsis
- name: "[Windows] Install Qt ${{ matrix.qt_version }}" - name: "[Windows] Install Qt ${{ matrix.qt_version }}"
if: matrix.os == 'Windows' if: matrix.os == 'Windows'
uses: jurplel/install-qt-action@v4 uses: jurplel/install-qt-action@v4
@ -426,42 +405,54 @@ jobs:
modules: ${{ matrix.qt_modules }} modules: ${{ matrix.qt_modules }}
version: ${{ steps.resolve_qt_version.outputs.version }} version: ${{ steps.resolve_qt_version.outputs.version }}
- name: "[Windows] Install NSIS" - name: "[Windows] Setup MSBuild"
if: matrix.os == 'Windows' if: matrix.os == 'Windows'
shell: bash id: add-msbuild
run: choco install nsis uses: microsoft/setup-msbuild@v3
with:
msbuild-architecture: x64
- name: "Setup vcpkg cache" - name: "Setup vcpkg cache"
id: vcpkg-cache id: vcpkg-cache
uses: TAServers/vcpkg-cache@v3 uses: TAServers/vcpkg-cache@v3
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ github.token }}
- name: "[macOS] Restore compiler cache (ccache)"
if: matrix.os == 'macOS' && matrix.use_ccache == true
id: ccache_restore
uses: actions/cache/restore@v6
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
with:
key: ccache-${{ matrix.os }}${{ matrix.os_target_version }}${{ case(matrix.soc == 'Intel', '-Intel', '') }}-${{ matrix.type }}-${{ env.BRANCH_NAME }}
path: ${{ env.CCACHE_DIR }}
restore-keys: ccache-${{ matrix.os }}${{ matrix.os_target_version }}${{ case(matrix.soc == 'Intel', '-Intel', '') }}-${{ matrix.type }}-
# Uses environment variables, see compile.sh for more details # Uses environment variables, see compile.sh for more details
- name: "Build Cockatrice" - name: "Build Cockatrice"
id: build id: build
shell: bash shell: bash
env: env:
BUILDTYPE: '${{ matrix.type }}' BUILDTYPE: ${{ matrix.type }}
CCACHE_EVICTION_AGE: ${{ matrix.ccache_eviction_age }}
CMAKE_GENERATOR: ${{ matrix.cmake_generator }} CMAKE_GENERATOR: ${{ matrix.cmake_generator }}
CMAKE_GENERATOR_PLATFORM: ${{ matrix.cmake_generator_platform }} CMAKE_GENERATOR_PLATFORM: ${{ matrix.cmake_generator_platform }}
DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer' DEVELOPER_DIR: "/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer"
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }} MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }} MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }} MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }} MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
MAKE_PACKAGE: '${{ matrix.make_package }}' MAKE_PACKAGE: ${{ matrix.make_package }}
PACKAGE_SUFFIX: '${{ matrix.package_suffix }}' PACKAGE_SUFFIX: "-${{ matrix.os }}${{ matrix.os_target_version }}${{ case(matrix.soc == 'Intel', '_Intel', '') }}"
TARGET_MACOS_VERSION: ${{ matrix.override_target }} TARGET_MACOS_VERSION: ${{ matrix.os_target_version }}
USE_CCACHE: ${{ matrix.use_ccache }} USE_CCACHE: ${{ matrix.use_ccache }}
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite' VCPKG_BINARY_SOURCES: "clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite"
VCPKG_DISABLE_METRICS: 1 VCPKG_DISABLE_METRICS: true
run: .ci/compile.sh --server --test --vcpkg run: .ci/compile.sh --server --test --vcpkg
# Delete used cache to emulate a ccache update. See https://github.com/actions/cache/issues/342 # Delete used cache to emulate a ccache update. See https://github.com/actions/cache/issues/342
- name: "[macOS] Delete remote compiler cache (ccache)" - name: "[macOS] Delete remote compiler cache (ccache)"
if: matrix.os == 'macOS' && matrix.use_ccache == 1 && github.ref == 'refs/heads/master' && steps.ccache_restore.outputs.cache-hit if: matrix.os == 'macOS' && matrix.use_ccache == true && github.ref == 'refs/heads/master' && steps.ccache_restore.outputs.cache-hit == 'true'
continue-on-error: true continue-on-error: true
env: env:
CACHE_PRIMARY_KEY: ${{ steps.ccache_restore.outputs.cache-primary-key }} CACHE_PRIMARY_KEY: ${{ steps.ccache_restore.outputs.cache-primary-key }}
@ -472,14 +463,14 @@ jobs:
fi fi
- name: "[macOS] Save updated compiler cache (ccache)" - name: "[macOS] Save updated compiler cache (ccache)"
if: matrix.os == 'macOS' && matrix.use_ccache == 1 && github.ref == 'refs/heads/master' if: matrix.os == 'macOS' && matrix.use_ccache == true && github.ref == 'refs/heads/master'
uses: actions/cache/save@v6 uses: actions/cache/save@v6
with: with:
key: ${{ steps.ccache_restore.outputs.cache-primary-key }} key: ${{ steps.ccache_restore.outputs.cache-primary-key }}
path: ${{ env.CCACHE_DIR }} path: ${{ env.CCACHE_DIR }}
- name: "[macOS] Sign app bundle" - name: "[macOS] Sign app bundle"
if: matrix.os == 'macOS' && matrix.make_package && needs.configure.outputs.tag != null if: matrix.os == 'macOS' && matrix.make_package == true && needs.configure.outputs.tag
id: sign_macos id: sign_macos
env: env:
BUILD_PATH: ${{ steps.build.outputs.path }} BUILD_PATH: ${{ steps.build.outputs.path }}
@ -526,7 +517,7 @@ jobs:
fi fi
- name: "Upload artifact" - name: "Upload artifact"
if: matrix.make_package if: matrix.make_package == true
id: upload_artifact id: upload_artifact
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7
with: with:
@ -546,15 +537,15 @@ jobs:
build/servatrice/Release/*.pdb build/servatrice/Release/*.pdb
- name: "Upload to release" - name: "Upload to release"
if: needs.configure.outputs.tag != null && matrix.make_package == '1' if: matrix.make_package == true && needs.configure.outputs.tag
id: upload_release id: upload_release
shell: bash shell: bash
env: env:
asset_name: ${{ steps.build.outputs.fullname }} ASSET_NAME: ${{ steps.build.outputs.fullname }}
asset_path: ${{ steps.build.outputs.path }} ASSET_PATH: ${{ steps.build.outputs.path }}
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
tag_name: ${{ needs.configure.outputs.tag }} TAG_NAME: ${{ needs.configure.outputs.tag }}
run: gh release upload "$tag_name" "$asset_path#$asset_name" run: gh release upload "$TAG_NAME" "$ASSET_PATH#$ASSET_NAME"
- name: "Attest binary provenance" - name: "Attest binary provenance"
if: steps.upload_release.outcome == 'success' if: steps.upload_release.outcome == 'success'

View file

@ -1,19 +1,19 @@
name: Build Docker Image name: Build Docker
permissions: permissions:
contents: read contents: read
packages: write packages: write
on: on:
push:
branches:
- master
pull_request: pull_request:
branches: branches:
- master - master
paths: paths:
- '.github/workflows/docker-release.yml' - '.github/workflows/docker-release.yml'
- 'Dockerfile' - 'Dockerfile'
push:
branches:
- master
release: release:
types: types:
- released # publishing of stable releases - released # publishing of stable releases
@ -26,9 +26,9 @@ concurrency:
jobs: jobs:
docker: docker:
name: amd64 & arm64 name: amd64 & arm64
if: ${{ github.repository_owner == 'Cockatrice' }} if: github.repository_owner == 'Cockatrice'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: "Checkout" - name: "Checkout"
uses: actions/checkout@v7 uses: actions/checkout@v7

View file

@ -79,9 +79,9 @@ bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
#elif Q_PROCESSOR_WORDSIZE == 8 #elif Q_PROCESSOR_WORDSIZE == 8
const QString &version = QSysInfo::productVersion(); const QString &version = QSysInfo::productVersion();
if (version.startsWith("7") || version.startsWith("8")) { if (version.startsWith("7") || version.startsWith("8")) {
return fileName.contains("Win7"); return fileName.contains("Win7") || fileName.contains("Windows7");
} else { } else {
return fileName.contains("Win10"); return fileName.contains("Win10") || fileName.contains("Windows10");
} }
#else #else
Q_UNUSED(fileName); Q_UNUSED(fileName);