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 # create title
if [[ $TAG =~ $beta_regex ]]; then if [[ $TAG =~ $beta_regex ]]; then
echo "is_beta=yes" >>"$GITHUB_OUTPUT" echo "is_beta=true" >>"$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" echo "is_beta=false" >>"$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 no_beta=true
echo "friendly_name=$name" >>"$GITHUB_OUTPUT" echo "friendly_name=$name" >>"$GITHUB_OUTPUT"
echo "creating full release '$title'" echo "creating full release '$title'"
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:
@ -79,19 +79,19 @@ jobs:
shell: bash shell: bash
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
tag_name: ${{ steps.configure.outputs.tag }} TAG_NAME: ${{ steps.configure.outputs.tag }}
target: ${{ steps.configure.outputs.sha }} TARGET: ${{ steps.configure.outputs.sha }}
release_name: ${{ steps.prepare.outputs.title }} RELEASE_NAME: ${{ steps.prepare.outputs.title }}
body_path: ${{ steps.prepare.outputs.body_path }} BODY_PATH: ${{ steps.prepare.outputs.body_path }}
prerelease: ${{ steps.prepare.outputs.is_beta }} PRERELEASE: ${{ steps.prepare.outputs.is_beta }}
run: | run: |
args=() args=()
[[ $prerelease == yes ]] && args+=(--prerelease) [[ "$PRERELEASE" == "true" ]] && args+=(--prerelease)
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:
@ -101,21 +101,21 @@ jobs:
include: include:
- distro: Arch - distro: Arch
allow-failure: yes allow-failure: true
package: skip # We are packaged in Arch already package: false # We are packaged in Arch already
- distro: Servatrice_Debian - distro: Servatrice_Debian
version: 12 version: 12
package: DEB package: DEB
server_only: yes server_only: true
test: skip test: false
- distro: Debian - distro: Debian
version: 12 version: 12
package: DEB package: DEB
test: skip # Running tests on all distros is superfluous test: false # Running tests on all distros is superfluous
- distro: Debian - distro: Debian
version: 13 version: 13
@ -126,7 +126,7 @@ jobs:
version: 43 version: 43
package: RPM package: RPM
test: skip # Running tests on all distros is superfluous test: false # Running tests on all distros is superfluous
- distro: Fedora - distro: Fedora
version: 44 version: 44
@ -137,7 +137,7 @@ jobs:
version: 24.04 version: 24.04
package: DEB package: DEB
test: skip # Running tests on all distros is superfluous test: false # Running tests on all distros is superfluous
- distro: Ubuntu - distro: Ubuntu
version: 26.04 version: 26.04
@ -147,7 +147,7 @@ jobs:
name: ${{ matrix.distro }} ${{ matrix.version }} name: ${{ matrix.distro }} ${{ matrix.version }}
needs: configure needs: configure
runs-on: ubuntu-latest runs-on: ubuntu-latest
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 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 run: source .ci/docker.sh --build
- name: "Build debug and test" - name: "Build debug and test"
if: matrix.test != 'skip' if: matrix.test != false
shell: bash shell: bash
run: | run: |
source .ci/docker.sh source .ci/docker.sh
@ -184,22 +184,22 @@ jobs:
- name: "Build release package" - name: "Build release package"
id: build id: build
if: matrix.package != 'skip' if: matrix.package != false
shell: bash shell: bash
env: env:
SUFFIX: '-${{ matrix.distro }}${{ matrix.version }}' SUFFIX: '-${{ matrix.distro }}${{ matrix.version }}'
package: '${{ matrix.package }}' PACKAGE: '${{ matrix.package }}'
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) [[ "$SERVER_ONLY" == "true" ]] && 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")
args+=(--ccache "$CCACHE_SIZE") args+=(--ccache "$CCACHE_SIZE")
args+=(--cmake-generator "$CMAKE_GENERATOR") args+=(--cmake-generator "$CMAKE_GENERATOR")
args+=(--suffix "$SUFFIX") 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 # 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)"
@ -222,7 +222,7 @@ jobs:
- name: "Upload artifact" - name: "Upload artifact"
id: upload_artifact id: upload_artifact
if: matrix.package != 'skip' if: matrix.package != false
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 != false && needs.configure.outputs.tag != null
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
@ -267,7 +267,7 @@ jobs:
ccache_eviction_age: 7d ccache_eviction_age: 7d
cmake_generator: Ninja cmake_generator: Ninja
make_package: 1 make_package: true
override_target: 13 override_target: 13
package_suffix: "-macOS13_Intel" package_suffix: "-macOS13_Intel"
qt_version: 6.11.0 qt_version: 6.11.0
@ -275,7 +275,7 @@ jobs:
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: "16.4"
- os: macOS - os: macOS
@ -284,14 +284,14 @@ jobs:
ccache_eviction_age: 7d ccache_eviction_age: 7d
cmake_generator: Ninja cmake_generator: Ninja
make_package: 1 make_package: true
package_suffix: "-macOS14" 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: "15.4"
- os: macOS - os: macOS
@ -300,14 +300,14 @@ jobs:
ccache_eviction_age: 7d ccache_eviction_age: 7d
cmake_generator: Ninja cmake_generator: Ninja
make_package: 1 make_package: true
package_suffix: "-macOS15" 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: "16.4"
- os: macOS - os: macOS
@ -321,7 +321,7 @@ jobs:
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: "16.4"
- os: Windows - os: Windows
@ -330,14 +330,14 @@ jobs:
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" 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.target }}${{ 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
@ -359,11 +359,11 @@ jobs:
msbuild-architecture: x64 msbuild-architecture: x64
- name: "[macOS] Setup ccache" - name: "[macOS] Setup ccache"
if: matrix.os == 'macOS' && matrix.use_ccache == 1 if: matrix.os == 'macOS' && matrix.use_ccache == true
run: brew install ccache run: brew install ccache
- name: "[macOS] Restore compiler cache (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 id: ccache_restore
uses: actions/cache/restore@v5 uses: actions/cache/restore@v5
env: env:
@ -456,12 +456,12 @@ jobs:
TARGET_MACOS_VERSION: ${{ matrix.override_target }} TARGET_MACOS_VERSION: ${{ matrix.override_target }}
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
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,7 +472,7 @@ 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@v5 uses: actions/cache/save@v5
with: with:
key: ${{ steps.ccache_restore.outputs.cache-primary-key }} key: ${{ steps.ccache_restore.outputs.cache-primary-key }}
@ -546,15 +546,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: needs.configure.outputs.tag != null && matrix.make_package == true
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

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