Skip to content

Commit

Permalink
Version 2.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
nhielost committed Mar 25, 2023
1 parent 6833459 commit e3d7893
Show file tree
Hide file tree
Showing 73 changed files with 4,604 additions and 7,016 deletions.
73 changes: 43 additions & 30 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ on:
branches:
- master

env:
PLUGIN_NAME: 'obs-midi-mg'

jobs:
clang_check:
name: 01 - Code Format Check
Expand Down Expand Up @@ -89,25 +86,27 @@ jobs:
if [[ '${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}' != '' && \
'${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}' != '' && \
'${{ secrets.MACOS_SIGNING_CERT }}' != '' ]] {
print '::set-output name=haveCodesignIdent::true'
print 'haveCodesignIdent=true' >> $GITHUB_OUTPUT
} else {
print '::set-output name=haveCodesignIdent::false'
print 'haveCodesignIdent=false' >> $GITHUB_OUTPUT
}
if [[ '${{ secrets.MACOS_NOTARIZATION_USERNAME }}' != '' && \
'${{ secrets.MACOS_NOTARIZATION_PASSWORD }}' != '' ]] {
print '::set-output name=haveNotarizationUser::true'
print 'haveNotarizationUser=true' >> $GITHUB_OUTPUT
} else {
print '::set-output name=haveNotarizationUser::false'
print 'haveNotarizationUser=false' >> $GITHUB_OUTPUT
}
print '::endgroup::'
print "::set-output name=ccacheDate::$(date +"%Y-%m-%d")"
print "::set-output name=commitHash::${"$(git rev-parse HEAD)"[0,9]}"
print "ccacheDate=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT
print "commitHash=${"$(git rev-parse HEAD)"[0,9]}" >> $GITHUB_OUTPUT
print "pluginName=$(jq -r '.name' buildspec.json)" >> $GITHUB_OUTPUT
- name: Restore Compilation Cache
id: ccache-cache
uses: actions/cache@v2.1.7
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.ccache
key: macos-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }}
Expand All @@ -119,9 +118,9 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
run: |
if [[ -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')" ]] {
print '::set-output name=found::true'
print 'found=true' >> $GITHUB_OUTPUT
} else {
print '::set-output name=found::false'
print 'found=false' >> $GITHUB_OUTPUT
}
- name: Install Apple Developer Certificate
Expand Down Expand Up @@ -164,8 +163,8 @@ jobs:
if: ${{ success() && (github.event_name != 'pull_request' || steps.seekingTesters.outputs.found == 'true') }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.PLUGIN_NAME }}-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*-macos-${{ matrix.arch }}.pkg
name: ${{ steps.setup.outputs.pluginName }}-macos-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
path: ${{ github.workspace }}/plugin/release/${{ steps.setup.outputs.pluginName }}-*-macos-${{ matrix.arch }}.pkg

linux_build:
name: 02 - Linux
Expand Down Expand Up @@ -201,12 +200,13 @@ jobs:
id: setup
run: |
## SETUP ENVIRONMENT SCRIPT
echo "::set-output name=ccacheDate::$(date +"%Y-%m-%d")"
echo "::set-output name=commitHash::$(git rev-parse HEAD | cut -c1-9)"
echo "ccacheDate=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT
echo "commitHash=$(git rev-parse HEAD | cut -c1-9)" >> $GITHUB_OUTPUT
echo "pluginName=$(jq -r '.name' buildspec.json)" >> $GITHUB_OUTPUT
- name: Restore Compilation Cache
id: ccache-cache
uses: actions/cache@v2.1.7
uses: actions/cache@v3
with:
path: ${{ github.workspace }}/.ccache
key: linux-${{ matrix.arch }}-ccache-plugin-${{ steps.setup.outputs.ccacheDate }}
Expand All @@ -219,9 +219,9 @@ jobs:
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
echo '::set-output name=found::true'
echo 'found=true' >> $GITHUB_OUTPUT
else
echo '::set-output name=found::false'
echo 'found=false' >> $GITHUB_OUTPUT
fi
- name: Build Plugin
Expand All @@ -242,16 +242,16 @@ jobs:
if: ${{ success() && (github.event_name != 'pull_request' || steps.seekingTesters.outputs.found == 'true') }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.PLUGIN_NAME }}-linux-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*-linux-${{ matrix.arch }}.*
name: ${{ steps.setup.outputs.pluginName }}-linux-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
path: ${{ github.workspace }}/plugin/release/${{ steps.setup.outputs.pluginName }}-*-linux-${{ matrix.arch }}.*

windows_build:
name: 02 - Windows
runs-on: windows-2022
strategy:
fail-fast: true
matrix:
arch: [x86, x64]
arch: [x64]
if: always()
needs: [clang_check]
outputs:
Expand Down Expand Up @@ -280,7 +280,10 @@ jobs:
run: |
## SETUP ENVIRONMENT SCRIPT
$CommitHash = (git rev-parse HEAD)[0..8] -join ''
Write-Output "::set-output name=commitHash::${CommitHash}"
"commitHash=${CommitHash}" >> $env:GITHUB_OUTPUT
$BuildSpec = Get-Content -Path buildspec.json -Raw | ConvertFrom-Json
$PluginName = $BuildSpec.name
"pluginName=${PluginName}" >> $env:GITHUB_OUTPUT
- name: Check for GitHub Labels
id: seekingTesters
Expand All @@ -301,7 +304,7 @@ jobs:
$false
}
Write-Output "::set-output name=found::$(([string]${LabelFound}).ToLower())"
"found=$(([string]${LabelFound}).ToLower())" >> $env:GITHUB_OUTPUT
- name: Build Plugin
uses: ./plugin/.github/actions/build-plugin
Expand All @@ -322,8 +325,8 @@ jobs:
if: ${{ success() && (github.event_name != 'pull_request' || steps.seekingTesters.outputs.found == 'true') }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.PLUGIN_NAME }}-windows-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*.zip
name: ${{ steps.setup.outputs.pluginName }}-windows-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}
path: ${{ github.workspace }}/plugin/release/${{ steps.setup.outputs.pluginName }}-*.zip

