Skip to content

Commit a6e374d

Browse files
authored
Merge branch 'Aitum:main' into main
2 parents 7b5eb04 + 09c542a commit a6e374d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+2522
-1713
lines changed

.github/actions/build-plugin/action.yaml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
1-
name: 'Set up and build plugin'
2-
description: 'Builds the plugin for specified architecture and build config'
1+
name: Set up and build plugin
2+
description: Builds the plugin for specified architecture and build config
33
inputs:
44
target:
5-
description: 'Target architecture for dependencies'
5+
description: Target architecture for dependencies
66
required: true
77
config:
8-
description: 'Build configuration'
8+
description: Build configuration
99
required: false
10-
default: 'RelWithDebInfo'
10+
default: RelWithDebInfo
1111
codesign:
12-
description: 'Enable codesigning (macOS only)'
12+
description: Enable codesigning (macOS only)
1313
required: false
1414
default: 'false'
1515
codesignIdent:
16-
description: 'Developer ID for application codesigning (macOS only)'
16+
description: Developer ID for application codesigning (macOS only)
1717
required: false
1818
default: '-'
19+
codesignTeam:
20+
description: Team ID for application codesigning (macOS only)
21+
required: false
22+
default: ''
1923
workingDirectory:
20-
description: 'Working directory for packaging'
24+
description: Working directory for packaging
2125
required: false
2226
default: ${{ github.workspace }}
2327
runs:
@@ -28,6 +32,7 @@ runs:
2832
shell: zsh --no-rcs --errexit --pipefail {0}
2933
working-directory: ${{ inputs.workingDirectory }}
3034
env:
35+
CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache
3136
CODESIGN_IDENT: ${{ inputs.codesignIdent }}
3237
CODESIGN_TEAM: ${{ inputs.codesignTeam }}
3338
run: |
@@ -38,12 +43,15 @@ runs:
3843
3944
if [[ '${{ inputs.codesign }}' == 'true' ]] build_args+=(--codesign)
4045
46+
git fetch origin --no-tags --no-recurse-submodules -q
4147
.github/scripts/build-macos ${build_args}
4248
4349
- name: Install Dependencies 🛍️
4450
if: runner.os == 'Linux'
4551
shell: bash
4652
run: |
53+
: Install Dependencies 🛍️
54+
echo ::group::Install Dependencies
4755
sudo apt update
4856
4957
: Install system dependencies 🛍️
@@ -54,21 +62,27 @@ runs:
5462
5563
: Install OBS Qt6 dependencies 🛍️
5664
sudo apt install qt6-base-dev qt6-base-private-dev libqt6svg6-dev qt6-wayland qt6-image-formats-plugins
57-
65+
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
66+
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
67+
brew install --quiet zsh
68+
echo ::endgroup::
69+
5870
- name: Run Ubuntu Build
5971
if: runner.os == 'Linux'
6072
shell: zsh --no-rcs --errexit --pipefail {0}
6173
working-directory: ${{ inputs.workingDirectory }}
74+
env:
75+
CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache
6276
run: |
6377
: Run Ubuntu Build
6478
6579
local -a build_args=(
66-
--target linux-${{ inputs.target }}
80+
--target ubuntu-${{ inputs.target }}
6781
--config ${{ inputs.config }}
6882
)
6983
if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
7084
71-
.github/scripts/build-linux ${build_args}
85+
.github/scripts/build-ubuntu ${build_args}
7286
7387
- name: Run Windows Build
7488
if: runner.os == 'Windows'
@@ -90,7 +104,7 @@ runs:
90104
if: contains(fromJSON('["Linux", "macOS"]'),runner.os)
91105
shell: zsh --no-rcs --errexit --pipefail {0}
92106
env:
93-
CCACHE_CONFIGPATH: ${{ inputs.workingDirectory }}/.ccache.conf
107+
CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache
94108
run: |
95109
: Create Summary 📊
96110
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Check For Changed Files
2+
description: Checks for changed files compared to specific git reference and glob expression
3+
inputs:
4+
baseRef:
5+
description: Git reference to check against
6+
required: false
7+
ref:
8+
description: Git reference to check with
9+
required: false
10+
default: HEAD
11+
checkGlob:
12+
description: Glob expression to limit check to specific files
13+
required: false
14+
useFallback:
15+
description: Use fallback compare against prior commit
16+
required: false
17+
default: 'true'
18+
diffFilter:
19+
description: git diff-filter string to use
20+
required: false
21+
default: ''
22+
outputs:
23+
hasChangedFiles:
24+
value: ${{ steps.checks.outputs.hasChangedFiles }}
25+
description: True if specified files were changed in comparison to specified git reference
26+
changedFiles:
27+
value: ${{ steps.checks.outputs.changedFiles }}
28+
description: List of changed files
29+
runs:
30+
using: composite
31+
steps:
32+
- name: Check For Changed Files ✅
33+
shell: bash
34+
id: checks
35+
env:
36+
GIT_BASE_REF: ${{ inputs.baseRef }}
37+
GIT_REF: ${{ inputs.ref }}
38+
GITHUB_EVENT_FORCED: ${{ github.event.forced }}
39+
GITHUB_REF_BEFORE: ${{ github.event.before }}
40+
USE_FALLBACK: ${{ inputs.useFallback }}
41+
DIFF_FILTER: ${{ inputs.diffFilter }}
42+
run: |
43+
: Check for Changed Files ✅
44+
if [[ "${RUNNER_DEBUG}" ]]; then set -x; fi
45+
shopt -s extglob
46+
shopt -s dotglob
47+
48+
if [[ "${GIT_BASE_REF}" ]]; then
49+
if ! git cat-file -e "${GIT_BASE_REF}" &> /dev/null; then
50+
echo "::warning::Provided base reference ${GIT_BASE_REF} is invalid"
51+
if [[ "${USE_FALLBACK}" == 'true' ]]; then
52+
GIT_BASE_REF='HEAD~1'
53+
fi
54+
fi
55+
else
56+
if ! git cat-file -e ${GITHUB_REF_BEFORE} &> /dev/null; then
57+
GITHUB_REF_BEFORE='4b825dc642cb6eb9a060e54bf8d69288fbee4904'
58+
fi
59+
60+
GIT_BASE_REF='HEAD~1'
61+
case "${GITHUB_EVENT_NAME}" in
62+
pull_request) GIT_BASE_REF="origin/${GITHUB_BASE_REF}" ;;
63+
push) if [[ "${GITHUB_EVENT_FORCED}" != 'true' ]]; then GIT_BASE_REF="${GITHUB_REF_BEFORE}"; fi ;;
64+
*) ;;
65+
esac
66+
fi
67+
68+
changes=($(git diff --name-only --diff-filter="${DIFF_FILTER}" ${GIT_BASE_REF} ${GIT_REF} -- ${{ inputs.checkGlob }}))
69+
70+
if (( ${#changes[@]} )); then
71+
file_string="${changes[*]}"
72+
echo "hasChangedFiles=true" >> $GITHUB_OUTPUT
73+
echo "changedFiles=[\"${file_string// /\",\"}\"]" >> $GITHUB_OUTPUT
74+
else
75+
echo "hasChangedFiles=false" >> $GITHUB_OUTPUT
76+
echo "changedFiles=[]" >> GITHUB_OUTPUT
77+
fi

.github/actions/package-plugin/action.yaml

Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
1-
name: 'Package plugin'
2-
description: 'Packages the plugin for specified architecture and build config.'
1+
name: Package plugin
2+
description: Packages the plugin for specified architecture and build config.
33
inputs:
44
target:
5-
description: 'Build target for dependencies'
5+
description: Build target for dependencies
66
required: true
77
config:
8-
description: 'Build configuration'
8+
description: Build configuration
99
required: false
10-
default: 'RelWithDebInfo'
10+
default: RelWithDebInfo
1111
codesign:
12-
description: 'Enable codesigning (macOS only)'
12+
description: Enable codesigning (macOS only)
1313
required: false
1414
default: 'false'
1515
notarize:
16-
description: 'Enable notarization (macOS only)'
16+
description: Enable notarization (macOS only)
1717
required: false
1818
default: 'false'
1919
codesignIdent:
20-
description: 'Developer ID for application codesigning (macOS only)'
20+
description: Developer ID for application codesigning (macOS only)
2121
required: false
2222
default: '-'
2323
installerIdent:
24-
description: 'Developer ID for installer package codesigning (macOS only)'
24+
description: Developer ID for installer package codesigning (macOS only)
2525
required: false
2626
default: ''
2727
codesignTeam:
28-
description: 'Developer team for codesigning (macOS only)'
28+
description: Developer team for codesigning (macOS only)
2929
required: false
3030
default: ''
3131
codesignUser:
32-
description: 'Apple ID username for notarization (macOS only)'
32+
description: Apple ID username for notarization (macOS only)
3333
required: false
3434
default: ''
3535
codesignPass:
36-
description: 'Apple ID password for notarization (macOS only)'
36+
description: Apple ID password for notarization (macOS only)
3737
required: false
3838
default: ''
3939
package:
40-
description: 'Create Windows or macOS installation package'
40+
description: Create Windows or macOS installation package
4141
required: false
4242
default: 'false'
4343
workingDirectory:
44-
description: 'Working directory for packaging'
44+
description: Working directory for packaging
4545
required: false
4646
default: ${{ github.workspace }}
4747
runs:
@@ -64,11 +64,8 @@ runs:
6464
if (( ${+RUNNER_DEBUG} )) package_args+=(--debug)
6565
6666
if [[ '${{ inputs.codesign }}' == 'true' ]] package_args+=(--codesign)
67-
if [[ '${{ inputs.codesign }}' == 'true' ]] echo "Will codesign"
6867
if [[ '${{ inputs.notarize }}' == 'true' ]] package_args+=(--notarize)
69-
if [[ '${{ inputs.notarize }}' == 'true' ]] echo "Will notarize"
7068
if [[ '${{ inputs.package }}' == 'true' ]] package_args+=(--package)
71-
if [[ '${{ inputs.package }}' == 'true' ]] echo "Will package"
7269
7370
.github/scripts/package-macos ${package_args}
7471
@@ -90,14 +87,14 @@ runs:
9087
run: |
9188
: Run Ubuntu Packaging
9289
package_args=(
93-
--target linux-${{ inputs.target }}
90+
--target ubuntu-${{ inputs.target }}
9491
--config ${{ inputs.config }}
9592
)
9693
if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
9794
9895
if [[ '${{ inputs.package }}' == 'true' ]] package_args+=(--package)
9996
100-
.github/scripts/package-linux ${package_args}
97+
.github/scripts/package-ubuntu ${package_args}
10198
10299
- name: Run Windows Packaging
103100
if: runner.os == 'Windows'
@@ -113,8 +110,4 @@ runs:
113110
Configuration = '${{ inputs.config }}'
114111
}
115112
116-
if ( '${{ inputs.package }}' -eq 'true' ) {
117-
$PackageArgs += @{BuildInstaller = $true}
118-
}
119-
120113
.github/scripts/Package-Windows.ps1 @PackageArgs

.github/actions/run-clang-format/action.yaml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
failCondition:
55
description: Controls whether failed checks also fail the workflow run
66
required: false
7-
default: 'never'
7+
default: never
88
workingDirectory:
99
description: Working directory for checks
1010
required: false
@@ -20,42 +20,41 @@ runs:
2020
echo "::notice::run-clang-format action requires a macOS-based or Linux-based runner."
2121
exit 2
2222
23+
- name: Check for Changed Files ✅
24+
uses: ./.github/actions/check-changes
25+
id: checks
26+
with:
27+
checkGlob: "'*.c' '*.h' '*.cpp' '*.hpp' '*.m' '*.mm'"
28+
diffFilter: 'ACM'
29+
2330
- name: Install Dependencies 🛍️
24-
if: runner.os == 'Linux'
31+
if: runner.os == 'Linux' && fromJSON(steps.checks.outputs.hasChangedFiles)
2532
shell: bash
2633
run: |
2734
: Install Dependencies 🛍️
2835
echo ::group::Install Dependencies
2936
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
3037
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
31-
echo "/home/linuxbrew/.linuxbrew/opt/clang-format@16/bin" >> $GITHUB_PATH
38+
echo "/home/linuxbrew/.linuxbrew/opt/clang-format@17/bin" >> $GITHUB_PATH
3239
brew install --quiet zsh
3340
echo ::endgroup::
3441
3542
- name: Run clang-format 🐉
43+
if: fromJSON(steps.checks.outputs.hasChangedFiles)
3644
id: result
3745
shell: zsh --no-rcs --errexit --pipefail {0}
3846
working-directory: ${{ inputs.workingDirectory }}
3947
env:
40-
GITHUB_EVENT_FORCED: ${{ github.event.forced }}
41-
GITHUB_REF_BEFORE: ${{ github.event.before }}
48+
CHANGED_FILES: ${{ steps.checks.outputs.changedFiles }}
4249
run: |
4350
: Run clang-format 🐉
4451
if (( ${+RUNNER_DEBUG} )) setopt XTRACE
4552
46-
local -a changes=($(git diff --name-only HEAD~1 HEAD))
47-
case ${GITHUB_EVENT_NAME} {
48-
pull_request) changes=($(git diff --name-only origin/${GITHUB_BASE_REF} HEAD)) ;;
49-
push) if [[ ${GITHUB_EVENT_FORCED} != true ]] changes=($(git diff --name-only ${GITHUB_REF_BEFORE} HEAD)) ;;
50-
*) ;;
51-
}
52-
53-
if (( ${changes[(I)(*.c|*.h|*.cpp|*.hpp|*.m|*.mm)]} )) {
54-
echo ::group::Install clang-format-16
55-
brew install --quiet obsproject/tools/clang-format@16
56-
echo ::endgroup::
53+
print ::group::Install clang-format-17
54+
brew install --quiet obsproject/tools/clang-format@17
55+
print ::endgroup::
5756
58-
echo ::group::Run clang-format-16
59-
./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check
60-
echo ::endgroup::
61-
}
57+
print ::group::Run clang-format-17
58+
local -a changes=(${(s:,:)CHANGED_FILES//[\[\]\'\"]/})
59+
./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check ${changes}
60+
print ::endgroup::

0 commit comments

Comments
 (0)