Label & variables

This commit is contained in:
tooomm 2026-05-30 22:36:53 +02:00
parent 6de55e9096
commit 395e3d0cfd

View file

@ -1,10 +1,10 @@
name: Build Desktop name: Build Desktop
permissions: permissions:
actions: write # needed for ccache action to be able to delete gha caches
attestations: write
contents: write contents: write
id-token: write id-token: write
attestations: write
actions: write # needed for ccache action to be able to delete gha caches
on: on:
push: push:
@ -19,7 +19,6 @@ on:
- '.github/workflows/desktop-build.yml' - '.github/workflows/desktop-build.yml'
- 'CMakeLists.txt' - 'CMakeLists.txt'
- 'vcpkg.json' - 'vcpkg.json'
- 'vcpkg'
tags: tags:
- '*' - '*'
pull_request: pull_request:
@ -32,7 +31,6 @@ on:
- '.github/workflows/desktop-build.yml' - '.github/workflows/desktop-build.yml'
- 'CMakeLists.txt' - 'CMakeLists.txt'
- 'vcpkg.json' - 'vcpkg.json'
- 'vcpkg'
# 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:
@ -44,8 +42,8 @@ jobs:
name: Configure name: Configure
runs-on: ubuntu-slim runs-on: ubuntu-slim
outputs: outputs:
tag: ${{steps.configure.outputs.tag}} tag: ${{ steps.configure.outputs.tag }}
sha: ${{steps.configure.outputs.sha}} sha: ${{ steps.configure.outputs.sha }}
steps: steps:
- name: Configure - name: Configure
@ -75,7 +73,7 @@ jobs:
if: steps.configure.outputs.tag != null if: steps.configure.outputs.tag != null
shell: bash shell: bash
env: env:
TAG: ${{steps.configure.outputs.tag}} TAG: ${{ steps.configure.outputs.tag }}
run: .ci/prep_release.sh run: .ci/prep_release.sh
- name: Create release - name: Create release
@ -83,12 +81,12 @@ jobs:
id: create_release id: create_release
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: |
if [[ $prerelease == yes ]]; then if [[ $prerelease == yes ]]; then
args="--prerelease" args="--prerelease"
@ -140,14 +138,14 @@ jobs:
version: 26.04 version: 26.04
package: DEB package: DEB
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 == 'yes' }}
timeout-minutes: 70 timeout-minutes: 70
env: env:
NAME: ${{matrix.distro}}${{matrix.version}} NAME: ${{ matrix.distro }}${{ matrix.version }}
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
# Cache size over the entire repo is 10Gi: # Cache size over the entire repo is 10Gi:
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy # https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
CCACHE_SIZE: 550M CCACHE_SIZE: 550M
@ -155,24 +153,24 @@ jobs:
CMAKE_GENERATOR: 'Ninja' CMAKE_GENERATOR: 'Ninja'
steps: steps:
- name: Checkout - name: "Checkout"
uses: actions/checkout@v6 uses: actions/checkout@v6
- name: Restore compiler cache (ccache) - name: "Restore compiler cache (ccache)"
id: ccache_restore id: ccache_restore
uses: actions/cache/restore@v5 uses: actions/cache/restore@v5
env: env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
with: with:
path: ${{env.CACHE}} path: ${{ env.CACHE }}
key: ccache-${{matrix.distro}}${{matrix.version}}-${{env.BRANCH_NAME}} key: ccache-${{ matrix.distro }}${{ matrix.version }}-${{ env.BRANCH_NAME }}
restore-keys: ccache-${{matrix.distro}}${{matrix.version}}- restore-keys: ccache-${{ matrix.distro }}${{ matrix.version }}-
- name: Build ${{matrix.distro}} ${{matrix.version}} Docker image - name: "Build ${{ matrix.distro }} ${{ matrix.version }} Docker image"
shell: bash shell: bash
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 != 'skip'
shell: bash shell: bash
run: | run: |
@ -180,14 +178,14 @@ jobs:
RUN --server --debug --test --ccache "$CCACHE_SIZE" \ RUN --server --debug --test --ccache "$CCACHE_SIZE" \
--cmake-generator "$CMAKE_GENERATOR" --cmake-generator "$CMAKE_GENERATOR"
- name: Build release package - name: "Build release package"
id: build id: build
if: matrix.package != 'skip' if: matrix.package != 'skip'
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=()
@ -203,7 +201,7 @@ jobs:
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)"
if: github.ref == 'refs/heads/master' && steps.ccache_restore.outputs.cache-hit if: github.ref == 'refs/heads/master' && steps.ccache_restore.outputs.cache-hit
continue-on-error: true continue-on-error: true
env: env:
@ -213,47 +211,47 @@ jobs:
echo "Cache deleted successfully" echo "Cache deleted successfully"
fi fi
- name: Save updated compiler cache (ccache) - name: "Save updated compiler cache (ccache)"
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
uses: actions/cache/save@v5 uses: actions/cache/save@v5
with: with:
path: ${{env.CACHE}} path: ${{ env.CACHE }
key: ${{ steps.ccache_restore.outputs.cache-primary-key }} key: ${{ steps.ccache_restore.outputs.cache-primary-key }}
- name: Upload artifact - name: "Upload artifact"
id: upload_artifact id: upload_artifact
if: matrix.package != 'skip' if: matrix.package != 'skip'
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7
with: with:
path: ${{steps.build.outputs.path}} path: ${{ steps.build.outputs.path }}
archive: false archive: false
if-no-files-found: error if-no-files-found: error
- 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 != 'skip' && needs.configure.outputs.tag != null
shell: bash shell: bash
env: env:
GH_TOKEN: ${{github.token}} GH_TOKEN: ${{ github.token }}
tag_name: ${{needs.configure.outputs.tag}} tag_name: ${{ needs.configure.outputs.tag }}
asset_name: ${{steps.build.outputs.fullname}} asset_name: ${{ steps.build.outputs.fullname }}
asset_path: ${{steps.build.outputs.path}} asset_path: ${{ steps.build.outputs.path }}
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
if: steps.upload_release.outcome == 'success' if: steps.upload_release.outcome == 'success'
uses: actions/attest@v4 uses: actions/attest@v4
with: with:
subject-path: ${{steps.build.outputs.path}} subject-path: ${{ steps.build.outputs.path }}
show-summary: false show-summary: false
- name: Verify binary attestation - name: "Verify binary attestation"
if: steps.attestation.outcome == 'success' if: steps.attestation.outcome == 'success'
shell: bash shell: bash
env: env:
GH_TOKEN: ${{github.token}} GH_TOKEN: ${{ github.token }}
run: gh attestation verify "${{steps.build.outputs.path}}" --repo Cockatrice/Cockatrice run: gh attestation verify "${{ steps.build.outputs.path }}" --repo Cockatrice/Cockatrice
build-vcpkg: build-vcpkg:
strategy: strategy:
@ -331,54 +329,54 @@ jobs:
cmake_generator: "Visual Studio 17 2022" cmake_generator: "Visual Studio 17 2022"
cmake_generator_platform: x64 cmake_generator_platform: x64
name: ${{matrix.os}} ${{matrix.target}}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }} name: ${{ matrix.os }} ${{ matrix.target }}${{ matrix.soc == 'Intel' && ' Intel' || '' }}${{ matrix.type == 'Debug' && ' Debug' || '' }}
needs: configure needs: configure
runs-on: ${{matrix.runner}} runs-on: ${{ matrix.runner }}
timeout-minutes: 100 timeout-minutes: 100
env: env:
CCACHE_DIR: ${{github.workspace}}/.cache/ CCACHE_DIR: ${{ github.workspace }}/.cache/
# Cache size over the entire repo is 10Gi: # Cache size over the entire repo is 10Gi:
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy # https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#usage-limits-and-eviction-policy
CCACHE_SIZE: 550M CCACHE_SIZE: 550M
steps: steps:
- name: Checkout - name: "Checkout"
uses: actions/checkout@v6 uses: actions/checkout@v6
with: with:
submodules: recursive submodules: recursive
- name: Add msbuild to PATH - name: "[Windows] Add msbuild to PATH"
if: matrix.os == 'Windows' if: matrix.os == 'Windows'
id: add-msbuild id: add-msbuild
uses: microsoft/setup-msbuild@v3 uses: microsoft/setup-msbuild@v3
with: with:
msbuild-architecture: x64 msbuild-architecture: x64
- name: Setup ccache - name: "[macOS] Setup ccache"
if: matrix.use_ccache == 1 && matrix.os == 'macOS' if: matrix.os == 'macOS' && matrix.use_ccache == 1
run: brew install ccache run: brew install ccache
- name: Restore compiler cache (ccache) - name: "[macOS] Restore compiler cache (ccache)"
if: matrix.use_ccache == 1 if: matrix.os == 'macOS' && matrix.use_ccache == 1
id: ccache_restore id: ccache_restore
uses: actions/cache/restore@v5 uses: actions/cache/restore@v5
env: env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
with: with:
path: ${{env.CCACHE_DIR}} path: ${{ env.CCACHE_DIR }}
key: ccache-${{matrix.runner}}-${{matrix.soc}}-${{matrix.type}}-${{env.BRANCH_NAME}} key: ccache-${{ matrix.runner }}-${{ matrix.soc }}-${{ matrix.type }}-${{ env.BRANCH_NAME }}
restore-keys: ccache-${{matrix.runner}}-${{matrix.soc}}-${{matrix.type}}- restore-keys: ccache-${{ matrix.runner }}-${{ matrix.soc }}-${{ matrix.type }}-
- name: Install aqtinstall - name: "Install aqtinstall"
run: pipx install aqtinstall run: pipx install aqtinstall
# Resolve given wildcard versions (e.g. Qt 6.6.*) to latest version via aqtinstall to avoid stale caches on new releases # Resolve given wildcard versions (e.g. Qt 6.6.*) to latest version via aqtinstall to avoid stale caches on new releases
- name: Resolve latest Qt patch version - name: "Resolve latest Qt patch version"
id: resolve_qt_version id: resolve_qt_version
shell: bash shell: bash
run: .ci/resolve_latest_aqt_qt_version.sh "${{matrix.qt_version}}" run: .ci/resolve_latest_aqt_qt_version.sh "${{ matrix.qt_version }}"
- name: Restore thin Qt ${{ steps.resolve_qt_version.outputs.version }} libraries (${{ matrix.soc }} macOS) - name: "[macOS] Restore thin Qt ${{ steps.resolve_qt_version.outputs.version }} libraries"
if: matrix.os == 'macOS' if: matrix.os == 'macOS'
id: restore_qt id: restore_qt
uses: actions/cache/restore@v5 uses: actions/cache/restore@v5
@ -387,61 +385,61 @@ jobs:
key: thin-qt-macos-${{ matrix.soc }}-${{ steps.resolve_qt_version.outputs.version }} key: thin-qt-macos-${{ matrix.soc }}-${{ steps.resolve_qt_version.outputs.version }}
# Using jurplel/install-qt-action to install Qt without using brew # Using jurplel/install-qt-action to install Qt without using brew
# qt build using vcpkg either just fails or takes too long to build # Qt build using vcpkg either just fails or takes too long to build
- name: Install fat Qt ${{ steps.resolve_qt_version.outputs.version }} (${{ matrix.soc }} macOS) - 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 != 'true'
uses: jurplel/install-qt-action@v4 uses: jurplel/install-qt-action@v4
with: with:
version: ${{ steps.resolve_qt_version.outputs.version }} version: ${{ steps.resolve_qt_version.outputs.version }}
arch: ${{matrix.qt_arch}} arch: ${{ matrix.qt_arch }}
modules: ${{matrix.qt_modules}} modules: ${{ matrix.qt_modules }}
cache: false cache: false
dir: ${{github.workspace}} dir: ${{ github.workspace }}
- name: Thin Qt libraries (${{ matrix.soc }} macOS) - 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 != 'true'
run: .ci/thin_macos_qtlib.sh run: .ci/thin_macos_qtlib.sh
- name: Cache thin Qt libraries (${{ matrix.soc }} macOS) - 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 != 'true'
uses: actions/cache/save@v5 uses: actions/cache/save@v5
with: with:
path: ${{ github.workspace }}/Qt path: ${{ github.workspace }}/Qt
key: thin-qt-macos-${{ matrix.soc }}-${{ steps.resolve_qt_version.outputs.version }} key: thin-qt-macos-${{ matrix.soc }}-${{ steps.resolve_qt_version.outputs.version }}
- name: Install Qt ${{matrix.qt_version}} (Windows) - name: "[Windows] Install Qt ${{matrix.qt_version}}"
if: matrix.os == 'Windows' if: matrix.os == 'Windows'
uses: jurplel/install-qt-action@v4 uses: jurplel/install-qt-action@v4
with: with:
# qt 6.11.0 only works with aqtinstall directly from git until aqtinstall 3.4 is released # qt 6.11.0 only works with aqtinstall directly from git until aqtinstall 3.4 is released
aqtsource: git+https://github.com/miurahr/aqtinstall.git aqtsource: git+https://github.com/miurahr/aqtinstall.git
version: ${{ steps.resolve_qt_version.outputs.version }} version: ${{ steps.resolve_qt_version.outputs.version }}
arch: ${{matrix.qt_arch}} arch: ${{ matrix.qt_arch }}
modules: ${{matrix.qt_modules}} modules: ${{ matrix.qt_modules }}
cache: true cache: true
- name: Install NSIS - name: "[Windows] Install NSIS"
if: matrix.os == 'Windows' if: matrix.os == 'Windows'
shell: bash shell: bash
run: choco install nsis run: choco install nsis
- name: Setup vcpkg cache - name: "Setup vcpkg cache"
id: vcpkg-cache id: vcpkg-cache
uses: TAServers/vcpkg-cache@v3 uses: TAServers/vcpkg-cache@v3
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
# uses environment variables, see compile.sh for more details # uses environment variables, see compile.sh for more details
- name: Build Cockatrice - name: "Build Cockatrice"
id: build id: build
shell: bash shell: bash
env: env:
BUILDTYPE: '${{matrix.type}}' BUILDTYPE: '${{ matrix.type }}'
MAKE_PACKAGE: '${{matrix.make_package}}' MAKE_PACKAGE: '${{ matrix.make_package }}'
PACKAGE_SUFFIX: '${{matrix.package_suffix}}' PACKAGE_SUFFIX: '${{ matrix.package_suffix }}'
CMAKE_GENERATOR: ${{matrix.cmake_generator}} CMAKE_GENERATOR: ${{ matrix.cmake_generator }}
CMAKE_GENERATOR_PLATFORM: ${{matrix.cmake_generator_platform}} CMAKE_GENERATOR_PLATFORM: ${{ matrix.cmake_generator_platform }}
USE_CCACHE: ${{matrix.use_ccache}} USE_CCACHE: ${{ matrix.use_ccache }}
VCPKG_DISABLE_METRICS: 1 VCPKG_DISABLE_METRICS: 1
VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite' VCPKG_BINARY_SOURCES: 'clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite'
# macOS-specific environment variables, will be ignored on Windows # macOS-specific environment variables, will be ignored on Windows
@ -449,14 +447,14 @@ jobs:
MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }} MACOS_CERTIFICATE_PWD: ${{ secrets.PROD_MACOS_CERTIFICATE_PWD }}
MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }} MACOS_CERTIFICATE_NAME: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }} MACOS_CI_KEYCHAIN_PWD: ${{ secrets.PROD_MACOS_CI_KEYCHAIN_PWD }}
DEVELOPER_DIR: '/Applications/Xcode_${{matrix.xcode}}.app/Contents/Developer' DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer'
TARGET_MACOS_VERSION: ${{ matrix.override_target }} TARGET_MACOS_VERSION: ${{ matrix.override_target }}
CCACHE_EVICTION_AGE: ${{ matrix.ccache_eviction_age }} CCACHE_EVICTION_AGE: ${{ matrix.ccache_eviction_age }}
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: Delete remote compiler cache (ccache) - name: "[macOS] Delete remote compiler cache (ccache)"
if: github.ref == 'refs/heads/master' && matrix.use_ccache == 1 && steps.ccache_restore.outputs.cache-hit if: matrix.os == 'macOS' && matrix.use_ccache == 1 && github.ref == 'refs/heads/master' && steps.ccache_restore.outputs.cache-hit
continue-on-error: true continue-on-error: true
env: env:
GH_TOKEN: ${{ github.token }} GH_TOKEN: ${{ github.token }}
@ -465,14 +463,14 @@ jobs:
echo "Cache deleted successfully" echo "Cache deleted successfully"
fi fi
- name: Save updated compiler cache (ccache) - name: "[macOS] Save updated compiler cache (ccache)"
if: github.ref == 'refs/heads/master' && matrix.use_ccache == 1 if: matrix.os == 'macOS' && matrix.use_ccache == 1 && github.ref == 'refs/heads/master'
uses: actions/cache/save@v5 uses: actions/cache/save@v5
with: with:
path: ${{env.CCACHE_DIR}} path: ${{ env.CCACHE_DIR }}
key: ${{ steps.ccache_restore.outputs.cache-primary-key }} key: ${{ steps.ccache_restore.outputs.cache-primary-key }}
- name: Sign app bundle - name: "[macOS] Sign app bundle"
if: matrix.os == 'macOS' && matrix.make_package && needs.configure.outputs.tag != null if: matrix.os == 'macOS' && matrix.make_package && needs.configure.outputs.tag != null
id: sign_macos id: sign_macos
env: env:
@ -482,11 +480,11 @@ jobs:
if [[ -n "$MACOS_CERTIFICATE_NAME" ]] if [[ -n "$MACOS_CERTIFICATE_NAME" ]]
then then
security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain security unlock-keychain -p "$MACOS_CI_KEYCHAIN_PWD" build.keychain
/usr/bin/codesign --sign="$MACOS_CERTIFICATE_NAME" --entitlements=".ci/macos.entitlements" --options=runtime --force --deep --timestamp --verbose "${{steps.build.outputs.path}}" /usr/bin/codesign --sign="$MACOS_CERTIFICATE_NAME" --entitlements=".ci/macos.entitlements" --options=runtime --force --deep --timestamp --verbose "${{ steps.build.outputs.path }}"
fi fi
- name: Notarize app bundle - name: "[macOS] Notarize app bundle"
if: steps.sign_macos.outcome == 'success' if: matrix.os == 'macOS' && steps.sign_macos.outcome == 'success'
env: env:
MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }} MACOS_NOTARIZATION_APPLE_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_APPLE_ID }}
MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }} MACOS_NOTARIZATION_TEAM_ID: ${{ secrets.PROD_MACOS_NOTARIZATION_TEAM_ID }}
@ -502,7 +500,7 @@ jobs:
# Therefore, we create a zip file containing our app bundle, so that we can send it to the # Therefore, we create a zip file containing our app bundle, so that we can send it to the
# notarization service # notarization service
echo "Creating temp notarization archive" echo "Creating temp notarization archive"
ditto -c -k --keepParent "${{steps.build.outputs.path}}" "notarization.zip" ditto -c -k --keepParent "${{ steps.build.outputs.path }}" "notarization.zip"
# Here we send the notarization request to the Apple's Notarization service, waiting for the result. # Here we send the notarization request to the Apple's Notarization service, waiting for the result.
# This typically takes a few seconds inside a CI environment, but it might take more depending on the App # This typically takes a few seconds inside a CI environment, but it might take more depending on the App
@ -514,51 +512,51 @@ jobs:
# Finally, we need to "attach the staple" to our executable, which will allow our app to be # Finally, we need to "attach the staple" to our executable, which will allow our app to be
# validated by macOS even when an internet connection is not available. # validated by macOS even when an internet connection is not available.
echo "Attach staple" echo "Attach staple"
xcrun stapler staple "${{steps.build.outputs.path}}" xcrun stapler staple "${{ steps.build.outputs.path }}"
fi fi
- name: Upload artifact - name: "Upload artifact"
if: matrix.make_package if: matrix.make_package
id: upload_artifact id: upload_artifact
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7
with: with:
path: ${{steps.build.outputs.path}} path: ${{ steps.build.outputs.path }}
archive: false archive: false
if-no-files-found: error if-no-files-found: error
- name: Upload PDBs (Program Databases) - name: "[Windows] Upload PDBs (Program Databases)"
if: matrix.os == 'Windows' && github.ref_type != 'tag' if: matrix.os == 'Windows' && github.ref_type != 'tag'
uses: actions/upload-artifact@v7 uses: actions/upload-artifact@v7
with: with:
name: ${{steps.build.outputs.name}}-PDBs name: ${{ steps.build.outputs.name }}-PDBs
path: | path: |
build/cockatrice/Release/*.pdb build/cockatrice/Release/*.pdb
build/oracle/Release/*.pdb build/oracle/Release/*.pdb
build/servatrice/Release/*.pdb build/servatrice/Release/*.pdb
if-no-files-found: error if-no-files-found: error
- 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 == '1'
id: upload_release id: upload_release
shell: bash shell: bash
env: env:
GH_TOKEN: ${{github.token}} GH_TOKEN: ${{ github.token }}
tag_name: ${{needs.configure.outputs.tag}} tag_name: ${{ needs.configure.outputs.tag }}
asset_name: ${{steps.build.outputs.fullname}} asset_name: ${{ steps.build.outputs.fullname }}
asset_path: ${{steps.build.outputs.path}} asset_path: ${{ steps.build.outputs.path }}
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'
id: attestation id: attestation
uses: actions/attest@v4 uses: actions/attest@v4
with: with:
subject-path: ${{steps.build.outputs.path}} subject-path: ${{ steps.build.outputs.path }}
show-summary: false show-summary: false
- name: Verify binary attestation - name: "Verify binary attestation"
if: steps.attestation.outcome == 'success' if: steps.attestation.outcome == 'success'
shell: bash shell: bash
env: env:
GH_TOKEN: ${{github.token}} GH_TOKEN: ${{ github.token }}
run: gh attestation verify "${{steps.build.outputs.path}}" --repo Cockatrice/Cockatrice run: gh attestation verify "${{ steps.build.outputs.path }}" --repo Cockatrice/Cockatrice