This commit is contained in:
tooomm 2026-06-21 17:32:23 +00:00 committed by GitHub
commit 14bce07d9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 67 additions and 67 deletions

View file

@ -23,18 +23,18 @@ fi
# create title
if [[ $TAG =~ $beta_regex ]]; then
echo "is_beta=yes" >>"$GITHUB_OUTPUT"
echo "is_beta=true" >>"$GITHUB_OUTPUT"
title="$TAG"
echo "creating beta release '$title'"
elif [[ ! $(cat CMakeLists.txt) =~ $name_regex ]]; then
echo "::error file=$0::could not find releasename in CMakeLists.txt"
exit 1
else
echo "is_beta=no" >>"$GITHUB_OUTPUT"
echo "is_beta=false" >>"$GITHUB_OUTPUT"
name="${BASH_REMATCH[1]}"
version="${TAG##*-}"
title="Cockatrice $version: $name"
no_beta=1
no_beta=true
echo "friendly_name=$name" >>"$GITHUB_OUTPUT"
echo "creating full release '$title'"
fi

View file

@ -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:
@ -79,19 +79,19 @@ jobs:
shell: bash
env:
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 }}
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 }}
run: |
args=()
[[ $prerelease == yes ]] && args+=(--prerelease)
[[ "$PRERELEASE" == "true" ]] && args+=(--prerelease)
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:
@ -101,21 +101,21 @@ jobs:
include:
- distro: Arch
allow-failure: yes
package: skip # We are packaged in Arch already
allow-failure: true
package: false # We are packaged in Arch already
- distro: Servatrice_Debian
version: 12
package: DEB
server_only: yes
test: skip
server_only: true
test: false
- distro: Debian
version: 12
package: DEB
test: skip # Running tests on all distros is superfluous
test: false # Running tests on all distros is superfluous
- distro: Debian
version: 13
@ -126,7 +126,7 @@ jobs:
version: 43
package: RPM
test: skip # Running tests on all distros is superfluous
test: false # Running tests on all distros is superfluous
- distro: Fedora
version: 44
@ -137,7 +137,7 @@ jobs:
version: 24.04
package: DEB
test: skip # Running tests on all distros is superfluous
test: false # Running tests on all distros is superfluous
- distro: Ubuntu
version: 26.04
@ -147,7 +147,7 @@ jobs:
name: ${{ matrix.distro }} ${{ matrix.version }}
needs: configure
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.allow-failure == 'yes' }}
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
@ -175,7 +175,7 @@ jobs:
run: source .ci/docker.sh --build
- name: "Build debug and test"
if: matrix.test != 'skip'
if: matrix.test != false
shell: bash
run: |
source .ci/docker.sh
@ -184,22 +184,22 @@ jobs:
- name: "Build release package"
id: build
if: matrix.package != 'skip'
if: matrix.package != false
shell: bash
env:
SUFFIX: '-${{ matrix.distro }}${{ matrix.version }}'
package: '${{ matrix.package }}'
server_only: '${{ matrix.server_only }}'
PACKAGE: '${{ matrix.package }}'
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")
[[ "$SERVER_ONLY" == "true" ]] && args+=(--no-client)
[[ "$GITHUB_REF" == "refs/heads/master" ]] && args+=(--evict-ccache "$CCACHE_EVICTION_AGE")
args+=(--ccache "$CCACHE_SIZE")
args+=(--cmake-generator "$CMAKE_GENERATOR")
args+=(--suffix "$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)"
@ -222,7 +222,7 @@ jobs:
- name: "Upload artifact"
id: upload_artifact
if: matrix.package != 'skip'
if: matrix.package != false
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 != false && needs.configure.outputs.tag != null
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
@ -267,7 +267,7 @@ jobs:
ccache_eviction_age: 7d
cmake_generator: Ninja
make_package: 1
make_package: true
override_target: 13
package_suffix: "-macOS13_Intel"
qt_version: 6.11.0
@ -275,7 +275,7 @@ jobs:
qt_modules: qtimageformats qtmultimedia qtwebsockets
soc: Intel
type: Release
use_ccache: 1
use_ccache: true
xcode: "16.4"
- os: macOS
@ -284,14 +284,14 @@ jobs:
ccache_eviction_age: 7d
cmake_generator: Ninja
make_package: 1
make_package: true
package_suffix: "-macOS14"
qt_version: 6.11.0
qt_arch: clang_64
qt_modules: qtimageformats qtmultimedia qtwebsockets
soc: Apple
type: Release
use_ccache: 1
use_ccache: true
xcode: "15.4"
- os: macOS
@ -300,14 +300,14 @@ jobs:
ccache_eviction_age: 7d
cmake_generator: Ninja
make_package: 1
make_package: true
package_suffix: "-macOS15"
qt_version: 6.11.0
qt_arch: clang_64
qt_modules: qtimageformats qtmultimedia qtwebsockets
soc: Apple
type: Release
use_ccache: 1
use_ccache: true
xcode: "16.4"
- os: macOS
@ -321,7 +321,7 @@ jobs:
qt_modules: qtimageformats qtmultimedia qtwebsockets
soc: Apple
type: Debug
use_ccache: 1
use_ccache: true
xcode: "16.4"
- os: Windows
@ -330,14 +330,14 @@ jobs:
cmake_generator: "Visual Studio 18 2026"
cmake_generator_platform: x64
make_package: 1
make_package: true
package_suffix: "-Win10"
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.target }}${{ case(matrix.soc == 'Intel', ' Intel', '') }}${{ case(matrix.type == 'Debug', ' Debug', '') }}
needs: configure
runs-on: ${{ matrix.runner }}
timeout-minutes: 100
@ -359,11 +359,11 @@ jobs:
msbuild-architecture: x64
- name: "[macOS] Setup ccache"
if: matrix.os == 'macOS' && matrix.use_ccache == 1
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
if: matrix.os == 'macOS' && matrix.use_ccache == true
id: ccache_restore
uses: actions/cache/restore@v5
env:
@ -456,12 +456,12 @@ jobs:
TARGET_MACOS_VERSION: ${{ matrix.override_target }}
USE_CCACHE: ${{ matrix.use_ccache }}
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
# 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
continue-on-error: true
env:
CACHE_PRIMARY_KEY: ${{ steps.ccache_restore.outputs.cache-primary-key }}
@ -472,7 +472,7 @@ 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@v5
with:
key: ${{ steps.ccache_restore.outputs.cache-primary-key }}
@ -546,15 +546,15 @@ jobs:
build/servatrice/Release/*.pdb
- name: "Upload to release"
if: needs.configure.outputs.tag != null && matrix.make_package == '1'
if: needs.configure.outputs.tag != null && matrix.make_package == true
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'

View file

@ -5,15 +5,15 @@ permissions:
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