Skip to content

Commit 77bc111

Browse files
committed
CI: Update GitHub Actions workflows and repository actions
1 parent fd51288 commit 77bc111

34 files changed

+500
-613
lines changed

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

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
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: '-'
1919
workingDirectory:
20-
description: 'Working directory for packaging'
20+
description: Working directory for packaging
2121
required: false
2222
default: ${{ github.workspace }}
2323
runs:
@@ -28,6 +28,7 @@ runs:
2828
shell: zsh --no-rcs --errexit --pipefail {0}
2929
working-directory: ${{ inputs.workingDirectory }}
3030
env:
31+
CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache.conf
3132
CODESIGN_IDENT: ${{ inputs.codesignIdent }}
3233
CODESIGN_TEAM: ${{ inputs.codesignTeam }}
3334
run: |
@@ -55,16 +56,18 @@ runs:
5556
if: runner.os == 'Linux'
5657
shell: zsh --no-rcs --errexit --pipefail {0}
5758
working-directory: ${{ inputs.workingDirectory }}
59+
env:
60+
CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache.conf
5861
run: |
5962
: Run Ubuntu Build
6063
6164
local -a build_args=(
62-
--target linux-${{ inputs.target }}
65+
--target ubuntu-${{ inputs.target }}
6366
--config ${{ inputs.config }}
6467
)
6568
if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
6669
67-
.github/scripts/build-linux ${build_args}
70+
.github/scripts/build-ubuntu ${build_args}
6871
6972
- name: Run Windows Build
7073
if: runner.os == 'Windows'
@@ -86,7 +89,7 @@ runs:
8689
if: contains(fromJSON('["Linux", "macOS"]'),runner.os)
8790
shell: zsh --no-rcs --errexit --pipefail {0}
8891
env:
89-
CCACHE_CONFIGPATH: ${{ inputs.workingDirectory }}/.ccache.conf
92+
CCACHE_DIR: ${{ inputs.workingDirectory }}/.ccache.conf
9093
run: |
9194
: Create Summary 📊
9295

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

Lines changed: 16 additions & 16 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:
@@ -87,14 +87,14 @@ runs:
8787
run: |
8888
: Run Ubuntu Packaging
8989
package_args=(
90-
--target linux-${{ inputs.target }}
90+
--target ubuntu-${{ inputs.target }}
9191
--config ${{ inputs.config }}
9292
)
9393
if (( ${+RUNNER_DEBUG} )) build_args+=(--debug)
9494
9595
if [[ '${{ inputs.package }}' == 'true' ]] package_args+=(--package)
9696
97-
.github/scripts/package-linux ${package_args}
97+
.github/scripts/package-ubuntu ${package_args}
9898
9999
- name: Run Windows Packaging
100100
if: runner.os == 'Windows'