- name: Package Plugin Installer
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
Expand All @@ -338,8 +341,8 @@ jobs:
if: ${{ startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request' }}
uses: actions/upload-artifact@v3
with:
name: ${{ env.PLUGIN_NAME }}-windows-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}-installer
path: ${{ github.workspace }}/plugin/release/${{ env.PLUGIN_NAME }}-*.exe
name: ${{ steps.setup.outputs.pluginName }}-windows-${{ matrix.arch }}-${{ steps.setup.outputs.commitHash }}-installer
path: ${{ github.workspace }}/plugin/release/${{ steps.setup.outputs.pluginName }}-*.exe

make-release:
name: 03 - Create and upload release
Expand All @@ -349,12 +352,22 @@ jobs:
defaults:
run:
shell: bash
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
path: plugin
submodules: recursive

- name: Get Metadata
working-directory: ${{ github.workspace }}/plugin
id: metadata
run: |
## METADATA SCRIPT
echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"
echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
echo "pluginName=$(jq -r '.name' buildspec.json)" >> $GITHUB_OUTPUT
- name: Download build artifacts
uses: actions/download-artifact@v3
Expand All @@ -375,7 +388,7 @@ jobs:
draft: false
prerelease: ${{ contains(steps.metadata.outputs.version, 'rc') || contains(steps.metadata.outputs.version, 'beta') }}
tag_name: ${{ steps.metadata.outputs.version }}
name: "${{ env.PLUGIN_NAME }} ${{ steps.metadata.outputs.version }}"
name: "${{ steps.metadata.outputs.pluginName }} ${{ steps.metadata.outputs.version }}"
body_path: ${{ github.workspace }}/CHECKSUMS.txt
files: |
${{ github.workspace }}/**/*.zip
Expand Down
20 changes: 16 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16...3.21)

# Change obs-plugintemplate to your plugin's name in a machine-readable format
# (e.g.: obs-myawesomeplugin) and set
project(obs-midi-mg VERSION 2.2.0)
project(obs-midi-mg VERSION 2.3.0)
add_library(obs-midi-mg MODULE)

# Replace `Your Name Here` with the name (yours or your organization's) you want
Expand Down Expand Up @@ -49,14 +49,18 @@ target_sources(
./src/actions/mmg-action-collections.cpp
./src/actions/mmg-action-midi.cpp
./src/actions/mmg-action-internal.cpp
./src/actions/mmg-action-timeout.cpp
./src/mmg-binding.cpp
./src/mmg-config.cpp
./src/mmg-device.cpp
./src/mmg-message.cpp
./src/mmg-midiin.cpp
./src/mmg-midiout.cpp
./src/mmg-utils.cpp
./src/obs-midi-mg.cpp
./src/ui/mmg-fields.cpp
./src/ui/mmg-lcd-number.cpp
./src/ui/mmg-number-display.cpp
./src/ui/mmg-action-display.cpp
./src/ui/mmg-echo-window.cpp)

target_sources(
Expand All @@ -79,15 +83,19 @@ target_sources(
./src/actions/mmg-action-collections.h
./src/actions/mmg-action-midi.h
./src/actions/mmg-action-internal.h
./src/actions/mmg-action-timeout.h
./src/mmg-action-include.h
./src/mmg-binding.h
./src/mmg-config.h
./src/mmg-device.h
./src/mmg-message.h
./src/mmg-midiin.h
./src/mmg-midiout.h
./src/mmg-utils.h
./src/obs-midi-mg.h
./src/ui/mmg-fields.h
./src/ui/mmg-lcd-number.h
./src/ui/mmg-number-display.h
./src/ui/mmg-action-display.h
./src/ui/mmg-echo-window.h)

# Import libobs as main plugin dependency
Expand Down Expand Up @@ -129,6 +137,10 @@ if(OS_WINDOWS)
configure_file(cmake/bundle/windows/installer-Windows.iss.in
${CMAKE_BINARY_DIR}/installer-Windows.generated.iss)

configure_file(cmake/bundle/windows/resource.rc.in
${CMAKE_BINARY_DIR}/obs-midi-mg.rc)
target_sources(obs-midi-mg PRIVATE ${CMAKE_BINARY_DIR}/obs-midi-mg.rc)

if(MSVC)
target_compile_options(obs-midi-mg PRIVATE /W3)
endif()
Expand All @@ -141,7 +153,7 @@ elseif(OS_MACOS)

set(MACOSX_PLUGIN_GUI_IDENTIFIER "${MACOS_BUNDLEID}")
set(MACOSX_PLUGIN_BUNDLE_VERSION "${CMAKE_PROJECT_VERSION}")
set(MACOSX_PLUGIN_SHORT_VERSION_STRING "2.2.0")
set(MACOSX_PLUGIN_SHORT_VERSION_STRING "2.3.0")

target_compile_options(obs-midi-mg PRIVATE -Wall)
# --- End of section ---
Expand Down

0 comments on commit e3d7893

Please sign in to comment.