Skip to content

Add workflow and license for SpeexDSP natives (#13) #1

Add workflow and license for SpeexDSP natives (#13)

Add workflow and license for SpeexDSP natives (#13) #1

Workflow file for this run

name: Build speexdsp
on:
workflow_dispatch:
push:
branches:
- master
paths:
- '.github/workflows/speexdsp.yml'
- 'build/SpeexDSP_CMakeLists.txt'
jobs:
version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.print-version.outputs.version }}
steps:
- name: Clone speexdsp repo
uses: actions/checkout@v4
with:
repository: xiph/speexdsp
- name: Print version
id: print-version
shell: bash
run: |
git fetch --tags
LATEST_TAG=$(git tag | grep -E ^SpeexDSP-[0-9]+.[0-9]+.[0-9]+$ | tail -1)
git checkout "$LATEST_TAG"
echo "version=$LATEST_TAG" >> $GITHUB_OUTPUT
build-windows-x64:
runs-on: windows-latest
needs: version
steps:
- name: Clone speexdsp repo
uses: actions/checkout@v4
with:
repository: xiph/speexdsp
ref: ${{needs.version.outputs.version}}
- name: Clone Natives repo
uses: actions/checkout@v4
with:
path: natives
- name: Setup VS build tools
uses: seanmiddleditch/gha-setup-vsdevenv@v5
with:
host_arch: amd64
arch: amd64
- name: Build speexdsp
shell: pwsh
run: |
cp natives/build/SpeexDSP_CMakeLists.txt CMakeLists.txt
cmake -B build -A x64 -DSPEEX_USE_SSE=ON
cmake --build build --config Release --parallel
- name: Rename native
shell: bash
run: mv build/Release/speexdsp.dll build/Release/speexdsp-win-x64.dll
- name: Publish Artifacts
uses: actions/upload-artifact@v4
with:
name: speexdsp-windows-x64
path: build\Release\speexdsp-win-x64.dll
build-windows-arm64:
runs-on: windows-11-arm
needs: version
steps:
- name: Clone speexdsp repo
uses: actions/checkout@v4
with:
repository: xiph/speexdsp
ref: ${{needs.version.outputs.version}}
- name: Clone Natives repo
uses: actions/checkout@v4
with:
path: natives
- name: Setup VS build tools
uses: seanmiddleditch/gha-setup-vsdevenv@v5
with:
host_arch: arm64
arch: arm64
- name: Build speexdsp
shell: pwsh
run: |
cp natives/build/SpeexDSP_CMakeLists.txt CMakeLists.txt
cmake -B build -A ARM64
cmake --build build --config Release --parallel
- name: Rename native
shell: bash
run: mv build/Release/speexdsp.dll build/Release/speexdsp-win-arm64.dll
- name: Publish Artifacts
uses: actions/upload-artifact@v4
with:
name: speexdsp-windows-arm64
path: build\Release\speexdsp-win-arm64.dll
build-linux-x64:
runs-on: ubuntu-latest
needs: version
steps:
- name: Clone speexdsp repo
uses: actions/checkout@v4
with:
repository: xiph/speexdsp
ref: ${{needs.version.outputs.version}}
- name: Clone Natives repo
uses: actions/checkout@v4
with:
path: natives
- name: Build speexdsp
shell: bash
run: |
cp natives/build/SpeexDSP_CMakeLists.txt CMakeLists.txt
cmake -B build -DSPEEX_USE_SSE=ON
cmake --build build --config Release --parallel
- name: Rename native
shell: bash
run: mv build/libspeexdsp.so build/libspeexdsp-linux-x64.so
- name: Publish Artifacts
uses: actions/upload-artifact@v4
with:
name: speexdsp-linux-x64
path: build/libspeexdsp-linux-x64.so
build-linux-arm64:
runs-on: ubuntu-24.04-arm
needs: version
steps:
- name: Clone speexdsp repo
uses: actions/checkout@v4
with:
repository: xiph/speexdsp
ref: ${{needs.version.outputs.version}}
- name: Clone Natives repo
uses: actions/checkout@v4
with:
path: natives
- name: Build speexdsp
shell: bash
run: |
cp natives/build/SpeexDSP_CMakeLists.txt CMakeLists.txt
cmake -B build
cmake --build build --config Release --parallel
- name: Rename native
shell: bash
run: mv build/libspeexdsp.so build/libspeexdsp-linux-arm64.so
- name: Publish Artifacts
uses: actions/upload-artifact@v4
with:
name: speexdsp-linux-arm64
path: build/libspeexdsp-linux-arm64.so
build-macos-x64:
runs-on: macos-latest
needs: version
steps:
- name: Clone speexdsp repo
uses: actions/checkout@v4
with:
repository: xiph/speexdsp
ref: ${{needs.version.outputs.version}}
- name: Clone Natives repo
uses: actions/checkout@v4
with:
path: natives
- name: Build speexdsp
shell: bash
run: |
cp natives/build/SpeexDSP_CMakeLists.txt CMakeLists.txt
cmake -B build
cmake --build build --config Release --parallel
- name: Rename native
shell: bash
run: mv build/libspeexdsp.dylib build/libspeexdsp-osx-x64.dylib
- name: Publish Artifacts
uses: actions/upload-artifact@v4
with:
name: speexdsp-macos-x64
path: build/libspeexdsp-osx-x64.dylib
build-macos-arm64:
runs-on: macos-latest
needs: version
steps:
- name: Clone speexdsp repo
uses: actions/checkout@v4
with:
repository: xiph/speexdsp
ref: ${{needs.version.outputs.version}}
- name: Clone Natives repo
uses: actions/checkout@v4
with:
path: natives
- name: Build speexdsp
shell: bash
run: |
cp natives/build/SpeexDSP_CMakeLists.txt CMakeLists.txt
cmake -B build
cmake --build build --config Release --parallel
- name: Rename native
shell: bash
run: mv build/libspeexdsp.dylib build/libspeexdsp-osx-arm64.dylib
- name: Publish Artifacts
uses: actions/upload-artifact@v4
with:
name: speexdsp-macos-arm64
path: build/libspeexdsp-osx-arm64.dylib
build-musl-x64:
runs-on: ubuntu-latest
needs: version
steps:
- name: Clone speexdsp repo
uses: actions/checkout@v4
with:
repository: xiph/speexdsp
ref: ${{needs.version.outputs.version}}
- name: Clone Natives repo
uses: actions/checkout@v4
with:
path: natives
- name: Setup Alpine Linux
uses: jirutka/setup-alpine@v1
with:
packages: >
build-base
cmake
git
make
gcc
g++
nasm
linux-headers
- name: Build speexdsp
shell: alpine.sh {0}
run: |
cp natives/build/SpeexDSP_CMakeLists.txt CMakeLists.txt
cmake -B build -DSPEEX_USE_SSE=ON
cmake --build build --config Release --parallel
- name: Rename native
shell: bash
run: mv build/libspeexdsp.so build/libspeexdsp-musl-x64.so
- name: Publish Artifacts
uses: actions/upload-artifact@v4
with:
name: speexdsp-musl-x64
path: build/libspeexdsp-musl-x64.so
build-musl-arm64:
runs-on: ubuntu-latest
needs: version
steps:
- name: Clone speexdsp repo
uses: actions/checkout@v4
with:
repository: xiph/speexdsp
ref: ${{needs.version.outputs.version}}
- name: Clone Natives repo
uses: actions/checkout@v4
with:
path: natives
- name: Setup Alpine Linux
uses: jirutka/setup-alpine@v1
with:
arch: aarch64
packages: >
build-base
cmake
git
make
gcc
g++
nasm
linux-headers
- name: Build speexdsp
shell: alpine.sh {0}
run: |
cp natives/build/SpeexDSP_CMakeLists.txt CMakeLists.txt
cmake -B build
cmake --build build --config Release --parallel
- name: Rename native
shell: bash
run: mv build/libspeexdsp.so build/libspeexdsp-musl-arm64.so
- name: Publish Artifacts
uses: actions/upload-artifact@v4
with:
name: speexdsp-musl-arm64
path: build/libspeexdsp-musl-arm64.so
# publish-nuget:
# runs-on: ubuntu-latest
# needs: [version, build-windows-x64, build-windows-arm64, build-linux-x64, build-linux-arm64, build-macos-x64, build-macos-arm64, build-musl-x64, build-musl-arm64]
# steps:
# - name: Checkout CSPROJ files
# uses: actions/checkout@v4.2.2
# - name: Setup .NET
# uses: actions/setup-dotnet@v4
# with:
# dotnet-version: 9
# - name: Download Artifacts
# uses: actions/download-artifact@v4
# with:
# path: temp
# pattern: koana-*
# merge-multiple: true
# - name: Move Artifacts
# run: |
# mkdir -p lib/koana/win-x64/native
# mkdir -p lib/koana/linux-x64/native
# mkdir -p lib/koana/win-arm64/native
# mkdir -p lib/koana/linux-arm64/native
# mkdir -p lib/koana/osx-x64/native
# mkdir -p lib/koana/osx-arm64/native
# mkdir -p lib/koana/linux-musl-x64/native
# mkdir -p lib/koana/linux-musl-arm64/native
# cp temp/koana-win-x64.dll lib/koana/win-x64/native/koana.dll
# cp temp/libkoana-linux-x64.so lib/koana/linux-x64/native/libkoana.so
# cp temp/koana-win-arm64.dll lib/koana/win-arm64/native/koana.dll
# cp temp/libkoana-linux-arm64.so lib/koana/linux-arm64/native/libkoana.so
# cp temp/libkoana-osx-x64.dylib lib/koana/osx-x64/native/libkoana.dylib
# cp temp/libkoana-osx-arm64.dylib lib/koana/osx-arm64/native/libkoana.dylib
# cp temp/libkoana-musl-x64.so lib/koana/linux-musl-x64/native/libkoana.so
# cp temp/libkoana-musl-arm64.so lib/koana/linux-musl-arm64/native/libkoana.so
# - name: Pack DSharpPlus.Natives.Koana
# shell: bash
# env:
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
# VERSION: ${{ needs.version.outputs.version }}
# run: |
# VERSION="${VERSION:1}"
# dotnet pack ./build/DSharpPlus.Natives.Koana.csproj -c Release -p:Version="$VERSION.${{ github.run_number }}"
# dotnet nuget push "artifacts/**" --skip-duplicate -k "$NUGET_API_KEY" -s https://api.nuget.org/v3/index.json