Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/template/master'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/scripts/Package-Windows.ps1
#	.github/workflows/build-project.yaml
#	.github/workflows/push.yaml
#	CMakePresets.json
#	buildspec.json
  • Loading branch information
sorayuki committed Feb 19, 2024
2 parents 3068e1a + 68e9fcd commit ce64ccc
Show file tree
Hide file tree
Showing 13 changed files with 229 additions and 91 deletions.
132 changes: 116 additions & 16 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# please use clang-format version 8 or later
# please use clang-format version 16 or later

Standard: Cpp11
Standard: c++17
AccessModifierOffset: -8
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
#AllowAllArgumentsOnNextLine: false # requires clang-format 9
#AllowAllConstructorInitializersOnNextLine: false # requires clang-format 9
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
#AllowShortLambdasOnASingleLine: Inline # requires clang-format 9
AllowShortLambdasOnASingleLine: Inline
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
Expand Down Expand Up @@ -52,8 +52,8 @@ ContinuationIndentWidth: 8
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
FixNamespaceComments: false
ForEachMacros:
FixNamespaceComments: true
ForEachMacros:
- 'json_object_foreach'
- 'json_object_foreach_safe'
- 'json_array_foreach'
Expand All @@ -66,7 +66,7 @@ IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
#ObjCBinPackProtocolList: Auto # requires clang-format 7
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 8
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
Expand All @@ -84,25 +84,125 @@ ReflowComments: false
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
#SpaceAfterLogicalNot: false # requires clang-format 9
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
#SpaceBeforeCtorInitializerColon: true # requires clang-format 7
#SpaceBeforeInheritanceColon: true # requires clang-format 7
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
#SpaceBeforeRangeBasedForLoopColon: true # requires clang-format 7
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
#StatementMacros: # requires clang-format 8
# - 'Q_OBJECT'
StatementMacros:
- 'Q_OBJECT'
TabWidth: 8
#TypenameMacros: # requires clang-format 9
# - 'DARRAY'
TypenameMacros:
- 'DARRAY'
UseTab: ForContinuationAndIndentation
---
Language: ObjC
AccessModifierOffset: 2
AlignArrayOfStructures: Right
AlignConsecutiveAssignments: None
AlignConsecutiveBitFields: None
AlignConsecutiveDeclarations: None
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: true
AllowShortBlocksOnASingleLine: Never
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: None
AttributeMacros: ['__unused', '__autoreleasing', '_Nonnull', '__bridge']
BitFieldColonSpacing: Both
#BreakBeforeBraces: Webkit
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterClass: true
AfterControlStatement: Never
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: true
BreakAfterAttributes: Never
BreakArrays: false
BreakBeforeConceptDeclarations: Allowed
BreakBeforeInlineASMColon: OnlyMultiline
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterComma
ColumnLimit: 120
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: Indent
IndentGotoLabels: false
IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
InsertBraces: false
InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: Signature
NamespaceIndentation: All
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: false
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PPIndentWidth: -1
PackConstructorInitializers: NextLine
QualifierAlignment: Leave
ReferenceAlignment: Right
RemoveSemicolon: false
RequiresClausePosition: WithPreceding
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Always
ShortNamespaceLines: 1
SortIncludes: false
#SortUsingDeclarations: LexicographicNumeric
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 2
SpacesInConditionalStatement: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
Standard: c++17
TabWidth: 4
UseTab: Never
8 changes: 4 additions & 4 deletions .github/actions/run-clang-format/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ runs:
echo ::group::Install Dependencies
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
echo "/home/linuxbrew/.linuxbrew/opt/clang-format@13/bin" >> $GITHUB_PATH
echo "/home/linuxbrew/.linuxbrew/opt/clang-format@16/bin" >> $GITHUB_PATH
brew install --quiet zsh
echo ::endgroup::
Expand All @@ -51,11 +51,11 @@ runs:
}
if (( ${changes[(I)(*.c|*.h|*.cpp|*.hpp|*.m|*.mm)]} )) {
echo ::group::Install clang-format-13
brew install --quiet obsproject/tools/clang-format@13
echo ::group::Install clang-format-16
brew install --quiet obsproject/tools/clang-format@16
echo ::endgroup::
echo ::group::Run clang-format-13
echo ::group::Run clang-format-16
./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check
echo ::endgroup::
}
2 changes: 1 addition & 1 deletion .github/actions/setup-macos-codesigning/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ runs:
print -n "${MACOS_SIGNING_CERT}" | base64 --decode --output="${certificate_path}"
: "${MACOS_KEYCHAIN_PASSWORD:="$(print ${RANDOM} | sha1sum | head -c 32)"}"
: "${MACOS_KEYCHAIN_PASSWORD:="$(print ${RANDOM} | shasum | head -c 32)"}"
print '::group::Keychain setup'
security create-keychain -p "${MACOS_KEYCHAIN_PASSWORD}" ${keychain_path}
Expand Down
27 changes: 14 additions & 13 deletions .github/scripts/Package-Windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,17 @@ function Package {

Remove-Item @RemoveArgs

#if ( ( $BuildInstaller ) ) {
Log-Group "Archiving ${ProductName}..."
$CompressArgs = @{
Path = (Get-ChildItem -Path "${ProjectRoot}/release/${Configuration}" -Exclude "${OutputName}*.*")
CompressionLevel = 'Optimal'
DestinationPath = "${ProjectRoot}/release/${OutputName}.zip"
Verbose = ($Env:CI -ne $null)
}
Compress-Archive -Force @CompressArgs
Log-Group

if ( ( $BuildInstaller ) ) {
$NsiFile = "${ProjectRoot}/installer.nsi"
Log-Information 'Creating NSIS installer...'

Expand All @@ -73,18 +83,9 @@ function Package {
Invoke-External "makensis.exe" ${NsiFile}
Copy-Item -Path "${ProjectRoot}/obs-multi-rtmp-setup.exe" -Destination "${OutputName}-Installer.exe"
Pop-Location -Stack BuildTemp
#} else {
Log-Group "Archiving ${ProductName}..."
$CompressArgs = @{
Path = (Get-ChildItem -Path "${ProjectRoot}/release/${Configuration}" -Exclude "${OutputName}*.*")
CompressionLevel = 'Optimal'
DestinationPath = "${ProjectRoot}/release/${OutputName}.zip"
Verbose = ($Env:CI -ne $null)
}

Compress-Archive -Force @CompressArgs
#}
Log-Group

Log-Group
}
}

Package
38 changes: 26 additions & 12 deletions .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Build Project
on:
workflow_call:
outputs:
pluginName:
description: 'Project name detected by parsing build spec file'
value: ${{ jobs.check-event.outputs.pluginName }}
jobs:
check-event:
name: Check GitHub Event Data 🔎
Expand All @@ -14,8 +18,9 @@ jobs:
notarize: ${{ steps.setup.outputs.notarize }}
config: ${{ steps.setup.outputs.config }}
commitHash: ${{ steps.setup.outputs.commitHash }}
pluginName: ${{ steps.setup.outputs.pluginName }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check Event Data ☑️
Expand Down Expand Up @@ -53,6 +58,15 @@ jobs:
done
echo "commitHash=${GITHUB_SHA:0:9}" >> $GITHUB_OUTPUT
plugin_name="$(grep 'name' buildspec.json | sed -E -e 's/^.+"name":[^"]+"(.+)",?$/\1/g')"
plugin_display_name="$(grep 'displayName' buildspec.json | sed -E -e 's/^.+"displayName":[^"]+"(.+)",?$/\1/g' || echo "")"
if [[ "${plugin_display_name}" ]]; then
echo "pluginName=${plugin_display_name}" >> $GITHUB_OUTPUT
else
echo "pluginName=${plugin_name}" >> $GITHUB_OUTPUT
fi
macos-build:
name: Build for macOS 🍏
runs-on: macos-13
Expand All @@ -61,7 +75,7 @@ jobs:
run:
shell: zsh --no-rcs --errexit --pipefail {0}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
Expand All @@ -86,7 +100,7 @@ jobs:
print "pluginName=${product_name}" >> $GITHUB_OUTPUT
print "pluginVersion=${product_version}" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
id: ccache-cache
with:
path: ${{ github.workspace }}/.ccache
Expand Down Expand Up @@ -131,13 +145,13 @@ jobs:
codesignPass: ${{ secrets.MACOS_NOTARIZATION_PASSWORD }}

- name: Upload Artifacts 📡
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-macos-universal-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-macos-universal.*

- name: Upload Debug Symbol Artifacts 🪲
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ needs.check-event.outputs.config == 'Release' }}
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-macos-universal-${{ needs.check-event.outputs.commitHash }}-dSYMs
Expand All @@ -151,7 +165,7 @@ jobs:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
Expand All @@ -168,7 +182,7 @@ jobs:
echo "pluginName=${product_name}" >> $GITHUB_OUTPUT
echo "pluginVersion=${product_version}" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
id: ccache-cache
with:
path: ${{ github.workspace }}/.ccache
Expand All @@ -194,19 +208,19 @@ jobs:
config: ${{ needs.check-event.outputs.config }}

# - name: Upload Source Tarball 🗜️
# uses: actions/upload-artifact@v3
# uses: actions/upload-artifact@v4
# with:
# name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-sources-${{ needs.check-event.outputs.commitHash }}
# path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-source.*

- name: Upload Artifacts 📡
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-x86_64*.*

- name: Upload debug symbol artifacts 🪲
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
if: ${{ fromJSON(needs.check-event.outputs.package) }}
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-ubuntu-22.04-x86_64-${{ needs.check-event.outputs.commitHash }}-dbgsym
Expand All @@ -220,7 +234,7 @@ jobs:
run:
shell: pwsh
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
Expand Down Expand Up @@ -254,7 +268,7 @@ jobs:
package: ${{ fromJSON(needs.check-event.outputs.package) }}

- name: Upload Artifacts 📡
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-windows-x64-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-windows-x64*.*
Loading

0 comments on commit ce64ccc

Please sign in to comment.