.github/actions/setup-macos-codesigning/action.yaml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,13 @@ outputs:
3030
value: ${{ steps.codesign.outputs.haveCodesignIdent }}
3131
haveProvisioningProfile:
3232
description: True if necessary provisioning profile credentials were found
33-
value: ${{ steps.provisioning.outputs.haveProvisioningProfile }}
33+
value: ${{ steps.provisioning.outputs.haveProvisioningProfile || steps.codesign.outputs.haveProvisioningProfile }}
34+
provisioningProfileUUID:
35+
description: UUID of imported provisioning profile
36+
value: ${{ steps.provisioning.outputs.provisioningProfileUUID }}
3437
haveNotarizationUser:
3538
description: True if necessary notarization credentials were found
36-
value: ${{ steps.notarization.outputs.haveNotarizationUser }}
39+
value: ${{ steps.notarization.outputs.haveNotarizationUser || steps.codesign.outputs.haveNotarizationUser }}
3740
codesignIdent:
3841
description: Codesigning identity
3942
value: ${{ steps.codesign.outputs.codesignIdent }}
@@ -64,7 +67,7 @@ runs:
6467
MAOCS_SIGNING_CERT_PASSWORD: ${{ inputs.certificatePassword }}
6568
MACOS_KEYCHAIN_PASSWORD: ${{ inputs.keychainPassword }}
6669
run: |
67-
: macOS Codesigning ✍️
70+
: macOS Code Signing ✍️
6871
if (( ${+RUNNER_DEBUG} )) setopt XTRACE
6972
7073
if [[ ${MACOS_SIGNING_IDENTITY} && ${MACOS_SIGNING_IDENTITY_INSTALLER} && ${MACOS_SIGNING_CERT} ]] {
@@ -73,7 +76,7 @@ runs:
7376
local -r certificate_path="${RUNNER_TEMP}/build_certificate.p12"
7477
local -r keychain_path="${RUNNER_TEMP}/app-signing.keychain-db"
7578
76-
print -n "${MACOS_SIGNING_CERT}" | base64 --decode --output="${certificate_path}"
79+
print -n "${MACOS_SIGNING_CERT}" | base64 --decode --output=${certificate_path}
7780
7881
: "${MACOS_KEYCHAIN_PASSWORD:="$(print ${RANDOM} | shasum | head -c 32)"}"
7982
@@ -100,6 +103,8 @@ runs:
100103
print "codesignTeam=${team_id}" >> $GITHUB_OUTPUT
101104
} else {
102105
print 'haveCodesignIdent=false' >> $GITHUB_OUTPUT
106+
print 'haveProvisioningProfile=false' >> $GITHUB_OUTPUT
107+
print 'haveNotarizationUser=false' >> $GITHUB_OUTPUT
103108
}
104109
105110
- name: Provisioning Profile 👤
@@ -112,20 +117,20 @@ runs:
112117
: Provisioning Profile 👤
113118
if (( ${+RUNNER_DEBUG} )) setopt XTRACE
114119
115-
if [[ ${MACOS_SIGNING_PROVISIONING_PROFILE} ]] {
120+
if [[ "${MACOS_SIGNING_PROVISIONING_PROFILE}" ]] {
116121
print 'haveProvisioningProfile=true' >> $GITHUB_OUTPUT
117122
118123
local -r profile_path="${RUNNER_TEMP}/build_profile.provisionprofile"
119124
print -n "${MACOS_SIGNING_PROVISIONING_PROFILE}" \
120-
| base64 --decode --output ${profile_path}
125+
| base64 --decode --output="${profile_path}"
121126
122127
print '::group::Provisioning Profile Setup'
123128
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
124129
security cms -D -i ${profile_path} -o ${RUNNER_TEMP}/build_profile.plist
125130
local -r uuid="$(plutil -extract UUID raw ${RUNNER_TEMP}/build_profile.plist)"
126131
local -r team_id="$(plutil -extract TeamIdentifier.0 raw -expect string ${RUNNER_TEMP}/build_profile.plist)"
127132
128-
if [[ ${team_id} != '${{ steps.codesign.codesignTeam }}' ]] {
133+
if [[ ${team_id} != '${{ steps.codesign.outputs.codesignTeam }}' ]] {
129134
print '::notice::Code Signing team in provisioning profile does not match certificate.'
130135
}
131136
@@ -137,9 +142,9 @@ runs:
137142
}
138143
139144
- name: Notarization 🧑‍💼
140-
shell: zsh --no-rcs --errexit --pipefail {0}
141145
id: notarization
142-
if: ${{ fromJSON(steps.codesign.outputs.haveCodesignIdent) }}
146+
if: fromJSON(steps.codesign.outputs.haveCodesignIdent)
147+
shell: zsh --no-rcs --errexit --pipefail {0}
143148
env:
144149
MACOS_NOTARIZATION_USERNAME: ${{ inputs.notarizationUser }}
145150
MACOS_NOTARIZATION_PASSWORD: ${{ inputs.notarizationPassword }}

.github/scripts/.Brewfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
brew "ccache"
22
brew "coreutils"
33
brew "cmake"
4-
brew "git"
54
brew "jq"
65
brew "xcbeautify"

.github/scripts/.Wingetfile

Lines changed: 0 additions & 2 deletions
This file was deleted.

.github/scripts/Build-Windows.ps1

Lines changed: 37 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ param(
33
[ValidateSet('x64')]
44
[string] $Target = 'x64',
55
[ValidateSet('Debug', 'RelWithDebInfo', 'Release', 'MinSizeRel')]
6-
[string] $Configuration = 'RelWithDebInfo',
7-
[switch] $SkipAll,
8-
[switch] $SkipBuild,
9-
[switch] $SkipDeps
6+
[string] $Configuration = 'RelWithDebInfo'
107
)
118

129
$ErrorActionPreference = 'Stop'
@@ -16,12 +13,16 @@ if ( $DebugPreference -eq 'Continue' ) {
1613
$InformationPreference = 'Continue'
1714
}
1815

16+
if ( $env:CI -eq $null ) {
17+
throw "Build-Windows.ps1 requires CI environment"
18+
}
19+
1920
if ( ! ( [System.Environment]::Is64BitOperatingSystem ) ) {
2021
throw "A 64-bit system is required to build the project."
2122
}
2223

23-
if ( $PSVersionTable.PSVersion -lt '7.0.0' ) {
24-
Write-Warning 'The obs-deps PowerShell build script requires PowerShell Core 7. Install or upgrade your PowerShell version: https://aka.ms/pscore6'
24+
if ( $PSVersionTable.PSVersion -lt '7.2.0' ) {
25+
Write-Warning 'The obs-studio PowerShell build script requires PowerShell Core 7. Install or upgrade your PowerShell version: https://aka.ms/pscore6'
2526
exit 2
2627
}
2728

@@ -35,7 +36,6 @@ function Build {
3536

3637
$ScriptHome = $PSScriptRoot
3738
$ProjectRoot = Resolve-Path -Path "$PSScriptRoot/../.."
38-
$BuildSpecFile = "${ProjectRoot}/buildspec.json"
3939

4040
$UtilityFunctions = Get-ChildItem -Path $PSScriptRoot/utils.pwsh/*.ps1 -Recurse
4141

@@ -44,58 +44,39 @@ function Build {
4444
. $Utility.FullName
4545
}
4646

47-
$BuildSpec = Get-Content -Path ${BuildSpecFile} -Raw | ConvertFrom-Json
48-
$ProductName = $BuildSpec.name
49-
$ProductVersion = $BuildSpec.version
47+
Push-Location -Stack BuildTemp
48+
Ensure-Location $ProjectRoot
5049

51-
if ( ! $SkipDeps ) {
52-
Install-BuildDependencies -WingetFile "${ScriptHome}/.Wingetfile"
53-
}
50+
$CmakeArgs = @('--preset', "windows-ci-${Target}")
51+
$CmakeBuildArgs = @('--build')
52+
$CmakeInstallArgs = @()
5453

55-
Push-Location -Stack BuildTemp
56-
if ( ! ( ( $SkipAll ) -or ( $SkipBuild ) ) ) {
57-
Ensure-Location $ProjectRoot
58-
59-
$CmakeArgs = @()
60-
$CmakeBuildArgs = @()
61-
$CmakeInstallArgs = @()
62-
63-
if ( $VerbosePreference -eq 'Continue' ) {
64-
$CmakeBuildArgs += ('--verbose')
65-
$CmakeInstallArgs += ('--verbose')
66-
}
67-
68-
if ( $DebugPreference -eq 'Continue' ) {
69-
$CmakeArgs += ('--debug-output')
70-
}
71-
72-
$Preset = "windows-$(if ( $Env:CI -ne $null ) { 'ci-' })${Target}"
73-
74-
$CmakeArgs += @(
75-
'--preset', $Preset
76-
)
77-
78-
$CmakeBuildArgs += @(
79-
'--build'
80-
'--preset', $Preset
81-
'--config', $Configuration
82-
'--parallel'
83-
'--', '/consoleLoggerParameters:Summary', '/noLogo'
84-
)
85-
86-
$CmakeInstallArgs += @(
87-
'--install', "build_${Target}"
88-
'--prefix', "${ProjectRoot}/release/${Configuration}"
89-
'--config', $Configuration
90-
)
91-
92-
Log-Group "Configuring ${ProductName}..."
93-
Invoke-External cmake @CmakeArgs
94-
95-
Log-Group "Building ${ProductName}..."
96-
Invoke-External cmake @CmakeBuildArgs
54+
if ( $DebugPreference -eq 'Continue' ) {
55+
$CmakeArgs += ('--debug-output')
56+
$CmakeBuildArgs += ('--verbose')
57+
$CmakeInstallArgs += ('--verbose')
9758
}
98-
Log-Group "Install ${ProductName}..."
59+
60+
$CmakeBuildArgs += @(
61+
'--preset', "windows-${Target}"
62+
'--config', $Configuration
63+
'--parallel'
64+
'--', '/consoleLoggerParameters:Summary', '/noLogo'
65+
)
66+
67+
$CmakeInstallArgs += @(
68+
'--install', "build_${Target}"
69+
'--prefix', "${ProjectRoot}/release/${Configuration}"
70+
'--config', $Configuration
71+
)
72+
73+
Log-Group "Configuring ${ProductName}..."
74+
Invoke-External cmake @CmakeArgs
75+
76+
Log-Group "Building ${ProductName}..."
77+
Invoke-External cmake @CmakeBuildArgs
78+
79+
Log-Group "Installing ${ProductName}..."
9980
Invoke-External cmake @CmakeInstallArgs
10081

10182
Pop-Location -Stack BuildTemp

0 commit comments

Comments
 (0)