mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-26 08:33:54 -07:00
Update desktop-build.yml
This commit is contained in:
parent
8c7b201022
commit
80705afafe
1 changed files with 30 additions and 37 deletions
67
.github/workflows/desktop-build.yml
vendored
67
.github/workflows/desktop-build.yml
vendored
|
|
@ -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,30 +33,19 @@ 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:
|
||||||
group: "${{ github.workflow }} @ ${{ github.ref_name }}"
|
|
||||||
cancel-in-progress: ${{ github.ref_type != 'tag' }}
|
cancel-in-progress: ${{ github.ref_type != 'tag' }}
|
||||||
|
group: "${{ github.workflow }} @ ${{ github.ref_name }}"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
configure:
|
configure:
|
||||||
name: Configure
|
name: Configure
|
||||||
runs-on: ubuntu-slim
|
runs-on: ubuntu-slim
|
||||||
outputs:
|
outputs:
|
||||||
tag: ${{ steps.configure.outputs.tag }}
|
|
||||||
sha: ${{ steps.configure.outputs.sha }}
|
sha: ${{ steps.configure.outputs.sha }}
|
||||||
|
tag: ${{ steps.configure.outputs.tag }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Configure"
|
- name: "Configure"
|
||||||
|
|
@ -54,7 +54,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
tag_regex='^refs/tags/'
|
tag_regex='^refs/tags/'
|
||||||
if [[ $GITHUB_EVENT_NAME == pull-request ]]; then # pull request
|
if [[ $GITHUB_EVENT_NAME == pull-request ]]; then # pull request
|
||||||
sha="${{github.event.pull_request.head.sha}}"
|
sha="${{ github.event.pull_request.head.sha }}"
|
||||||
elif [[ $GITHUB_REF =~ $tag_regex ]]; then # release
|
elif [[ $GITHUB_REF =~ $tag_regex ]]; then # release
|
||||||
sha="$GITHUB_SHA"
|
sha="$GITHUB_SHA"
|
||||||
tag="${GITHUB_REF/refs\/tags\//}"
|
tag="${GITHUB_REF/refs\/tags\//}"
|
||||||
|
|
@ -71,8 +71,8 @@ jobs:
|
||||||
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
|
|
||||||
if: steps.configure.outputs.tag != null
|
if: steps.configure.outputs.tag != null
|
||||||
|
id: prepare
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
TAG: ${{ steps.configure.outputs.tag }}
|
TAG: ${{ steps.configure.outputs.tag }}
|
||||||
|
|
@ -83,12 +83,12 @@ jobs:
|
||||||
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 }}
|
||||||
|
prerelease: ${{ steps.prepare.outputs.is_beta }}
|
||||||
|
release_name: ${{ steps.prepare.outputs.title }}
|
||||||
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 }}
|
|
||||||
body_path: ${{ steps.prepare.outputs.body_path }}
|
|
||||||
prerelease: ${{ steps.prepare.outputs.is_beta }}
|
|
||||||
run: |
|
run: |
|
||||||
args=()
|
args=()
|
||||||
[[ $prerelease == yes ]] && args+=(--prerelease)
|
[[ $prerelease == yes ]] && args+=(--prerelease)
|
||||||
|
|
@ -188,13 +188,13 @@ jobs:
|
||||||
--cmake-generator "$CMAKE_GENERATOR"
|
--cmake-generator "$CMAKE_GENERATOR"
|
||||||
|
|
||||||
- name: "Build release package"
|
- name: "Build release package"
|
||||||
id: build
|
|
||||||
if: matrix.package != 'skip'
|
if: matrix.package != 'skip'
|
||||||
|
id: build
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
SUFFIX: '-${{ matrix.distro }}${{ matrix.version }}'
|
|
||||||
package: '${{ matrix.package }}'
|
package: '${{ matrix.package }}'
|
||||||
server_only: '${{ matrix.server_only }}'
|
server_only: '${{ matrix.server_only }}'
|
||||||
|
SUFFIX: '-${{ matrix.distro }}${{ matrix.version }}'
|
||||||
run: |
|
run: |
|
||||||
source .ci/docker.sh
|
source .ci/docker.sh
|
||||||
args=()
|
args=()
|
||||||
|
|
@ -225,8 +225,8 @@ jobs:
|
||||||
path: ${{ env.CACHE }}
|
path: ${{ env.CACHE }}
|
||||||
|
|
||||||
- name: "Upload artifact"
|
- name: "Upload artifact"
|
||||||
id: upload_artifact
|
|
||||||
if: matrix.package != 'skip'
|
if: matrix.package != 'skip'
|
||||||
|
id: upload_artifact
|
||||||
uses: actions/upload-artifact@v7
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
archive: false
|
archive: false
|
||||||
|
|
@ -234,8 +234,8 @@ jobs:
|
||||||
path: ${{ steps.build.outputs.path }}
|
path: ${{ steps.build.outputs.path }}
|
||||||
|
|
||||||
- name: "Upload to release"
|
- name: "Upload to release"
|
||||||
id: upload_release
|
|
||||||
if: matrix.package != 'skip' && needs.configure.outputs.tag != null
|
if: matrix.package != 'skip' && needs.configure.outputs.tag != null
|
||||||
|
id: upload_release
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
asset_name: ${{ steps.build.outputs.fullname }}
|
asset_name: ${{ steps.build.outputs.fullname }}
|
||||||
|
|
@ -245,8 +245,8 @@ jobs:
|
||||||
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
|
|
||||||
if: steps.upload_release.outcome == 'success'
|
if: steps.upload_release.outcome == 'success'
|
||||||
|
id: attestation
|
||||||
uses: actions/attest@v4
|
uses: actions/attest@v4
|
||||||
with:
|
with:
|
||||||
show-summary: false
|
show-summary: false
|
||||||
|
|
@ -268,7 +268,6 @@ jobs:
|
||||||
target: 13
|
target: 13
|
||||||
runner: macos-15-intel
|
runner: macos-15-intel
|
||||||
|
|
||||||
ccache_eviction_age: 7d
|
|
||||||
cmake_generator: Ninja
|
cmake_generator: Ninja
|
||||||
make_package: 1
|
make_package: 1
|
||||||
override_target: 13
|
override_target: 13
|
||||||
|
|
@ -285,7 +284,6 @@ jobs:
|
||||||
target: 14
|
target: 14
|
||||||
runner: macos-14
|
runner: macos-14
|
||||||
|
|
||||||
ccache_eviction_age: 7d
|
|
||||||
cmake_generator: Ninja
|
cmake_generator: Ninja
|
||||||
make_package: 1
|
make_package: 1
|
||||||
package_suffix: "-macOS14"
|
package_suffix: "-macOS14"
|
||||||
|
|
@ -301,7 +299,6 @@ jobs:
|
||||||
target: 15
|
target: 15
|
||||||
runner: macos-15
|
runner: macos-15
|
||||||
|
|
||||||
ccache_eviction_age: 7d
|
|
||||||
cmake_generator: Ninja
|
cmake_generator: Ninja
|
||||||
make_package: 1
|
make_package: 1
|
||||||
package_suffix: "-macOS15"
|
package_suffix: "-macOS15"
|
||||||
|
|
@ -317,7 +314,6 @@ jobs:
|
||||||
target: 15
|
target: 15
|
||||||
runner: macos-15
|
runner: macos-15
|
||||||
|
|
||||||
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
|
||||||
|
|
@ -346,6 +342,7 @@ jobs:
|
||||||
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:
|
||||||
|
|
@ -443,16 +440,12 @@ jobs:
|
||||||
id: build
|
id: build
|
||||||
shell: bash
|
shell: bash
|
||||||
env:
|
env:
|
||||||
BUILDTYPE: '${{matrix.type}}'
|
BUILDTYPE: ${{ matrix.type }}
|
||||||
MAKE_PACKAGE: '${{matrix.make_package}}'
|
CMAKE_GENERATOR: ${{ matrix.cmake_generator }}
|
||||||
PACKAGE_SUFFIX: '${{matrix.package_suffix}}'
|
CMAKE_GENERATOR_PLATFORM: ${{ matrix.cmake_generator_platform }}
|
||||||
CMAKE_GENERATOR: ${{matrix.cmake_generator}}
|
DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer'
|
||||||
CMAKE_GENERATOR_PLATFORM: ${{matrix.cmake_generator_platform}}
|
MAKE_PACKAGE: ${{ matrix.make_package }}
|
||||||
USE_CCACHE: ${{matrix.use_ccache}}
|
PACKAGE_SUFFIX: ${{ matrix.package_suffix }}
|
||||||
VCPKG_DISABLE_METRICS: 1
|
|
||||||
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'
|
|
||||||
# macOS-specific environment variables, will be ignored on Windows
|
|
||||||
DEVELOPER_DIR: '/Applications/Xcode_${{matrix.xcode}}.app/Contents/Developer'
|
|
||||||
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'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue