mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-06 05:23:56 -07:00
Merge b467849e01 into baddbfae14
This commit is contained in:
commit
62c8ec0d46
5 changed files with 173 additions and 181 deletions
|
|
@ -7,13 +7,13 @@
|
|||
# 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
|
||||
# --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
|
||||
# --interactive immediately starts the image interactively for debugging
|
||||
# --set-cache <location> sets the location to cache the image or for ccache
|
||||
#
|
||||
# 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)
|
||||
# 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
|
||||
|
|
@ -69,21 +69,21 @@ while [[ $# != 0 ]]; do
|
|||
echo "unrecognized option: $1"
|
||||
return 3
|
||||
fi
|
||||
NAME="$1"
|
||||
BUILD_REFERENCE="$1"
|
||||
shift
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Setup
|
||||
if ! [[ $NAME ]]; then
|
||||
if ! [[ $BUILD_REFERENCE ]]; then
|
||||
echo "no build name given" >&2
|
||||
return 3
|
||||
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
|
||||
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
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
# adds output to GITHUB_OUTPUT
|
||||
template_path=".ci/release_template.md"
|
||||
body_path="/tmp/release.md"
|
||||
beta_regex='beta'
|
||||
beta_regex='-beta'
|
||||
name_regex='set\(GIT_TAG_RELEASENAME "([[:print:]]+)")'
|
||||
whitespace='^\s*$'
|
||||
|
||||
|
|
@ -23,28 +23,29 @@ fi
|
|||
|
||||
# create title
|
||||
if [[ $TAG =~ $beta_regex ]]; then
|
||||
echo "is_beta=yes" >>"$GITHUB_OUTPUT"
|
||||
beta=true
|
||||
echo "beta=$beta" >>"$GITHUB_OUTPUT"
|
||||
title="$TAG"
|
||||
echo "creating beta release '$title'"
|
||||
echo "Creating beta release '$title'"
|
||||
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
|
||||
else
|
||||
echo "is_beta=no" >>"$GITHUB_OUTPUT"
|
||||
beta=false
|
||||
echo "beta=$beta" >>"$GITHUB_OUTPUT"
|
||||
name="${BASH_REMATCH[1]}"
|
||||
version="${TAG##*-}"
|
||||
title="Cockatrice $version: $name"
|
||||
no_beta=1
|
||||
echo "friendly_name=$name" >>"$GITHUB_OUTPUT"
|
||||
echo "creating full release '$title'"
|
||||
echo "Creating full release '$title'"
|
||||
fi
|
||||
echo "title=$title" >>"$GITHUB_OUTPUT"
|
||||
|
||||
# add release notes template
|
||||
if [[ $no_beta ]]; then
|
||||
if [[ $beta == "false" ]]; then
|
||||
body="$(cat "$template_path")"
|
||||
if [[ ! $body ]]; then
|
||||
echo "::warning file=$0::could not find release template"
|
||||
echo "::warning file=$0::Could not find release template"
|
||||
fi
|
||||
body="${body//--REPLACE-WITH-RELEASE-TITLE--/$title}"
|
||||
else
|
||||
|
|
@ -64,13 +65,13 @@ before="${all_tags%%
|
|||
"$TAG"*}" # strip line with current tag an all lines after it
|
||||
# note the extra newlines are needed to always have a last line
|
||||
if [[ $all_tags == "$before" ]]; then
|
||||
echo "::warning file=$0::could not find current tag"
|
||||
echo "::warning file=$0::Could not find current tag"
|
||||
else
|
||||
while
|
||||
previous="${before##*
|
||||
}" # get the last line
|
||||
# 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
|
||||
beta_list+=" $previous" # add to list of skipped betas
|
||||
next_before="${before%
|
||||
|
|
@ -85,7 +86,7 @@ else
|
|||
if generated_list="$(git log "$previous..$TAG" --pretty="- %s")"; then
|
||||
count="$(git rev-list --count "$previous..$TAG")"
|
||||
[[ $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)"
|
||||
# --> is the markdown comment escape sequence, emojis are way better
|
||||
generated_list="${generated_list//-->/→}"
|
||||
|
|
@ -98,15 +99,15 @@ else
|
|||
if [[ $beta_list =~ $whitespace ]]; then
|
||||
beta_list="-n there are no betas to delete!"
|
||||
else
|
||||
echo "the following betas should be deleted after publishing:"
|
||||
echo "The following betas should be deleted after publishing:"
|
||||
echo "$beta_list"
|
||||
fi
|
||||
body="${body//--REPLACE-WITH-BETA-LIST--/$beta_list}"
|
||||
else
|
||||
echo "::warning file=$0::failed to produce git log"
|
||||
echo "::warning file=$0::Failed to produce git log"
|
||||
fi
|
||||
else
|
||||
echo "::warning file=$0::could not find previous tag"
|
||||
echo "::warning file=$0::Could not find previous tag"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
|
|
|||
295
.github/workflows/desktop-build.yml
vendored
295
.github/workflows/desktop-build.yml
vendored
|
|
@ -7,6 +7,17 @@ permissions:
|
|||
id-token: write # needed for signing certificate in attestation
|
||||
|
||||
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:
|
||||
branches:
|
||||
- master
|
||||
|
|
@ -22,17 +33,6 @@ on:
|
|||
- 'vcpkg' # needed to match submodule bumps (gitlink)
|
||||
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)
|
||||
concurrency:
|
||||
|
|
@ -42,7 +42,7 @@ concurrency:
|
|||
jobs:
|
||||
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:
|
||||
tag: ${{ steps.configure.outputs.tag }}
|
||||
sha: ${{ steps.configure.outputs.sha }}
|
||||
|
|
@ -60,101 +60,101 @@ jobs:
|
|||
echo "sha=$RESOLVED_SHA" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: "Checkout"
|
||||
if: steps.configure.outputs.tag != null
|
||||
if: steps.configure.outputs.tag
|
||||
uses: actions/checkout@v7
|
||||
with:
|
||||
fetch-depth: 0 # fetch all history for all branches and tags
|
||||
|
||||
- name: "Prepare release parameters"
|
||||
id: prepare
|
||||
if: steps.configure.outputs.tag != null
|
||||
if: steps.configure.outputs.tag
|
||||
shell: bash
|
||||
env:
|
||||
TAG: ${{ steps.configure.outputs.tag }}
|
||||
run: .ci/prep_release.sh
|
||||
|
||||
- name: "Create release"
|
||||
if: steps.configure.outputs.tag != null
|
||||
if: steps.configure.outputs.tag
|
||||
id: create_release
|
||||
shell: bash
|
||||
env:
|
||||
BODY_PATH: ${{ steps.prepare.outputs.body_path }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
tag_name: ${{ steps.configure.outputs.tag }}
|
||||
target: ${{ steps.configure.outputs.sha }}
|
||||
release_name: ${{ steps.prepare.outputs.title }}
|
||||
body_path: ${{ steps.prepare.outputs.body_path }}
|
||||
prerelease: ${{ steps.prepare.outputs.is_beta }}
|
||||
PRERELEASE: ${{ steps.prepare.outputs.beta }}
|
||||
RELEASE_NAME: ${{ steps.prepare.outputs.title }}
|
||||
TAG_NAME: ${{ steps.configure.outputs.tag }}
|
||||
TARGET: ${{ steps.configure.outputs.sha }}
|
||||
run: |
|
||||
args=()
|
||||
[[ $prerelease == yes ]] && args+=(--prerelease)
|
||||
[[ "$PRERELEASE" == "true" ]] && args+=(--prerelease)
|
||||
[[ "$PRERELEASE" == "false" ]] && args+=(--latest)
|
||||
|
||||
gh release create "$tag_name" --verify-tag --draft "${args[@]}" \
|
||||
--target "$target" \
|
||||
--title "$release_name" \
|
||||
--notes-file "$body_path"
|
||||
gh release create "$TAG_NAME" --verify-tag --draft "${args[@]}" \
|
||||
--target "$TARGET" \
|
||||
--title "$RELEASE_NAME" \
|
||||
--notes-file "$BODY_PATH"
|
||||
|
||||
build-linux:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
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:
|
||||
- distro: Arch
|
||||
|
||||
allow-failure: yes
|
||||
package: skip # We are packaged in Arch already
|
||||
allow-failure: true
|
||||
test: true # run debug build and tests
|
||||
|
||||
- distro: Servatrice_Debian
|
||||
version: 12
|
||||
distro_version: 12
|
||||
|
||||
package: DEB
|
||||
server_only: yes
|
||||
test: skip
|
||||
server_only: true
|
||||
|
||||
- distro: Debian
|
||||
version: 12
|
||||
distro_version: 12
|
||||
|
||||
package: DEB
|
||||
test: skip # Running tests on all distros is superfluous
|
||||
|
||||
- distro: Debian
|
||||
version: 13
|
||||
distro_version: 13
|
||||
|
||||
package: DEB
|
||||
test: true # run debug build and tests on newest distro version
|
||||
|
||||
- distro: Fedora
|
||||
version: 43
|
||||
|
||||
package: RPM
|
||||
test: skip # Running tests on all distros is superfluous
|
||||
|
||||
- distro: Fedora
|
||||
version: 44
|
||||
distro_version: 43
|
||||
|
||||
package: RPM
|
||||
|
||||
- distro: Ubuntu
|
||||
version: 24.04
|
||||
- distro: Fedora
|
||||
distro_version: 44
|
||||
|
||||
package: DEB
|
||||
test: skip # Running tests on all distros is superfluous
|
||||
package: RPM
|
||||
test: true # run debug build and tests on newest distro version
|
||||
|
||||
- distro: Ubuntu
|
||||
version: 26.04
|
||||
distro_version: 24.04
|
||||
|
||||
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
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: ${{ matrix.allow-failure == 'yes' }}
|
||||
runs-on: ubuntu-latest # https://github.com/actions/runner-images/tree/main#available-images
|
||||
continue-on-error: ${{ matrix.allow-failure == true }}
|
||||
timeout-minutes: 70
|
||||
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_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'
|
||||
NAME: ${{ matrix.distro }}${{ matrix.version }}
|
||||
CMAKE_GENERATOR: Ninja
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
|
|
@ -166,16 +166,16 @@ jobs:
|
|||
env:
|
||||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
|
||||
with:
|
||||
key: ccache-${{ matrix.distro }}${{ matrix.version }}-${{ env.BRANCH_NAME }}
|
||||
path: ${{ env.CACHE }}
|
||||
restore-keys: ccache-${{ matrix.distro }}${{ matrix.version }}-
|
||||
key: ccache-${{ matrix.distro }}${{ matrix.distro_version }}-${{ env.BRANCH_NAME }}
|
||||
path: ${{ env.CACHE_DIR }}
|
||||
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
|
||||
run: source .ci/docker.sh --build
|
||||
|
||||
- name: "Build debug and test"
|
||||
if: matrix.test != 'skip'
|
||||
if: matrix.test == true
|
||||
shell: bash
|
||||
run: |
|
||||
source .ci/docker.sh
|
||||
|
|
@ -184,26 +184,26 @@ jobs:
|
|||
|
||||
- name: "Build release package"
|
||||
id: build
|
||||
if: matrix.package != 'skip'
|
||||
if: matrix.package
|
||||
shell: bash
|
||||
env:
|
||||
SUFFIX: '-${{ matrix.distro }}${{ matrix.version }}'
|
||||
package: '${{ matrix.package }}'
|
||||
server_only: '${{ matrix.server_only }}'
|
||||
PACKAGE: ${{ matrix.package }}
|
||||
PACKAGE_SUFFIX: "-${{ matrix.distro }}${{ matrix.distro_version }}"
|
||||
SERVER_ONLY: ${{ matrix.server_only }}
|
||||
run: |
|
||||
source .ci/docker.sh
|
||||
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+=(--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
|
||||
- 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
|
||||
env:
|
||||
CACHE_PRIMARY_KEY: ${{ steps.ccache_restore.outputs.cache-primary-key }}
|
||||
|
|
@ -218,11 +218,11 @@ jobs:
|
|||
uses: actions/cache/save@v6
|
||||
with:
|
||||
key: ${{ steps.ccache_restore.outputs.cache-primary-key }}
|
||||
path: ${{ env.CACHE }}
|
||||
path: ${{ env.CACHE_DIR }}
|
||||
|
||||
- name: "Upload artifact"
|
||||
id: upload_artifact
|
||||
if: matrix.package != 'skip'
|
||||
if: matrix.package
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
archive: false
|
||||
|
|
@ -231,14 +231,14 @@ jobs:
|
|||
|
||||
- name: "Upload to release"
|
||||
id: upload_release
|
||||
if: matrix.package != 'skip' && needs.configure.outputs.tag != null
|
||||
if: matrix.package && needs.configure.outputs.tag
|
||||
shell: bash
|
||||
env:
|
||||
asset_name: ${{ steps.build.outputs.fullname }}
|
||||
asset_path: ${{ steps.build.outputs.path }}
|
||||
ASSET_NAME: ${{ steps.build.outputs.fullname }}
|
||||
ASSET_PATH: ${{ steps.build.outputs.path }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
tag_name: ${{ needs.configure.outputs.tag }}
|
||||
run: gh release upload "$tag_name" "$asset_path#$asset_name"
|
||||
TAG_NAME: ${{ needs.configure.outputs.tag }}
|
||||
run: gh release upload "$TAG_NAME" "$ASSET_PATH#$ASSET_NAME"
|
||||
|
||||
- name: "Attest binary provenance"
|
||||
id: attestation
|
||||
|
|
@ -262,87 +262,79 @@ jobs:
|
|||
matrix:
|
||||
include:
|
||||
- os: macOS
|
||||
target: 13
|
||||
runner: macos-15-intel
|
||||
os_target_version: 13
|
||||
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
|
||||
make_package: 1
|
||||
override_target: 13
|
||||
package_suffix: "-macOS13_Intel"
|
||||
make_package: true
|
||||
qt_version: 6.11.0
|
||||
qt_arch: clang_64
|
||||
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
||||
soc: Intel
|
||||
type: Release
|
||||
use_ccache: 1
|
||||
xcode: "16.4"
|
||||
use_ccache: true
|
||||
xcode: 26.3
|
||||
|
||||
- os: macOS
|
||||
target: 14
|
||||
runner: macos-14
|
||||
os_target_version: 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
|
||||
make_package: 1
|
||||
package_suffix: "-macOS14"
|
||||
make_package: true
|
||||
qt_version: 6.11.0
|
||||
qt_arch: clang_64
|
||||
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
||||
soc: Apple
|
||||
type: Release
|
||||
use_ccache: 1
|
||||
xcode: "15.4"
|
||||
use_ccache: true
|
||||
xcode: 16.2
|
||||
|
||||
- os: macOS
|
||||
target: 15
|
||||
runner: macos-15
|
||||
os_target_version: 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
|
||||
make_package: 1
|
||||
package_suffix: "-macOS15"
|
||||
make_package: true
|
||||
qt_version: 6.11.0
|
||||
qt_arch: clang_64
|
||||
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
||||
soc: Apple
|
||||
type: Release
|
||||
use_ccache: 1
|
||||
xcode: "16.4"
|
||||
use_ccache: true
|
||||
xcode: 26.3
|
||||
|
||||
- os: macOS
|
||||
target: 15
|
||||
runner: macos-15
|
||||
os_target_version: 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
|
||||
qt_version: 6.11.0
|
||||
qt_arch: clang_64
|
||||
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
||||
soc: Apple
|
||||
type: Debug
|
||||
use_ccache: 1
|
||||
xcode: "16.4"
|
||||
use_ccache: true
|
||||
xcode: 26.3
|
||||
|
||||
- os: Windows
|
||||
target: 10
|
||||
runner: windows-2025
|
||||
os_target_version: 10
|
||||
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
|
||||
make_package: 1
|
||||
package_suffix: "-Win10"
|
||||
make_package: true
|
||||
qt_version: 6.11.0
|
||||
qt_arch: win64_msvc2022_64
|
||||
qt_modules: qtimageformats qtmultimedia qtwebsockets
|
||||
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
|
||||
runs-on: ${{ matrix.runner }}
|
||||
timeout-minutes: 100
|
||||
env:
|
||||
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
|
||||
|
||||
steps:
|
||||
|
|
@ -351,28 +343,10 @@ jobs:
|
|||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: "[Windows] Add msbuild to PATH"
|
||||
if: matrix.os == 'Windows'
|
||||
id: add-msbuild
|
||||
uses: microsoft/setup-msbuild@v3
|
||||
with:
|
||||
msbuild-architecture: x64
|
||||
|
||||
- name: "[macOS] Setup ccache"
|
||||
if: matrix.os == 'macOS' && matrix.use_ccache == 1
|
||||
- name: "[macOS] Install ccache"
|
||||
if: matrix.os == 'macOS' && matrix.use_ccache == true
|
||||
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"
|
||||
run: pipx install aqtinstall
|
||||
|
||||
|
|
@ -389,13 +363,13 @@ jobs:
|
|||
id: restore_qt
|
||||
uses: actions/cache/restore@v6
|
||||
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
|
||||
|
||||
# Using jurplel/install-qt-action to install Qt without using brew
|
||||
# Qt build using vcpkg either just fails or takes too long to build
|
||||
- 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
|
||||
with:
|
||||
arch: ${{ matrix.qt_arch }}
|
||||
|
|
@ -405,16 +379,21 @@ jobs:
|
|||
version: ${{ steps.resolve_qt_version.outputs.version }}
|
||||
|
||||
- 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
|
||||
|
||||
- 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
|
||||
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
|
||||
|
||||
- name: "[Windows] Install NSIS"
|
||||
if: matrix.os == 'Windows'
|
||||
shell: bash
|
||||
run: choco install nsis
|
||||
|
||||
- name: "[Windows] Install Qt ${{ matrix.qt_version }}"
|
||||
if: matrix.os == 'Windows'
|
||||
uses: jurplel/install-qt-action@v4
|
||||
|
|
@ -426,42 +405,54 @@ jobs:
|
|||
modules: ${{ matrix.qt_modules }}
|
||||
version: ${{ steps.resolve_qt_version.outputs.version }}
|
||||
|
||||
- name: "[Windows] Install NSIS"
|
||||
- name: "[Windows] Setup MSBuild"
|
||||
if: matrix.os == 'Windows'
|
||||
shell: bash
|
||||
run: choco install nsis
|
||||
id: add-msbuild
|
||||
uses: microsoft/setup-msbuild@v3
|
||||
with:
|
||||
msbuild-architecture: x64
|
||||
|
||||
- name: "Setup vcpkg cache"
|
||||
id: vcpkg-cache
|
||||
uses: TAServers/vcpkg-cache@v3
|
||||
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
|
||||
- name: "Build Cockatrice"
|
||||
id: build
|
||||
shell: bash
|
||||
env:
|
||||
BUILDTYPE: '${{ matrix.type }}'
|
||||
CCACHE_EVICTION_AGE: ${{ matrix.ccache_eviction_age }}
|
||||
BUILDTYPE: ${{ matrix.type }}
|
||||
CMAKE_GENERATOR: ${{ matrix.cmake_generator }}
|
||||
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_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
|
||||
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
|
||||
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
|
||||
MAKE_PACKAGE: '${{ matrix.make_package }}'
|
||||
PACKAGE_SUFFIX: '${{ matrix.package_suffix }}'
|
||||
TARGET_MACOS_VERSION: ${{ matrix.override_target }}
|
||||
MAKE_PACKAGE: ${{ matrix.make_package }}
|
||||
PACKAGE_SUFFIX: "-${{ matrix.os }}${{ matrix.os_target_version }}${{ case(matrix.soc == 'Intel', '_Intel', '') }}"
|
||||
TARGET_MACOS_VERSION: ${{ matrix.os_target_version }}
|
||||
USE_CCACHE: ${{ matrix.use_ccache }}
|
||||
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'
|
||||
VCPKG_DISABLE_METRICS: 1
|
||||
VCPKG_BINARY_SOURCES: "clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite"
|
||||
VCPKG_DISABLE_METRICS: true
|
||||
run: .ci/compile.sh --server --test --vcpkg
|
||||
|
||||
# Delete used cache to emulate a ccache update. See https://github.com/actions/cache/issues/342
|
||||
- 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
|
||||
env:
|
||||
CACHE_PRIMARY_KEY: ${{ steps.ccache_restore.outputs.cache-primary-key }}
|
||||
|
|
@ -472,14 +463,14 @@ jobs:
|
|||
fi
|
||||
|
||||
- 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
|
||||
with:
|
||||
key: ${{ steps.ccache_restore.outputs.cache-primary-key }}
|
||||
path: ${{ env.CCACHE_DIR }}
|
||||
|
||||
- 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
|
||||
env:
|
||||
BUILD_PATH: ${{ steps.build.outputs.path }}
|
||||
|
|
@ -526,7 +517,7 @@ jobs:
|
|||
fi
|
||||
|
||||
- name: "Upload artifact"
|
||||
if: matrix.make_package
|
||||
if: matrix.make_package == true
|
||||
id: upload_artifact
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
|
|
@ -546,15 +537,15 @@ jobs:
|
|||
build/servatrice/Release/*.pdb
|
||||
|
||||
- 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
|
||||
shell: bash
|
||||
env:
|
||||
asset_name: ${{ steps.build.outputs.fullname }}
|
||||
asset_path: ${{ steps.build.outputs.path }}
|
||||
ASSET_NAME: ${{ steps.build.outputs.fullname }}
|
||||
ASSET_PATH: ${{ steps.build.outputs.path }}
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
tag_name: ${{ needs.configure.outputs.tag }}
|
||||
run: gh release upload "$tag_name" "$asset_path#$asset_name"
|
||||
TAG_NAME: ${{ needs.configure.outputs.tag }}
|
||||
run: gh release upload "$TAG_NAME" "$ASSET_PATH#$ASSET_NAME"
|
||||
|
||||
- name: "Attest binary provenance"
|
||||
if: steps.upload_release.outcome == 'success'
|
||||
|
|
|
|||
12
.github/workflows/docker-release.yml
vendored
12
.github/workflows/docker-release.yml
vendored
|
|
@ -1,19 +1,19 @@
|
|||
name: Build Docker Image
|
||||
name: Build Docker
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- '.github/workflows/docker-release.yml'
|
||||
- 'Dockerfile'
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
release:
|
||||
types:
|
||||
- released # publishing of stable releases
|
||||
|
|
@ -26,9 +26,9 @@ concurrency:
|
|||
jobs:
|
||||
docker:
|
||||
name: amd64 & arm64
|
||||
if: ${{ github.repository_owner == 'Cockatrice' }}
|
||||
if: github.repository_owner == 'Cockatrice'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: actions/checkout@v7
|
||||
|
|
|
|||
|
|
@ -79,9 +79,9 @@ bool ReleaseChannel::downloadMatchesCurrentOS(const QString &fileName)
|
|||
#elif Q_PROCESSOR_WORDSIZE == 8
|
||||
const QString &version = QSysInfo::productVersion();
|
||||
if (version.startsWith("7") || version.startsWith("8")) {
|
||||
return fileName.contains("Win7");
|
||||
return fileName.contains("Win7") || fileName.contains("Windows7");
|
||||
} else {
|
||||
return fileName.contains("Win10");
|
||||
return fileName.contains("Win10") || fileName.contains("Windows10");
|
||||
}
|
||||
#else
|
||||
Q_UNUSED(fileName);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue