From 4877990020cff6aa1e16259cd4cf61b1cd7f1520 Mon Sep 17 00:00:00 2001 From: Phred Date: Sun, 14 Jun 2026 00:18:16 -0500 Subject: [PATCH 1/4] simplified build workflow --- .github/workflows/desktop-build.yml | 56 +++++++++++++++-------------- 1 file changed, 29 insertions(+), 27 deletions(-) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 179fd824f..15eae462b 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -36,7 +36,7 @@ on: # Cancel earlier, unfinished runs of this workflow on the same branch (unless on release) concurrency: - group: "${{ github.workflow }} @ ${{ github.ref_name }}" + group: ${{ github.workflow }} @ ${{ github.ref_name }} cancel-in-progress: ${{ github.ref_type != 'tag' }} jobs: @@ -47,22 +47,24 @@ jobs: tag: ${{ steps.configure.outputs.tag }} sha: ${{ steps.configure.outputs.sha }} - steps: + steps: - name: "Configure" + env: + RESOLVED_SHA: >- + ${{ + case( + github.event_name == 'pull_reuqest', + github.event.pull_request.head.sha, + github.sha + ) + }} id: configure shell: bash run: | - tag_regex='^refs/tags/' - if [[ $GITHUB_EVENT_NAME == pull-request ]]; then # pull request - sha="${{github.event.pull_request.head.sha}}" - elif [[ $GITHUB_REF =~ $tag_regex ]]; then # release - sha="$GITHUB_SHA" - tag="${GITHUB_REF/refs\/tags\//}" - echo "tag=$tag" >>"$GITHUB_OUTPUT" - else # push to branch - sha="$GITHUB_SHA" + if [[ "$GITHUB_REF_TYPE" == 'tag' ]]; then # release + echo "tag=$GITHUB_REF_NAME" >> "$GITHUB_OUTPUT" fi - echo "sha=$sha" >>"$GITHUB_OUTPUT" + echo "sha=$RESOLVED_SHA" >> "$GITHUB_OUTPUT" - name: "Checkout" if: steps.configure.outputs.tag != null @@ -92,7 +94,7 @@ jobs: run: | args=() [[ $prerelease == yes ]] && args+=(--prerelease) - + gh release create "$tag_name" --verify-tag --draft "${args[@]}" \ --target "$target" \ --title "$release_name" \ @@ -105,48 +107,48 @@ jobs: # The files in ".ci/$distro$version" correspond to the values given here include: - distro: Arch - + allow-failure: yes package: skip # We are packaged in Arch already - distro: Servatrice_Debian version: 12 - + package: DEB server_only: yes test: skip - distro: Debian version: 12 - + package: DEB test: skip # Running tests on all distros is superfluous - distro: Debian version: 13 - + package: DEB - distro: Fedora version: 43 - + package: RPM test: skip # Running tests on all distros is superfluous - distro: Fedora version: 44 - + package: RPM - distro: Ubuntu version: 24.04 - + package: DEB test: skip # Running tests on all distros is superfluous - distro: Ubuntu version: 26.04 - + package: DEB name: ${{ matrix.distro }} ${{ matrix.version }} @@ -203,7 +205,7 @@ jobs: args+=(--ccache "$CCACHE_SIZE") args+=(--cmake-generator "$CMAKE_GENERATOR") args+=(--suffix "$SUFFIX") - + RUN --server --release --package "$package" "${args[@]}" # Delete used cache to emulate a ccache update. See https://github.com/actions/cache/issues/342 @@ -267,7 +269,7 @@ jobs: - os: macOS target: 13 runner: macos-15-intel - + ccache_eviction_age: 7d cmake_generator: Ninja make_package: 1 @@ -284,7 +286,7 @@ jobs: - os: macOS target: 14 runner: macos-14 - + ccache_eviction_age: 7d cmake_generator: Ninja make_package: 1 @@ -300,7 +302,7 @@ jobs: - os: macOS target: 15 runner: macos-15 - + ccache_eviction_age: 7d cmake_generator: Ninja make_package: 1 @@ -316,7 +318,7 @@ jobs: - os: macOS target: 15 runner: macos-15 - + ccache_eviction_age: 7d cmake_generator: Ninja qt_version: 6.11.0 @@ -330,7 +332,7 @@ jobs: - os: Windows target: 10 runner: windows-2025 - + cmake_generator: "Visual Studio 18 2026" cmake_generator_platform: x64 make_package: 1 From c346768a8ce2f07b496116b33d0d02a2bd81e1e1 Mon Sep 17 00:00:00 2001 From: Phred Date: Sun, 14 Jun 2026 00:39:31 -0500 Subject: [PATCH 2/4] cleaned up translation workflows --- .github/workflows/translations-pull.yml | 23 ++++++++++++-------- .github/workflows/translations-push.yml | 28 +++++++++++++++---------- 2 files changed, 31 insertions(+), 20 deletions(-) diff --git a/.github/workflows/translations-pull.yml b/.github/workflows/translations-pull.yml index 057381f8a..eb12ddda1 100644 --- a/.github/workflows/translations-pull.yml +++ b/.github/workflows/translations-pull.yml @@ -41,11 +41,11 @@ jobs: author: github-actions # owner of the commit body: | Pulled all translated strings from [Transifex][1]. - + --- *This PR is automatically generated and updated by the workflow at `.github/workflows/translations-pull.yml`. Review [action runs][2].*
*After merging, all new languages and translations are available in the next build.* - + [1]: https://explore.transifex.com/cockatrice/cockatrice/ [2]: https://github.com/Cockatrice/Cockatrice/actions/workflows/translations-pull.yml?query=branch%3Amaster branch: ci-update_translations @@ -61,11 +61,16 @@ jobs: if: github.event_name != 'pull_request' shell: bash env: - STATUS: ${{ steps.create_pr.outputs.pull-request-operation }} + PR_NUMBER: ${{ steps.create_pr.outputs.pull-request-number }} + PR_URL: ${{ steps.create_pr.outputs.pull-request-url }} + STATUS: >- + ${{ + case( + steps.create_pr.outputs.pull-request-operation == 'none', + 'unchanged', + steps.create_pr.outputs.pull-request-operation + ) + }} run: | - if [[ "$STATUS" == "none" ]]; then - echo "PR #${{ steps.create_pr.outputs.pull-request-number }} unchanged!" >> $GITHUB_STEP_SUMMARY - else - echo "PR #${{ steps.create_pr.outputs.pull-request-number }} $STATUS!" >> $GITHUB_STEP_SUMMARY - fi - echo "URL: ${{ steps.create_pr.outputs.pull-request-url }}" >> $GITHUB_STEP_SUMMARY + echo "PR #$PR_NUMBER $STATUS!" >> "$GITHUB_STEP_SUMMARY" + echo "URL: $PR_URL" >> "$GITHUB_STEP_SUMMARY" diff --git a/.github/workflows/translations-push.yml b/.github/workflows/translations-push.yml index 4adcaf4a4..a4a32b979 100644 --- a/.github/workflows/translations-push.yml +++ b/.github/workflows/translations-push.yml @@ -29,12 +29,13 @@ jobs: sudo apt-get install -y --no-install-recommends qttools5-dev-tools - name: "Update Cockatrice translation source" + env: + FILE: cockatrice/cockatrice_en@source.ts id: cockatrice shell: bash - run: | - FILE="cockatrice/cockatrice_en@source.ts" - export DIRS="cockatrice/src $(find . -maxdepth 1 -type d -name 'libcockatrice_*')" - FILE="$FILE" DIRS="$DIRS" .ci/update_translation_source_strings.sh + run: > + DIRS="cockatrice/src $(find . -maxdepth 1 -type d -name 'libcockatrice_*')" + .ci/update_translation_source_strings.sh - name: "Update Oracle translation source" id: oracle @@ -77,11 +78,16 @@ jobs: if: github.event_name != 'pull_request' shell: bash env: - STATUS: ${{ steps.create_pr.outputs.pull-request-operation }} + PR_NUMBER: ${{ steps.create_pr.outputs.pull-request-number }} + PR_URL: ${{ steps.create_pr.outputs.pull-request-url }} + STATUS: >- + ${{ + case( + steps.create_pr.outputs.pull-request-operation == 'none', + 'unchanged', + steps.create_pr.outputs.pull-request-operation + ) + }} run: | - if [[ "$STATUS" == "none" ]]; then - echo "PR #${{ steps.create_pr.outputs.pull-request-number }} unchanged!" >> $GITHUB_STEP_SUMMARY - else - echo "PR #${{ steps.create_pr.outputs.pull-request-number }} $STATUS!" >> $GITHUB_STEP_SUMMARY - fi - echo "URL: ${{ steps.create_pr.outputs.pull-request-url }}" >> $GITHUB_STEP_SUMMARY + echo "PR #$PR_NUMBER $STATUS!" >> "$GITHUB_STEP_SUMMARY" + echo "URL: $PR_URL" >> "$GITHUB_STEP_SUMMARY" From cfe9ddadf164e5dde171fcde7471134edd0c99af Mon Sep 17 00:00:00 2001 From: Phred Date: Sun, 14 Jun 2026 07:19:39 -0500 Subject: [PATCH 3/4] fixed typo --- .github/workflows/desktop-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index 15eae462b..e8d955745 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -53,7 +53,7 @@ jobs: RESOLVED_SHA: >- ${{ case( - github.event_name == 'pull_reuqest', + github.event_name == 'pull_request', github.event.pull_request.head.sha, github.sha ) From 6616cc0decbcd2efae5bd2b6568b225dee81363f Mon Sep 17 00:00:00 2001 From: Phred Lane Date: Sun, 14 Jun 2026 12:41:48 -0500 Subject: [PATCH 4/4] updated format based on code review Co-authored-by: tooomm --- .github/workflows/desktop-build.yml | 9 +-------- .github/workflows/translations-pull.yml | 9 +-------- .github/workflows/translations-push.yml | 9 +-------- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/.github/workflows/desktop-build.yml b/.github/workflows/desktop-build.yml index e8d955745..b7eaaea92 100644 --- a/.github/workflows/desktop-build.yml +++ b/.github/workflows/desktop-build.yml @@ -50,14 +50,7 @@ jobs: steps: - name: "Configure" env: - RESOLVED_SHA: >- - ${{ - case( - github.event_name == 'pull_request', - github.event.pull_request.head.sha, - github.sha - ) - }} + RESOLVED_SHA: ${{ case(github.event_name == 'pull_request', github.event.pull_request.head.sha, github.sha) }} id: configure shell: bash run: | diff --git a/.github/workflows/translations-pull.yml b/.github/workflows/translations-pull.yml index eb12ddda1..bafcfe022 100644 --- a/.github/workflows/translations-pull.yml +++ b/.github/workflows/translations-pull.yml @@ -63,14 +63,7 @@ jobs: env: PR_NUMBER: ${{ steps.create_pr.outputs.pull-request-number }} PR_URL: ${{ steps.create_pr.outputs.pull-request-url }} - STATUS: >- - ${{ - case( - steps.create_pr.outputs.pull-request-operation == 'none', - 'unchanged', - steps.create_pr.outputs.pull-request-operation - ) - }} + STATUS: ${{ case(steps.create_pr.outputs.pull-request-operation == 'none', 'unchanged', steps.create_pr.outputs.pull-request-operation) }} run: | echo "PR #$PR_NUMBER $STATUS!" >> "$GITHUB_STEP_SUMMARY" echo "URL: $PR_URL" >> "$GITHUB_STEP_SUMMARY" diff --git a/.github/workflows/translations-push.yml b/.github/workflows/translations-push.yml index a4a32b979..efdfeaf3d 100644 --- a/.github/workflows/translations-push.yml +++ b/.github/workflows/translations-push.yml @@ -80,14 +80,7 @@ jobs: env: PR_NUMBER: ${{ steps.create_pr.outputs.pull-request-number }} PR_URL: ${{ steps.create_pr.outputs.pull-request-url }} - STATUS: >- - ${{ - case( - steps.create_pr.outputs.pull-request-operation == 'none', - 'unchanged', - steps.create_pr.outputs.pull-request-operation - ) - }} + STATUS: ${{ case(steps.create_pr.outputs.pull-request-operation == 'none', 'unchanged', steps.create_pr.outputs.pull-request-operation) }} run: | echo "PR #$PR_NUMBER $STATUS!" >> "$GITHUB_STEP_SUMMARY" echo "URL: $PR_URL" >> "$GITHUB_STEP_SUMMARY"