398 lines
13 KiB
YAML
398 lines
13 KiB
YAML
name: build
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- 'develop'
|
|
- 'master'
|
|
tags:
|
|
- '[0-9]*'
|
|
pull_request:
|
|
branches:
|
|
- '*'
|
|
workflow_dispatch:
|
|
env:
|
|
BUILD_TYPE: Release
|
|
|
|
jobs:
|
|
clang_tidy:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
- name: Set up dependencies
|
|
run: |
|
|
sudo apt-get update && \
|
|
sudo apt-get install \
|
|
clang-tidy \
|
|
libsndfile1-dev
|
|
- name: Clang Tidy
|
|
working-directory: ${{runner.workspace}}
|
|
run: cd "$GITHUB_WORKSPACE" && scripts/run_clang_tidy.sh
|
|
|
|
build_for_linux:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Set install name
|
|
run: |
|
|
echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
|
|
echo "install_name=sfizz-${GITHUB_REF##*/}-linux" >> "$GITHUB_ENV"
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
- name: Set up dependencies
|
|
run: |
|
|
sudo apt-get update && \
|
|
sudo apt-get install \
|
|
ninja-build \
|
|
libjack-jackd2-dev
|
|
- name: Create Build Environment
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}
|
|
run: cmake -E make_directory build
|
|
- name: Configure CMake
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: |
|
|
cmake "$GITHUB_WORKSPACE" -G Ninja \
|
|
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
|
|
-DSFIZZ_JACK=ON \
|
|
-DSFIZZ_TESTS=ON \
|
|
-DSFIZZ_SHARED=OFF \
|
|
-DSFIZZ_STATIC_DEPENDENCIES=OFF \
|
|
-DCMAKE_CXX_STANDARD=17
|
|
- name: Build tests
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config "$BUILD_TYPE" -j 2 --target sfizz_tests
|
|
- name: Run tests
|
|
shell: bash
|
|
run: ${{runner.workspace}}/build/tests/sfizz_tests
|
|
# Reenable with newer cmakes
|
|
# working-directory: ${{runner.workspace}}/build
|
|
# run: ctest -j 2 -C "$BUILD_TYPE" --output-on-failure
|
|
- name: Build all
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config "$BUILD_TYPE" -j 2
|
|
- name: Install
|
|
working-directory: ${{runner.workspace}}/build
|
|
shell: bash
|
|
run: |
|
|
DESTDIR="$(pwd)/$install_name" cmake --build . --config "$BUILD_TYPE" --target install
|
|
tar czvf "$install_name".tar.gz "$install_name"
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: Linux tarball
|
|
path: ${{runner.workspace}}/build/${{env.install_name}}.tar.gz
|
|
|
|
build_with_libsndfile:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- name: Set install name
|
|
run: |
|
|
echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
|
|
echo "install_name=sfizz-${GITHUB_REF##*/}-linux" >> "$GITHUB_ENV"
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
- name: Set up dependencies
|
|
run: |
|
|
sudo apt-get update && \
|
|
sudo apt-get install \
|
|
ninja-build \
|
|
libsndfile1-dev
|
|
- name: Create Build Environment
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}
|
|
run: cmake -E make_directory build
|
|
- name: Configure CMake
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: |
|
|
cmake "$GITHUB_WORKSPACE" -G Ninja \
|
|
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
|
|
-DSFIZZ_JACK=OFF \
|
|
-DSFIZZ_USE_SNDFILE=ON \
|
|
-DSFIZZ_TESTS=ON \
|
|
-DSFIZZ_SHARED=OFF \
|
|
-DSFIZZ_STATIC_DEPENDENCIES=OFF
|
|
- name: Build tests
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config "$BUILD_TYPE" -j 2 --target sfizz_tests
|
|
- name: Run tests
|
|
shell: bash
|
|
run: ${{runner.workspace}}/build/tests/sfizz_tests
|
|
|
|
build_for_macos:
|
|
runs-on: macos-11
|
|
steps:
|
|
- name: Set install name
|
|
run: |
|
|
echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
|
|
echo "install_name=sfizz-${GITHUB_REF##*/}-macos" >> "$GITHUB_ENV"
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
- name: Create Build Environment
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}
|
|
run: cmake -E make_directory build
|
|
- name: Configure CMake
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: |
|
|
cmake "$GITHUB_WORKSPACE" \
|
|
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
|
|
-DSFIZZ_JACK=OFF \
|
|
-DSFIZZ_TESTS=ON \
|
|
-DSFIZZ_SHARED=OFF \
|
|
-DSFIZZ_STATIC_DEPENDENCIES=OFF
|
|
- name: Build tests
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: |
|
|
cmake --build . --config "$BUILD_TYPE" -j 2 --target sfizz_tests
|
|
- name: Run tests
|
|
shell: bash
|
|
run: ${{runner.workspace}}/build/tests/sfizz_tests
|
|
# Reenable with newer cmakes
|
|
# working-directory: ${{runner.workspace}}/build
|
|
# run: ctest -j 2 -C "$BUILD_TYPE" --output-on-failure
|
|
- name: Build
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config "$BUILD_TYPE" -j 2
|
|
- name: Install
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: |
|
|
DESTDIR="$(pwd)/$install_name" cmake --build . --config "$BUILD_TYPE" --target install
|
|
tar czvf "$install_name".tar.gz "$install_name"
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: macOS tarball
|
|
path: |
|
|
${{runner.workspace}}/build/${{env.install_name}}.tar.gz
|
|
|
|
# build_for_mod: MOVED in plugins repository
|
|
|
|
build_for_windows:
|
|
runs-on: windows-2019
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- platform: x86
|
|
pkg_platform: Win32
|
|
release_arch: Win32
|
|
bits: 32
|
|
- platform: x64
|
|
pkg_platform: Win64
|
|
release_arch: x64
|
|
bits: 64
|
|
steps:
|
|
- name: Set install name
|
|
run: |
|
|
echo "install_ref=$(${Env:GITHUB_REF}.split('/')[-1])" >> "${Env:GITHUB_ENV}"
|
|
echo "install_name=sfizz-$(${Env:GITHUB_REF}.split('/')[-1])-win${{matrix.bits}}" >> "${Env:GITHUB_ENV}"
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
- name: Create Build Environment
|
|
working-directory: ${{runner.workspace}}
|
|
run: cmake -E make_directory build
|
|
- name: Configure CMake
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: |
|
|
cmake "${Env:GITHUB_WORKSPACE}" -G"Visual Studio 16 2019" -A"${{matrix.release_arch}}" -DCMAKE_BUILD_TYPE="${Env:BUILD_TYPE}" -DCMAKE_CXX_STANDARD=17 -DSFIZZ_TESTS=ON
|
|
- name: Build tests
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config "${Env:BUILD_TYPE}" -j 2 --target sfizz_tests
|
|
- name: Test
|
|
run: ${{runner.workspace}}/build/tests/Release/sfizz_tests
|
|
- name: Build all
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: cmake --build . --config "${Env:BUILD_TYPE}" -j 2
|
|
|
|
build_for_mingw:
|
|
if: ${{ false }} # DISABLED TEMPORARILY
|
|
runs-on: ubuntu-20.04
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- platform: i686
|
|
pkg_platform: Win32
|
|
bits: 32
|
|
- platform: x86_64
|
|
pkg_platform: Win64
|
|
bits: 64
|
|
container:
|
|
image: archlinux
|
|
steps:
|
|
- name: Set install name
|
|
run: |
|
|
echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
|
|
echo "install_name=sfizz-${GITHUB_REF##*/}-mingw${{matrix.bits}}" >> "$GITHUB_ENV"
|
|
- name: Configure pacman repositories
|
|
shell: bash
|
|
run: |
|
|
cat >>/etc/pacman.conf <<EOF
|
|
[multilib]
|
|
Include = /etc/pacman.d/mirrorlist
|
|
[mingw-w64]
|
|
SigLevel = Optional TrustAll
|
|
Server = https://github.com/sfztools/arch-mingw-w64/releases/download/repo.\$arch/
|
|
EOF
|
|
- name: Set up dependencies
|
|
shell: bash
|
|
run: |
|
|
pacman -Sqyu --noconfirm
|
|
pacman -Sq --needed --noconfirm base-devel git wget ninja mingw-w64-cmake mingw-w64-gcc mingw-w64-pkg-config mingw-w64-libsndfile
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
- name: Fix MinGW headers
|
|
shell: bash
|
|
run: |
|
|
cp -vf "$GITHUB_WORKSPACE"/scripts/mingw_dwrite_3.h \
|
|
/usr/${{matrix.platform}}-w64-mingw32/include/dwrite_3.h
|
|
- name: Create Build Environment
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}
|
|
run: cmake -E make_directory build
|
|
- name: Configure CMake
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: |
|
|
${{matrix.platform}}-w64-mingw32-cmake "$GITHUB_WORKSPACE" -G Ninja \
|
|
-DCMAKE_BUILD_TYPE="$BUILD_TYPE" \
|
|
-DENABLE_LTO=OFF \
|
|
-DSFIZZ_JACK=OFF \
|
|
-DSFIZZ_STATIC_DEPENDENCIES=ON \
|
|
-DCMAKE_CXX_STANDARD=17
|
|
- name: Build
|
|
shell: bash
|
|
working-directory: ${{runner.workspace}}/build
|
|
run: ${{matrix.platform}}-w64-mingw32-cmake --build . --config "$BUILD_TYPE" -j 2
|
|
- name: Install
|
|
working-directory: ${{runner.workspace}}/build
|
|
shell: bash
|
|
run: |
|
|
DESTDIR="$(pwd)/$install_name" ${{matrix.platform}}-w64-mingw32-cmake --build . --config "$BUILD_TYPE" --target install
|
|
tar czvf "$install_name".tar.gz "$install_name"
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{matrix.pkg_platform}} MinGW tarball
|
|
path: ${{runner.workspace}}/build/${{env.install_name}}.tar.gz
|
|
|
|
build_with_makefile:
|
|
runs-on: ubuntu-20.04
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
- name: Build with GNU make
|
|
shell: bash
|
|
run: make -C "$GITHUB_WORKSPACE" -f generic.mk -j2
|
|
- name: Compile a simple program
|
|
shell: bash
|
|
run: |
|
|
cat <<EOF > "$GITHUB_WORKSPACE"/simple.cpp
|
|
#include <sfizz.hpp>
|
|
int main() {
|
|
sfz::Sfizz synth;
|
|
synth.loadSfzString("", "");
|
|
return 0;
|
|
}
|
|
EOF
|
|
cat <<EOF > "$GITHUB_WORKSPACE"/simple.mk
|
|
all: simple
|
|
include generic.mk
|
|
simple.o: simple.cpp
|
|
\$(CXX) \$(CXXFLAGS) \$(SFIZZ_CXX_FLAGS) -c -o \$@ \$<
|
|
simple: simple.o \$(SFIZZ_TARGET)
|
|
\$(CXX) -o \$@ \$^ \$(SFIZZ_LINK_FLAGS) \$(LDFLAGS)
|
|
EOF
|
|
make -C "$GITHUB_WORKSPACE" -f simple.mk
|
|
|
|
archive_source_code:
|
|
runs-on: ubuntu-20.04
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
steps:
|
|
- name: Set install name
|
|
run: |
|
|
echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
|
|
echo "install_name=sfizz-${GITHUB_REF##*/}" >> "$GITHUB_ENV"
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: recursive
|
|
- name: Set up dependencies
|
|
run: |
|
|
sudo apt-get update && \
|
|
sudo apt-get install \
|
|
python3-pip
|
|
sudo pip install git-archive-all
|
|
- name: Archive source code
|
|
shell: bash
|
|
run: |
|
|
cd "$GITHUB_WORKSPACE" && \
|
|
git-archive-all --prefix="${install_name}/" -9 "${{runner.workspace}}/${install_name}.tar.gz"
|
|
- uses: actions/upload-artifact@v3
|
|
with:
|
|
name: Source code tarball
|
|
path: ${{runner.workspace}}/${{env.install_name}}.tar.gz
|
|
|
|
deploy:
|
|
runs-on: ubuntu-20.04
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
needs:
|
|
- build_for_linux
|
|
# - build_for_mingw
|
|
# - build_for_windows
|
|
- archive_source_code
|
|
steps:
|
|
- name: Set install name
|
|
run: |
|
|
echo "install_ref=${GITHUB_REF##*/}" >> "$GITHUB_ENV"
|
|
- if: ${{ false }} # DISABLED: Use distro packages
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: Linux tarball
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: macOS tarball
|
|
- if: ${{ false }} # DISABLED: MinGW 32 build temporarily disabled
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: Win32 MinGW tarball
|
|
- if: ${{ false }} # DISABLED: MinGW 64 build temporarily disabled
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: Win64 MinGW tarball
|
|
- if: ${{ false }} # DISABLED: Innosetup 32 in plugins repo
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: Win32 installer
|
|
- if: ${{ false }} # DISABLED: Innosetup 64 in plugins repo
|
|
uses: actions/download-artifact@v3
|
|
with:
|
|
name: Win64 installer
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: Source code tarball
|
|
- name: Display file information
|
|
shell: bash
|
|
run: ls -lR
|
|
- uses: softprops/action-gh-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
|
with:
|
|
tag_name: ${{env.install_ref}}
|
|
name: Release ${{env.install_ref}}
|
|
draft: false
|
|
prerelease: false
|
|
files: |
|
|
sfizz-${{env.install_ref}}-*
|
|
sfizz-${{env.install_ref}}.*
|