Skip to content

Bump actions/download-artifact from 3 to 4 #152

Bump actions/download-artifact from 3 to 4

Bump actions/download-artifact from 3 to 4 #152

Workflow file for this run

name: Continuous Integration
on: [push, pull_request]
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: Install
working-directory: build
run: cmake --install . --config ${{matrix.build-type}}
- name: Upload MacOS Executable
if: matrix.os == 'macos' && matrix.build-type != 'Debug'
uses: actions/upload-artifact@v3
with:
name: MacOS-${{matrix.arch}}-${{matrix.build-type}}
path: build/Sources/sdmicmute
- name: Upload Windows Executable
if: matrix.os == 'windows' && matrix.build-type != 'Debug'
uses: actions/upload-artifact@v3
with:
name: Windows-${{matrix.build-type}}
path: build/Sources/${{matrix.build-type}}/sdmicmute.exe
- name: Upload Windows Debug Symbols
if: matrix.os == 'windows' && matrix.build-type != 'Release' && matrix.build-type != 'Debug'
uses: actions/upload-artifact@v3
with:
name: DebugSymbols-${{matrix.os}}-${{matrix.build-type}}
path: build/Sources/${{matrix.build-type}}/sdmicmute.pdb
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
streamDeckPlugin:
name: streamDeckPlugin/${{matrix.build-type}}
needs: [build]
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: Copy executables
working-directory: ${{runner.temp}}
run: |
lipo -create \
artifacts/MacOS-arm64-${{matrix.build-type}}/sdmicmute \
artifacts/MacOS-x86_64-${{matrix.build-type}}/sdmicmute \
-output com.fredemmott.micmutetoggle.sdPlugin/sdmicmute
install -m755 \
artifacts/Windows-${{matrix.build-type}}/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@v3
with:
name: ${{matrix.build-type}}-StreamDeckPlugin
path: com.fredemmott.micmutetoggle.streamDeckPlugin
strategy:
matrix:
build-type: [RelWithDebInfo]
release:
needs: [streamDeckPlugin]
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 "::set-output name=is-release::true"
echo "::set-output name=tag::$(echo ${{github.ref}} | awk -F/ '{print $NF}')"
else
echo "::set-output name=is-release::false"
fi
- name: Create Draft Release
id: create-release
if: steps.ref.outputs.is-release == 'true'
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_name: Release ${{ steps.ref.outputs.tag }}
tag_name: ${{steps.ref.outputs.tag}}
draft: true
- name: Attach Release Build
if: steps.ref.outputs.is-release == 'true'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{runner.temp}}/artifacts/RelWithDebInfo-StreamDeckPlugin/com.fredemmott.micmutetoggle.streamDeckPlugin
asset_name: com.fredemmott.micmutetoggle.streamDeckPlugin
asset_content_type: application/octet-stream
- name: Attach PDB Files
if: steps.ref.outputs.is-release == 'true'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ${{runner.temp}}/artifacts/DebugSymbols-windows-RelWithDebInfo/sdmicmute.pdb
asset_name: sdmicmute.pdb
asset_content_type: application/octet-stream