|
@@ -1,13 +1,18 @@
|
|
-name: 'Build on Push and Tag'
|
|
|
|
|
|
+name: Plugin Build
|
|
|
|
|
|
on:
|
|
on:
|
|
push:
|
|
push:
|
|
- paths-ignore: ['**.md']
|
|
|
|
- branches: [master]
|
|
|
|
- tags: ['*']
|
|
|
|
|
|
+ paths-ignore:
|
|
|
|
+ - '**.md'
|
|
|
|
+ branches:
|
|
|
|
+ - master
|
|
|
|
+ tags:
|
|
|
|
+ - '*'
|
|
pull_request:
|
|
pull_request:
|
|
- paths-ignore: ['**.md']
|
|
|
|
- branches: [master]
|
|
|
|
|
|
+ paths-ignore:
|
|
|
|
+ - '**.md'
|
|
|
|
+ branches:
|
|
|
|
+ - master
|
|
|
|
|
|
env:
|
|
env:
|
|
PLUGIN_NAME: 'obs-plugintemplate'
|
|
PLUGIN_NAME: 'obs-plugintemplate'
|
|
@@ -20,7 +25,7 @@ jobs:
|
|
- name: Checkout
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
uses: actions/checkout@v3
|
|
with:
|
|
with:
|
|
- submodules: 'recursive'
|
|
|
|
|
|
+ submodules: recursive
|
|
|
|
|
|
- name: Install clang-format
|
|
- name: Install clang-format
|
|
run: sudo apt-get install -y clang-format-12
|
|
run: sudo apt-get install -y clang-format-12
|
|
@@ -38,8 +43,9 @@ jobs:
|
|
name: 02 - macOS
|
|
name: 02 - macOS
|
|
runs-on: macos-11
|
|
runs-on: macos-11
|
|
strategy:
|
|
strategy:
|
|
|
|
+ fail-fast: true
|
|
matrix:
|
|
matrix:
|
|
- arch: ['x86_64', 'arm64', 'universal']
|
|
|
|
|
|
+ arch: [x86_64, arm64, universal]
|
|
if: always()
|
|
if: always()
|
|
needs: [clang_check]
|
|
needs: [clang_check]
|
|
outputs:
|
|
outputs:
|
|
@@ -55,21 +61,23 @@ jobs:
|
|
- name: Checkout
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
uses: actions/checkout@v3
|
|
with:
|
|
with:
|
|
- path: 'plugin'
|
|
|
|
- submodules: 'recursive'
|
|
|
|
|
|
+ path: plugin
|
|
|
|
+ submodules: recursive
|
|
|
|
|
|
- name: Checkout obs-studio
|
|
- name: Checkout obs-studio
|
|
uses: actions/checkout@v3
|
|
uses: actions/checkout@v3
|
|
with:
|
|
with:
|
|
repository: 'obsproject/obs-studio'
|
|
repository: 'obsproject/obs-studio'
|
|
- path: 'obs-studio'
|
|
|
|
|
|
+ path: obs-studio
|
|
fetch-depth: 0
|
|
fetch-depth: 0
|
|
- submodules: 'recursive'
|
|
|
|
|
|
+ submodules: recursive
|
|
|
|
|
|
- name: Setup Environment
|
|
- name: Setup Environment
|
|
id: setup
|
|
id: setup
|
|
working-directory: ${{ github.workspace }}/plugin
|
|
working-directory: ${{ github.workspace }}/plugin
|
|
run: |
|
|
run: |
|
|
|
|
+ ## SETUP ENVIRONMENT SCRIPT
|
|
|
|
+ print '::group::Clean Homebrew Environment'
|
|
typeset -a to_remove=()
|
|
typeset -a to_remove=()
|
|
|
|
|
|
for formula (speexdsp curl php) {
|
|
for formula (speexdsp curl php) {
|
|
@@ -77,7 +85,9 @@ jobs:
|
|
}
|
|
}
|
|
|
|
|
|
if (( #to_remove > 0 )) brew uninstall --ignore-dependencies ${to_remove}
|
|
if (( #to_remove > 0 )) brew uninstall --ignore-dependencies ${to_remove}
|
|
|
|
+ print '::endgroup::'
|
|
|
|
|
|
|
|
+ print '::group::Set up code signing'
|
|
if [[ '${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}' != '' && \
|
|
if [[ '${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}' != '' && \
|
|
'${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}' != '' && \
|
|
'${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}' != '' && \
|
|
'${{ secrets.MACOS_SIGNING_CERT }}' != '' ]] {
|
|
'${{ secrets.MACOS_SIGNING_CERT }}' != '' ]] {
|
|
@@ -92,9 +102,10 @@ jobs:
|
|
} else {
|
|
} else {
|
|
print '::set-output name=haveNotarizationUser::false'
|
|
print '::set-output name=haveNotarizationUser::false'
|
|
}
|
|
}
|
|
|
|
+ print '::endgroup::'
|
|
|
|
|
|
print "::set-output name=ccacheDate::$(date +"%Y-%m-%d")"
|
|
print "::set-output name=ccacheDate::$(date +"%Y-%m-%d")"
|
|
- print "::set-output name=commitHash::$(git rev-parse --short HEAD)"
|
|
|
|
|
|
+ print "::set-output name=commitHash::${"$(git rev-parse HEAD)"[0,9]}"
|
|
|
|
|
|
- name: Restore Compilation Cache
|
|
- name: Restore Compilation Cache
|
|
id: ccache-cache
|
|
id: ccache-cache
|
|
@@ -119,6 +130,7 @@ jobs:
|
|
if: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
|
|
if: ${{ github.event_name != 'pull_request' && steps.setup.outputs.haveCodesignIdent == 'true' }}
|
|
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
|
|
uses: apple-actions/import-codesign-certs@253ddeeac23f2bdad1646faac5c8c2832e800071
|
|
with:
|
|
with:
|
|
|
|
+ keychain-password: ${{ github.run_id }}
|
|
p12-file-base64: ${{ secrets.MACOS_SIGNING_CERT }}
|
|
p12-file-base64: ${{ secrets.MACOS_SIGNING_CERT }}
|
|
p12-password: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }}
|
|
p12-password: ${{ secrets.MACOS_SIGNING_CERT_PASSWORD }}
|
|
|
|
|
|
@@ -161,8 +173,9 @@ jobs:
|
|
name: 02 - Linux
|
|
name: 02 - Linux
|
|
runs-on: ubuntu-20.04
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
strategy:
|
|
|
|
+ fail-fast: true
|
|
matrix:
|
|
matrix:
|
|
- arch: ['x86_64']
|
|
|
|
|
|
+ arch: [x86_64]
|
|
if: always()
|
|
if: always()
|
|
needs: [clang_check]
|
|
needs: [clang_check]
|
|
outputs:
|
|
outputs:
|
|
@@ -174,37 +187,39 @@ jobs:
|
|
- name: Checkout
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
uses: actions/checkout@v3
|
|
with:
|
|
with:
|
|
- path: 'plugin'
|
|
|
|
- submodules: 'recursive'
|
|
|
|
|
|
+ path: plugin
|
|
|
|
+ submodules: recursive
|
|
|
|
|
|
- name: Checkout obs-studio
|
|
- name: Checkout obs-studio
|
|
uses: actions/checkout@v3
|
|
uses: actions/checkout@v3
|
|
with:
|
|
with:
|
|
repository: 'obsproject/obs-studio'
|
|
repository: 'obsproject/obs-studio'
|
|
- path: 'obs-studio'
|
|
|
|
|
|
+ path: obs-studio
|
|
fetch-depth: 0
|
|
fetch-depth: 0
|
|
- submodules: 'recursive'
|
|
|
|
|
|
+ submodules: recursive
|
|
|
|
|
|
- name: Setup Environment
|
|
- name: Setup Environment
|
|
working-directory: ${{ github.workspace }}/plugin
|
|
working-directory: ${{ github.workspace }}/plugin
|
|
id: setup
|
|
id: setup
|
|
run: |
|
|
run: |
|
|
|
|
+ ## SETUP ENVIRONMENT SCRIPT
|
|
echo "::set-output name=ccacheDate::$(date +"%Y-%m-%d")"
|
|
echo "::set-output name=ccacheDate::$(date +"%Y-%m-%d")"
|
|
- echo "::set-output name=commitHash::$(git rev-parse --short HEAD)"
|
|
|
|
|
|
+ echo "::set-output name=commitHash::$(git rev-parse HEAD | cut -c1-9)"
|
|
|
|
|
|
- name: Restore Compilation Cache
|
|
- name: Restore Compilation Cache
|
|
id: ccache-cache
|
|
id: ccache-cache
|
|
uses: actions/cache@v2.1.7
|
|
uses: actions/cache@v2.1.7
|
|
with:
|
|
with:
|
|
path: ${{ github.workspace }}/.ccache
|
|
path: ${{ github.workspace }}/.ccache
|
|
- key: macos-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }}
|
|
|
|
|
|
+ key: linux-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }}
|
|
restore-keys: |
|
|
restore-keys: |
|
|
- macos-${{ matrix.arch }}-ccache-plugin-
|
|
|
|
|
|
+ linux-${{ matrix.arch }}-ccache-plugin-
|
|
|
|
|
|
- name: Check for GitHub Labels
|
|
- name: Check for GitHub Labels
|
|
id: seekingTesters
|
|
id: seekingTesters
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
run: |
|
|
run: |
|
|
|
|
+ ## GITHUB LABEL SCRIPT
|
|
if [[ -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')" ]]; then
|
|
if [[ -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')" ]]; then
|
|
echo '::set-output name=found::true'
|
|
echo '::set-output name=found::true'
|
|
else
|
|
else
|
|
@@ -212,12 +227,11 @@ jobs:
|
|
fi
|
|
fi
|
|
|
|
|
|
- name: Build Plugin
|
|
- name: Build Plugin
|
|
- uses: ././plugin/.github/actions/build-plugin
|
|
|
|
|
|
+ uses: ./plugin/.github/actions/build-plugin
|
|
with:
|
|
with:
|
|
workingDirectory: ${{ github.workspace }}/plugin
|
|
workingDirectory: ${{ github.workspace }}/plugin
|
|
target: ${{ matrix.arch }}
|
|
target: ${{ matrix.arch }}
|
|
config: RelWithDebInfo
|
|
config: RelWithDebInfo
|
|
- codesign: ${{ env.HAVE_CODESIGN_IDENTITY }}
|
|
|
|
|
|
|
|
- name: Package Plugin
|
|
- name: Package Plugin
|
|
uses: ./plugin/.github/actions/package-plugin
|
|
uses: ./plugin/.github/actions/package-plugin
|
|
@@ -231,14 +245,15 @@ jobs:
|
|
uses: actions/upload-artifact@v3
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
with:
|
|
name: ${{ env.PLUGIN_NAME }}-linux-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
|
|
name: ${{ env.PLUGIN_NAME }}-linux-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
|
|
- path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*-Linux.*
|
|
|
|
|
|
+ path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*-linux.*
|
|
|
|
|
|
windows_build:
|
|
windows_build:
|
|
name: 02 - Windows
|
|
name: 02 - Windows
|
|
runs-on: windows-2022
|
|
runs-on: windows-2022
|
|
strategy:
|
|
strategy:
|
|
|
|
+ fail-fast: true
|
|
matrix:
|
|
matrix:
|
|
- arch: ['x86', 'x64']
|
|
|
|
|
|
+ arch: [x86, x64]
|
|
if: always()
|
|
if: always()
|
|
needs: [clang_check]
|
|
needs: [clang_check]
|
|
outputs:
|
|
outputs:
|
|
@@ -250,22 +265,23 @@ jobs:
|
|
- name: Checkout
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
uses: actions/checkout@v3
|
|
with:
|
|
with:
|
|
- path: 'plugin'
|
|
|
|
- submodules: 'recursive'
|
|
|
|
|
|
+ path: plugin
|
|
|
|
+ submodules: recursive
|
|
|
|
|
|
- name: Checkout obs-studio
|
|
- name: Checkout obs-studio
|
|
uses: actions/checkout@v3
|
|
uses: actions/checkout@v3
|
|
with:
|
|
with:
|
|
repository: 'obsproject/obs-studio'
|
|
repository: 'obsproject/obs-studio'
|
|
- path: 'obs-studio'
|
|
|
|
|
|
+ path: obs-studio
|
|
fetch-depth: 0
|
|
fetch-depth: 0
|
|
- submodules: 'recursive'
|
|
|
|
|
|
+ submodules: recursive
|
|
|
|
|
|
- name: Setup Environment
|
|
- name: Setup Environment
|
|
working-directory: ${{ github.workspace }}/plugin
|
|
working-directory: ${{ github.workspace }}/plugin
|
|
id: setup
|
|
id: setup
|
|
run: |
|
|
run: |
|
|
- $CommitHash = git rev-parse --short HEAD
|
|
|
|
|
|
+ ## SETUP ENVIRONMENT SCRIPT
|
|
|
|
+ $CommitHash = (git rev-parse HEAD)[0..8] -join ''
|
|
Write-Output "::set-output name=commitHash::${CommitHash}"
|
|
Write-Output "::set-output name=commitHash::${CommitHash}"
|
|
|
|
|
|
- name: Check for GitHub Labels
|
|
- name: Check for GitHub Labels
|
|
@@ -273,6 +289,7 @@ jobs:
|
|
working-directory: ${{ github.workspace }}/plugin
|
|
working-directory: ${{ github.workspace }}/plugin
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
if: ${{ github.event_name == 'pull_request' }}
|
|
run: |
|
|
run: |
|
|
|
|
+ ## GITHUB LABEL SCRIPT
|
|
$LabelFound = try {
|
|
$LabelFound = try {
|
|
$Params = @{
|
|
$Params = @{
|
|
Authentication = 'Bearer'
|
|
Authentication = 'Bearer'
|
|
@@ -281,7 +298,7 @@ jobs:
|
|
UseBasicParsing = $true
|
|
UseBasicParsing = $true
|
|
}
|
|
}
|
|
|
|
|
|
- (Invoke-RestMethod @Params).labels.name.contains("Seeking Testers")
|
|
|
|
|
|
+ (Invoke-RestMethod @Params).labels.name.contains('Seeking Testers')
|
|
} catch {
|
|
} catch {
|
|
$false
|
|
$false
|
|
}
|
|
}
|
|
@@ -289,7 +306,7 @@ jobs:
|
|
Write-Output "::set-output name=found::$(([string]${LabelFound}).ToLower())"
|
|
Write-Output "::set-output name=found::$(([string]${LabelFound}).ToLower())"
|
|
|
|
|
|
- name: Build Plugin
|
|
- name: Build Plugin
|
|
- uses: ././plugin/.github/actions/build-plugin
|
|
|
|
|
|
+ uses: ./plugin/.github/actions/build-plugin
|
|
with:
|
|
with:
|
|
workingDirectory: ${{ github.workspace }}/plugin
|
|
workingDirectory: ${{ github.workspace }}/plugin
|
|
target: ${{ matrix.arch }}
|
|
target: ${{ matrix.arch }}
|
|
@@ -312,12 +329,12 @@ jobs:
|
|
|
|
|
|
- name: Package Plugin Installer
|
|
- name: Package Plugin Installer
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
|
|
- uses: ././plugin/.github/actions/package-plugin
|
|
|
|
|
|
+ uses: ./plugin/.github/actions/package-plugin
|
|
with:
|
|
with:
|
|
workingDirectory: ${{ github.workspace }}/plugin
|
|
workingDirectory: ${{ github.workspace }}/plugin
|
|
target: ${{ matrix.arch }}
|
|
target: ${{ matrix.arch }}
|
|
config: RelWithDebInfo
|
|
config: RelWithDebInfo
|
|
- createInstaller: 'true'
|
|
|
|
|
|
+ createInstaller: true
|
|
|
|
|
|
- name: Upload Installer Artifact
|
|
- name: Upload Installer Artifact
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
|
|
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
|
|
@@ -339,6 +356,7 @@ jobs:
|
|
- name: Get Metadata
|
|
- name: Get Metadata
|
|
id: metadata
|
|
id: metadata
|
|
run: |
|
|
run: |
|
|
|
|
+ ## METADATA SCRIPT
|
|
echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"
|
|
echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"
|
|
echo "::set-output name=date::$(date +"%Y-%m-%d")"
|
|
echo "::set-output name=date::$(date +"%Y-%m-%d")"
|
|
echo '::set-output name=commitHash::${{ needs.macos_build.outputs.commitHash }}'
|
|
echo '::set-output name=commitHash::${{ needs.macos_build.outputs.commitHash }}'
|
|
@@ -348,6 +366,7 @@ jobs:
|
|
|
|
|
|
- name: Generate Checksums
|
|
- name: Generate Checksums
|
|
run: |
|
|
run: |
|
|
|
|
+ ## CHECKSUM GENERATION SCRIPT
|
|
shopt -s extglob
|
|
shopt -s extglob
|
|
echo "### Checksums" > ${{ github.workspace }}/CHECKSUMS.txt
|
|
echo "### Checksums" > ${{ github.workspace }}/CHECKSUMS.txt
|
|
for file in ${{ github.workspace }}/**/@(*.pkg|*.exe|*.deb|*.zip); do
|
|
for file in ${{ github.workspace }}/**/@(*.pkg|*.exe|*.deb|*.zip); do
|
|
@@ -365,9 +384,9 @@ jobs:
|
|
body_path: ${{ github.workspace }}/CHECKSUMS.txt
|
|
body_path: ${{ github.workspace }}/CHECKSUMS.txt
|
|
files: |
|
|
files: |
|
|
${{ github.workspace }}/${{ env.PLUGIN_NAME }}-windows-x64-${{ steps.metadata.outputs.commitHash }}/*.zip
|
|
${{ github.workspace }}/${{ env.PLUGIN_NAME }}-windows-x64-${{ steps.metadata.outputs.commitHash }}/*.zip
|
|
- ${{ github.workspace }}/${{ env.PLUGIN_NAME }}-windows-x64-${{ steps.metadata.outputs.commitHash }}/*.exe
|
|
|
|
|
|
+ ${{ github.workspace }}/${{ env.PLUGIN_NAME }}-windows-x64-${{ steps.metadata.outputs.commitHash }}-installer/*.exe
|
|
${{ github.workspace }}/${{ env.PLUGIN_NAME }}-windows-x86-${{ steps.metadata.outputs.commitHash }}/*.zip
|
|
${{ github.workspace }}/${{ env.PLUGIN_NAME }}-windows-x86-${{ steps.metadata.outputs.commitHash }}/*.zip
|
|
- ${{ github.workspace }}/${{ env.PLUGIN_NAME }}-windows-x86-${{ steps.metadata.outputs.commitHash }}/*.exe
|
|
|
|
|
|
+ ${{ github.workspace }}/${{ env.PLUGIN_NAME }}-windows-x86-${{ steps.metadata.outputs.commitHash }}-installer/*.exe
|
|
${{ github.workspace }}/${{ env.PLUGIN_NAME }}-linux-x86_64-${{ steps.metadata.outputs.commitHash }}/*.deb
|
|
${{ github.workspace }}/${{ env.PLUGIN_NAME }}-linux-x86_64-${{ steps.metadata.outputs.commitHash }}/*.deb
|
|
${{ github.workspace }}/${{ env.PLUGIN_NAME }}-macos-x86_64-${{ steps.metadata.outputs.commitHash }}/*.pkg
|
|
${{ github.workspace }}/${{ env.PLUGIN_NAME }}-macos-x86_64-${{ steps.metadata.outputs.commitHash }}/*.pkg
|
|
${{ github.workspace }}/${{ env.PLUGIN_NAME }}-macos-arm64-${{ steps.metadata.outputs.commitHash }}/*.pkg
|
|
${{ github.workspace }}/${{ env.PLUGIN_NAME }}-macos-arm64-${{ steps.metadata.outputs.commitHash }}/*.pkg
|