-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4c9f5a
commit 2a08505
Showing
5 changed files
with
205 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
on: | ||
workflow_call | ||
jobs: | ||
build: | ||
name: Build ${{matrix.os}}/${{matrix.arch}}/${{matrix.build-type}} | ||
runs-on: ${{matrix.os}}-${{matrix.os_version}} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: source | ||
- name: Make build directory | ||
run: cmake -E make_directory build | ||
- name: Fetch code-signing key | ||
id: signing-key | ||
if: (matrix.os == 'windows') && (github.repository == 'fredemmott/StreamDeck-AudioMute') && (github.event_name == 'push') && (github.actor == 'fredemmott') | ||
env: | ||
CODE_SIGNING_PFX_BASE64: ${{ secrets.CODE_SIGNING_PFX_BASE64 }} | ||
run: | | ||
$KeyFile = "${{runner.temp}}/MyCert.pfx" | ||
[System.Convert]::FromBase64String($Env:CODE_SIGNING_PFX_BASE64) ` | ||
| Set-Content $KeyFile -AsByteStream | ||
Add-Content $Env:GITHUB_OUTPUT "KEY_FILE=$KeyFile" | ||
- name: Configure | ||
working-directory: build | ||
shell: pwsh | ||
run: | | ||
$args = @( | ||
"-DCMAKE_BUILD_TYPE=${{matrix.build-type}}" | ||
"-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/com.fredemmott.micmutetoggle.sdPlugin" | ||
"-DCMAKE_OSX_ARCHITECTURES=${{matrix.arch}}" | ||
"-DCMAKE_OSX_DEPLOYMENT_TARGET=10.11" | ||
) | ||
if ( "${{matrix.os}}" -eq "windows" ) { | ||
$args += "-DCMAKE_SYSTEM_VERSION=10.0.22621.0" | ||
} | ||
$KeyFile = "${{steps.signing-key.outputs.KEY_FILE}}" | ||
if ( "$keyPath" -ne "" ) { | ||
$args += "-DSIGNTOOL_KEY_ARGS=/f;$KeyFile" | ||
} | ||
cmake ${{github.workspace}}/source @args | ||
- name: Compile | ||
working-directory: build | ||
run: cmake --build . --config ${{matrix.build-type}} --parallel | ||
- name: Split out MacOS debug symbols | ||
if: matrix.os == 'macos' && matrix.build-type == 'RelWithDebInfo' | ||
working-directory: build/Sources | ||
run: | | ||
dsymutil sdmicmute | ||
strip -x -S sdmicmute | ||
- name: Isolate artifacts | ||
shell: pwsh | ||
if: matrix.build-type == 'RelWithDebInfo' | ||
run: | | ||
$Out = "${{runner.temp}}/out" | ||
New-Item -ItemType "directory" -Path "${{runner.temp}}/out" | ||
Switch ("${{matrix.os}}") | ||
{ | ||
'macos' { | ||
Copy-Item build/Sources/sdmicmute $Out/ | ||
Copy-Item -Recurse build/Sources/sdmicmute.dSYM $Out/sdmicmute.dSYM | ||
} | ||
'windows' { | ||
Copy-Item build/Sources/${{matrix.build-type}}/*.exe $Out/ | ||
Copy-Item build/Sources/${{matrix.build-type}}/*.pdb $Out/ | ||
} | ||
} | ||
Get-ChildItem $Out | ||
- name: Upload artifacts | ||
if: matrix.build-type == 'RelWithDebInfo' | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: build-${{matrix.os}}-${{matrix.arch}}-${{matrix.build-type}} | ||
path: ${{runner.temp}}/out | ||
strategy: | ||
matrix: | ||
target: [windows, macos-arm64, macos-x86_64] | ||
build-type: [RelWithDebInfo, Debug] | ||
include: | ||
- target: windows | ||
os: windows | ||
arch: x86_64 | ||
os_version: latest | ||
- target: macos-arm64 | ||
os: macos | ||
arch: arm64 | ||
os_version: 12 # 'latest' is current 11, need better C++20 support | ||
- target: macos-x86_64 | ||
os: macos | ||
arch: x86_64 | ||
os_version: 12 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
on: | ||
workflow_call: | ||
jobs: | ||
streamDeckPlugin: | ||
name: Package | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: source | ||
- name: Make build directory | ||
run: cmake -E make_directory build | ||
- name: Configure | ||
working-directory: build | ||
shell: pwsh | ||
run: | | ||
cmake ${{github.workspace}}/source ` | ||
"-DCMAKE_INSTALL_PREFIX=${{runner.temp}}/com.fredemmott.micmutetoggle.sdPlugin" | ||
- name: Install static files | ||
working-directory: build/sdPlugin | ||
run: make install | ||
- name: Download build artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: ${{runner.temp}}/artifacts | ||
- name: Display downloaded files | ||
run: ls -R | ||
working-directory: ${{runner.temp}}/artifacts | ||
- name: Combine MacOS artifacts | ||
working-directory: ${{runner.temp}} | ||
run: | | ||
lipo -create \ | ||
artifacts/build-macos-arm64-RelWithDebInfo/sdmicmute \ | ||
artifacts/build-macos-x86_64-RelWithDebInfo/sdmicmute \ | ||
-output sdmicmute | ||
mkdir dsym | ||
cp -R \ | ||
artifacts/build-macos-arm64-RelWithDebInfo/*.dSYM \ | ||
dsym/sdmicmute.dSYM | ||
DSYM_FILE=Contents/Resources/DWARF/sdmicmute | ||
rm dsym/sdmicmute.dSYM/${DSYM_FILE} | ||
lipo -create \ | ||
artifacts/build-macos*/*.dSYM/${DSYM_FILE} \ | ||
-output dsym/sdmicmute.dSYM/${DSYM_FILE} | ||
( | ||
cd dsym | ||
zip -r sdmicmute.dSYM.zip sdmicmute.dSYM | ||
) | ||
- name: Upload MacOS debug symbols | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: package-macos-DebugSymbols | ||
path: ${{runner.temp}}/dsym/sdmicmute.dSYM.zip | ||
- name: Copy executables | ||
working-directory: ${{runner.temp}} | ||
run: | | ||
install -m755 \ | ||
sdmicmute \ | ||
com.fredemmott.micmutetoggle.sdPlugin/sdmicmute | ||
install -m755 \ | ||
artifacts/build-windows-x86_64-RelWithDebInfo/sdmicmute.exe \ | ||
com.fredemmott.micmutetoggle.sdPlugin/sdmicmute.exe | ||
- name: Checkout DistributionTool | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: distributiontool-v1.4 | ||
- name: Build .streamDeckPlugin | ||
run: | | ||
./DistributionTool -b \ | ||
-i ${{runner.temp}}/com.fredemmott.micmutetoggle.sdPlugin \ | ||
-o . | ||
- name: Upload .streamDeckPlugin | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: package-sdplugin | ||
path: com.fredemmott.micmutetoggle.streamDeckPlugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
name: Prepare release | ||
on: | ||
workflow_call: | ||
workflow_call: | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
path: ${{runner.temp}}/artifacts | ||
- name: Display downloaded files | ||
run: ls -R | ||
working-directory: ${{runner.temp}}/artifacts | ||
- name: Check if this is a release push | ||
id: ref | ||
run: | | ||
if echo ${{github.ref}} | grep --silent refs/tags/v; then | ||
echo "is-release=true" >> $GITHUB_OUTPUT | ||
echo "tag=$(echo ${{github.ref}} | awk -F/ '{print $NF}')" >> $GITHUB_OUTPUT | ||
else | ||
echo "is-release=false" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Create Draft Release | ||
id: create-release | ||
if: steps.ref.outputs.is-release == 'true' | ||
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | ||
with: | ||
tag_name: ${{steps.ref.outputs.tag}} | ||
prerelease: ${{contains(github.ref_name, '-')}} | ||
draft: true | ||
files: | | ||
${{runner.temp}}/artifacts/com.fredemmott.micmutetoggle.streamDeckPlugin/com.fredemmott.micmutetoggle.streamDeckPlugin | ||
${{runner.temp}}/artifacts/DebugSymbols-windows-RelWithDebInfo/sdmicmute.pdb | ||
${{runner.temp}}/artifacts/sdmicmute-lipo-dsym/sdmicmute.dSYM.zip | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
path: ${{runner.temp}}/artifacts | ||
- name: Display downloaded files | ||
run: ls -R | ||
working-directory: ${{runner.temp}}/artifacts | ||
- name: Check if this is a release push | ||
id: ref | ||
run: | | ||
if echo ${{github.ref}} | grep --silent refs/tags/v; then | ||
echo "is-release=true" >> $GITHUB_OUTPUT | ||
echo "tag=$(echo ${{github.ref}} | awk -F/ '{print $NF}')" >> $GITHUB_OUTPUT | ||
else | ||
echo "is-release=false" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Create Draft Release | ||
id: create-release | ||
if: steps.ref.outputs.is-release == 'true' | ||
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | ||
with: | ||
tag_name: ${{steps.ref.outputs.tag}} | ||
prerelease: ${{contains(github.ref_name, '-')}} | ||
draft: true | ||
files: | | ||
${{runner.temp}}/artifacts/package-sdplugin/*.streamDeckPlugin | ||
${{runner.temp}}/artifacts/build-windows-x86_64-RelWithDebInfo/*.pdb | ||
${{runner.temp}}/artifacts/package-macos-DebugSymbols/*.dSYM.zip |
Oops, something went wrong.