mirror of
https://github.com/LizardByte/Sunshine.git
synced 2026-08-07 18:36:34 +00:00
c710d03bb6
Bumps the github-actions group with 2 updates in the / directory: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [actions/setup-node](https://github.com/actions/setup-node). Updates `actions/upload-artifact` from 6.0.0 to 7.0.0 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v6...bbbca2ddaa5d8feaa63e36b76fdaad77386f024f) Updates `actions/setup-node` from 6.2.0 to 6.3.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/6044e13b5dc448c55e2357c09f80417699197238...53b83947a5a98c8d113130e565377fae1a50d02f) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: 7.0.0 dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions - dependency-name: actions/setup-node dependency-version: 6.3.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
182 lines
6.1 KiB
YAML
182 lines
6.1 KiB
YAML
---
|
|
name: CI-macOS
|
|
permissions: {}
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
publish_release:
|
|
required: true
|
|
type: string
|
|
release_commit:
|
|
required: true
|
|
type: string
|
|
release_version:
|
|
required: true
|
|
type: string
|
|
secrets:
|
|
# email address
|
|
APPLE_ID:
|
|
required: false
|
|
# 10-character Team ID
|
|
APPLE_TEAM_ID:
|
|
required: false
|
|
# app-specific password in APPLE_ID's account that must be named "notarytool"
|
|
# https://support.apple.com/en-us/102654
|
|
APPLE_NOTARYTOOL_PASSWORD:
|
|
required: false
|
|
# Developer ID Application: Full Name (TEAMIDHERE)
|
|
APPLE_CODESIGN_IDENTITY:
|
|
required: false
|
|
# pkcs12 export from Xcode in base64
|
|
APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_BASE64:
|
|
required: false
|
|
# pkcs12 password added by Xcode export
|
|
APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_P12_PASSWORD:
|
|
required: false
|
|
|
|
env:
|
|
BRANCH: ${{ github.head_ref || github.ref_name }}
|
|
BUILD_VERSION: ${{ inputs.release_version }}
|
|
COMMIT: ${{ inputs.release_commit }}
|
|
|
|
jobs:
|
|
build_dmg:
|
|
name: ${{ matrix.name }}
|
|
permissions:
|
|
contents: read
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- os: "macos-14"
|
|
name: "macOS-arm64"
|
|
- os: "macos-15-intel"
|
|
name: "macOS-x86_64"
|
|
steps:
|
|
- name: Install Apple certificate
|
|
uses: apple-actions/import-codesign-certs@b610f78488812c1e56b20e6df63ec42d833f2d14 # v6.0.0
|
|
if: inputs.publish_release == 'true'
|
|
with:
|
|
p12-file-base64: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_BASE64 }}
|
|
p12-password: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERTIFICATE_P12_PASSWORD }}
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
submodules: recursive
|
|
|
|
- name: Install dependencies
|
|
timeout-minutes: 5
|
|
run: |
|
|
brew install --force \
|
|
cmake \
|
|
doxygen \
|
|
graphviz \
|
|
node \
|
|
pkgconf \
|
|
icu4c@78 \
|
|
miniupnpc \
|
|
openssl@3 \
|
|
opus
|
|
|
|
- name: Configure
|
|
env:
|
|
APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }}
|
|
run: |
|
|
mkdir -p build
|
|
cmake \
|
|
-B build \
|
|
-S . \
|
|
-DBUILD_WERROR=ON \
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
-DOPENSSL_ROOT_DIR="$(brew --prefix openssl@3 2>/dev/null)" \
|
|
-DOpus_ROOT_DIR="$(brew --prefix opus 2>/dev/null)" \
|
|
-DSUNSHINE_PUBLISHER_NAME="${GITHUB_REPOSITORY_OWNER}" \
|
|
-DSUNSHINE_PUBLISHER_WEBSITE="https://app.lizardbyte.dev" \
|
|
-DSUNSHINE_PUBLISHER_ISSUE_URL="https://app.lizardbyte.dev/support" \
|
|
-DAPPLE_CODESIGN_IDENTITY="${APPLE_CODESIGN_IDENTITY}"
|
|
|
|
- name: Build
|
|
run: cmake --build build -j "$(sysctl -n hw.ncpu)"
|
|
|
|
- name: Package DMG
|
|
env:
|
|
APPLE_ID: ${{ secrets.APPLE_ID }}
|
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
|
APPLE_NOTARYTOOL_PASSWORD: ${{ secrets.APPLE_NOTARYTOOL_PASSWORD }}
|
|
APPLE_CODESIGN_IDENTITY: ${{ secrets.APPLE_CODESIGN_IDENTITY }}
|
|
SHOULD_SIGN: ${{ inputs.publish_release }}
|
|
run: |
|
|
# build DMG and sign everything (see cmake/packaging/macos.cmake)
|
|
# cpack can rarely fail with "hdiutil: create failed - Resource busy"
|
|
# so let's allow 1 retry
|
|
if ! cpack -G DragNDrop --config build/CPackConfig.cmake; then
|
|
echo "cpack failed, retrying once with verbose..."
|
|
if ! cpack -G DragNDrop --config build/CPackConfig.cmake --verbose; then
|
|
echo "cpack failed again. Aborting."
|
|
exit 1
|
|
fi
|
|
fi
|
|
|
|
# Notarize
|
|
if [[ "${SHOULD_SIGN}" == "true" && -n "${APPLE_NOTARYTOOL_PASSWORD}" ]]; then
|
|
# Notarizing allows the signed .app to run on any Mac with no prompts.
|
|
# If you don't notarize, users must jump through the "Open Anyway" hoop as well as run
|
|
# `xattr -cr /Applications/Sunshine.app` to remove quarantine.
|
|
if [[ -n "${APPLE_NOTARYTOOL_PASSWORD}" ]]; then
|
|
xcrun notarytool submit build/cpack_artifacts/Sunshine.dmg \
|
|
--apple-id "${APPLE_ID}" \
|
|
--team-id "${APPLE_TEAM_ID}" \
|
|
--password "${APPLE_NOTARYTOOL_PASSWORD}" \
|
|
--wait
|
|
xcrun stapler staple -v build/cpack_artifacts/Sunshine.dmg
|
|
fi
|
|
fi
|
|
|
|
mkdir -p artifacts
|
|
mv build/cpack_artifacts/Sunshine.dmg \
|
|
artifacts/Sunshine-${{ matrix.name }}.dmg
|
|
|
|
- name: Test
|
|
id: test
|
|
working-directory: build/tests
|
|
run: ./test_sunshine --gtest_color=yes --gtest_output=xml:test_results.xml
|
|
|
|
- name: Generate gcov report
|
|
id: test_report
|
|
# any except canceled or skipped
|
|
if: >-
|
|
always() &&
|
|
(steps.test.outcome == 'success' || steps.test.outcome == 'failure')
|
|
working-directory: build
|
|
run: |
|
|
python -m pip install "../scripts[test]"
|
|
python -m gcovr . -r ../src \
|
|
--exclude-noncode-lines \
|
|
--exclude-throw-branches \
|
|
--exclude-unreachable-branches \
|
|
--xml-pretty \
|
|
-j "$(sysctl -n hw.ncpu)" \
|
|
-o coverage.xml
|
|
|
|
- name: Upload coverage artifact
|
|
if: >-
|
|
always() &&
|
|
(steps.test_report.outcome == 'success')
|
|
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
with:
|
|
name: coverage-${{ matrix.name }}
|
|
path: |
|
|
build/coverage.xml
|
|
build/tests/test_results.xml
|
|
if-no-files-found: error
|
|
|
|
- name: Upload Artifacts
|
|
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
|
|
with:
|
|
name: build-${{ matrix.name }}
|
|
path: artifacts/
|
|
if-no-files-found: error
|