CI: Keep changes in line with library
- bash and working-directory defaults - use Abseil system library also on Linux when not in tag/release
This commit is contained in:
parent
299fe94bef
commit
144f486ee3
1 changed files with 65 additions and 55 deletions
120
.github/workflows/build.yml
vendored
120
.github/workflows/build.yml
vendored
|
|
@ -16,6 +16,9 @@ on:
|
||||||
env:
|
env:
|
||||||
build_type: Release
|
build_type: Release
|
||||||
|
|
||||||
|
# defaults:
|
||||||
|
# shell: pwsh on windows, bash all the rest
|
||||||
|
# working-directory: ${{ github.workspace }}
|
||||||
jobs:
|
jobs:
|
||||||
clang_tidy:
|
clang_tidy:
|
||||||
# if: ${{ false }}
|
# if: ${{ false }}
|
||||||
|
|
@ -29,12 +32,12 @@ jobs:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: sudo apt-get update && sudo apt-get install clang-tidy
|
run: sudo apt-get update && sudo apt-get install clang-tidy
|
||||||
- name: Run
|
- name: Run
|
||||||
run: cd "$GITHUB_WORKSPACE" && scripts/run_clang_tidy.sh
|
run: ./scripts/run_clang_tidy.sh
|
||||||
|
|
||||||
build_for_linux:
|
build_for_linux:
|
||||||
# if: ${{ false }}
|
# if: ${{ false }}
|
||||||
name: Linux Ubuntu 20.04
|
name: Linux Ubuntu 22.04
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-22.04 # abseil (libabsl) is not available in 20.04 repository
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
@ -57,14 +60,18 @@ jobs:
|
||||||
ninja-build
|
ninja-build
|
||||||
)
|
)
|
||||||
sudo apt-get update && sudo apt-get install "${packages[@]}"
|
sudo apt-get update && sudo apt-get install "${packages[@]}"
|
||||||
|
- name: Install abseil
|
||||||
|
if: ${{ github.ref_type == 'branch' }}
|
||||||
|
run: |
|
||||||
|
sudo apt-get install \
|
||||||
|
libabsl-dev \
|
||||||
|
libabsl20210324
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ runner.workspace }}
|
|
||||||
run: |
|
run: |
|
||||||
options=(
|
options=(
|
||||||
-G Ninja
|
-G Ninja
|
||||||
-B build
|
-B build
|
||||||
-S "$GITHUB_WORKSPACE"
|
-S .
|
||||||
-D CMAKE_BUILD_TYPE=${{ env.build_type }}
|
-D CMAKE_BUILD_TYPE=${{ env.build_type }}
|
||||||
-D CMAKE_CXX_STANDARD=17
|
-D CMAKE_CXX_STANDARD=17
|
||||||
-D SFIZZ_JACK=OFF
|
-D SFIZZ_JACK=OFF
|
||||||
|
|
@ -75,11 +82,24 @@ jobs:
|
||||||
-D PLUGIN_PUREDATA=ON
|
-D PLUGIN_PUREDATA=ON
|
||||||
-D PLUGIN_VST3=ON
|
-D PLUGIN_VST3=ON
|
||||||
)
|
)
|
||||||
|
if [[ ${{ github.ref_type }} == 'branch' ]]; then
|
||||||
|
options=(
|
||||||
|
${options[@]}
|
||||||
|
-D SFIZZ_USE_SYSTEM_ABSEIL=ON
|
||||||
|
)
|
||||||
|
fi
|
||||||
cmake "${options[@]}"
|
cmake "${options[@]}"
|
||||||
|
echo "-- github.workspace: ${{ github.workspace }}"
|
||||||
|
echo "-- runner.workspace: ${{ runner.workspace }}"
|
||||||
- name: Build
|
- name: Build
|
||||||
shell: bash
|
run: |
|
||||||
working-directory: ${{ runner.workspace }}
|
options=(
|
||||||
run: cmake --build build --config ${{ env.build_type }} --verbose -j 2
|
--build build
|
||||||
|
--config ${{ env.build_type }}
|
||||||
|
--parallel 2
|
||||||
|
--verbose
|
||||||
|
)
|
||||||
|
cmake "${options[@]}"
|
||||||
# No custom Linux packages, build from sources or provided in distro
|
# No custom Linux packages, build from sources or provided in distro
|
||||||
|
|
||||||
build_for_macos:
|
build_for_macos:
|
||||||
|
|
@ -97,12 +117,10 @@ jobs:
|
||||||
if: ${{ github.ref_type == 'branch' }}
|
if: ${{ github.ref_type == 'branch' }}
|
||||||
run: brew install abseil
|
run: brew install abseil
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ runner.workspace }}
|
|
||||||
run: |
|
run: |
|
||||||
options=(
|
options=(
|
||||||
-B build
|
-B build
|
||||||
-S "$GITHUB_WORKSPACE"
|
-S .
|
||||||
-D CMAKE_BUILD_TYPE=${{ env.build_type }}
|
-D CMAKE_BUILD_TYPE=${{ env.build_type }}
|
||||||
-D CMAKE_CXX_STANDARD=17
|
-D CMAKE_CXX_STANDARD=17
|
||||||
-D SFIZZ_SHARED=OFF
|
-D SFIZZ_SHARED=OFF
|
||||||
|
|
@ -118,37 +136,37 @@ jobs:
|
||||||
)
|
)
|
||||||
fi
|
fi
|
||||||
cmake "${options[@]}"
|
cmake "${options[@]}"
|
||||||
|
echo "-- runner.workspace: ${{ runner.workspace }}"
|
||||||
|
echo "-- github.workspace: ${{ github.workspace }}"
|
||||||
- name: Build
|
- name: Build
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ runner.workspace }}
|
|
||||||
run: |
|
run: |
|
||||||
cmake \
|
options=(
|
||||||
--build build \
|
--build build
|
||||||
--config ${{ env.build_type }} \
|
--config ${{ env.build_type }}
|
||||||
--verbose \
|
--parallel 2
|
||||||
-j 2
|
--verbose
|
||||||
|
)
|
||||||
|
cmake "${options[@]}"
|
||||||
- name: Package bundles
|
- name: Package bundles
|
||||||
if: ${{ github.ref_type == 'tag' }}
|
if: ${{ github.ref_type == 'tag' }}
|
||||||
shell: bash
|
run: ./scripts/package-osx-bundles.sh
|
||||||
working-directory: ${{ runner.workspace }}
|
|
||||||
run: $GITHUB_WORKSPACE/scripts/package-osx-bundles.sh
|
|
||||||
- name: Create installer
|
- name: Create installer
|
||||||
if: ${{ github.ref_type == 'tag' }}
|
if: ${{ github.ref_type == 'tag' }}
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ runner.workspace }}/build
|
|
||||||
run: |
|
run: |
|
||||||
productbuild \
|
options=(
|
||||||
--distribution $GITHUB_WORKSPACE/scripts/plugin.pkg/package.xml \
|
--distribution ${{ github.workspace }}/scripts/plugin.pkg/package.xml
|
||||||
--identifier "sfz.tools.sfizz" \
|
--identifier "sfz.tools.sfizz"
|
||||||
--package-path "${{ runner.workspace }}/build" \
|
--package-path "${{ github.workspace }}"
|
||||||
--version 0 \
|
--version 0
|
||||||
${{ env.install_name }}.pkg
|
${{ env.install_name }}.pkg
|
||||||
|
)
|
||||||
|
productbuild "${options[@]}"
|
||||||
- name: Upload
|
- name: Upload
|
||||||
if: ${{ github.ref_type == 'tag' }}
|
if: ${{ github.ref_type == 'tag' }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: macOS package
|
name: macOS package
|
||||||
path: ${{ runner.workspace }}/build/${{ env.install_name }}.pkg
|
path: "${{ github.workspace }}/${{ env.install_name }}.pkg"
|
||||||
|
|
||||||
build_for_windows:
|
build_for_windows:
|
||||||
# if: ${{ false }}
|
# if: ${{ false }}
|
||||||
|
|
@ -173,21 +191,24 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
working-directory: ${{ runner.workspace }}
|
|
||||||
run: |
|
run: |
|
||||||
cmake `
|
cmake `
|
||||||
-G "Visual Studio 16 2019" `
|
-G "Visual Studio 16 2019" `
|
||||||
-A "${{ matrix.release_arch }}" `
|
-A "${{ matrix.release_arch }}" `
|
||||||
-B build `
|
-B build `
|
||||||
-S "${Env:GITHUB_WORKSPACE}" `
|
-S . `
|
||||||
-D CMAKE_BUILD_TYPE=${{ env.build_type }} `
|
-D CMAKE_BUILD_TYPE=${{ env.build_type }} `
|
||||||
-D CMAKE_CXX_STANDARD=17 `
|
-D CMAKE_CXX_STANDARD=17 `
|
||||||
-D PLUGIN_LV2=ON `
|
-D PLUGIN_LV2=ON `
|
||||||
-D PLUGIN_PUREDATA=ON `
|
-D PLUGIN_PUREDATA=ON `
|
||||||
-D PLUGIN_VST3=ON `
|
-D PLUGIN_VST3=ON `
|
||||||
- name: Build
|
- name: Build
|
||||||
working-directory: ${{ runner.workspace }}
|
run: |
|
||||||
run: cmake --build build --config ${{ env.build_type }} --verbose -j 2
|
cmake `
|
||||||
|
--build build `
|
||||||
|
--config ${{ env.build_type }} `
|
||||||
|
--parallel 2 `
|
||||||
|
--verbose `
|
||||||
- name: Install pluginval
|
- name: Install pluginval
|
||||||
if: ${{ matrix.platform == 'x64' }}
|
if: ${{ matrix.platform == 'x64' }}
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -202,18 +223,18 @@ jobs:
|
||||||
pluginval\pluginval --version
|
pluginval\pluginval --version
|
||||||
- name: Validate VST3
|
- name: Validate VST3
|
||||||
if: ${{ matrix.platform == 'x64' }}
|
if: ${{ matrix.platform == 'x64' }}
|
||||||
working-directory: ${{ runner.workspace }}/build
|
working-directory: ${{ github.workspace }}/build
|
||||||
run: pluginval --validate-in-process --validate sfizz.vst3
|
run: pluginval --validate-in-process --validate sfizz.vst3
|
||||||
- name: Create installer
|
- name: Create installer
|
||||||
if: ${{ github.ref_type == 'tag' }}
|
if: ${{ github.ref_type == 'tag' }}
|
||||||
working-directory: ${{ runner.workspace }}/build
|
working-directory: ${{ github.workspace }}/build
|
||||||
run: iscc /O"." /F"${{ env.install_name }}" /dARCH="${{ matrix.platform }}" innosetup.iss
|
run: iscc /O"." /F"${{ env.install_name }}" /dARCH="${{ matrix.platform }}" innosetup.iss
|
||||||
- name: Upload
|
- name: Upload
|
||||||
if: ${{ github.ref_type == 'tag' }}
|
if: ${{ github.ref_type == 'tag' }}
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.pkg_platform }} installer
|
name: ${{ matrix.pkg_platform }} installer
|
||||||
path: "${{ runner.workspace }}/build/${{ env.install_name }}.exe"
|
path: "${{ github.workspace }}/build/${{ env.install_name }}.exe"
|
||||||
|
|
||||||
archive_source_code:
|
archive_source_code:
|
||||||
# if: startsWith(github.ref, 'refs/tags/')
|
# if: startsWith(github.ref, 'refs/tags/')
|
||||||
|
|
@ -232,16 +253,15 @@ jobs:
|
||||||
sudo apt-get update && sudo apt-get install python3-pip
|
sudo apt-get update && sudo apt-get install python3-pip
|
||||||
sudo pip install git-archive-all
|
sudo pip install git-archive-all
|
||||||
- name: Archive source code
|
- name: Archive source code
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
cd "$GITHUB_WORKSPACE" && git-archive-all \
|
git-archive-all \
|
||||||
--prefix="${{ env.install_name }}/" \
|
--prefix="${{ env.install_name }}/" \
|
||||||
-9 "${{ runner.workspace }}/${{ env.install_name }}.tar.gz"
|
-9 "${{ github.workspace }}/${{ env.install_name }}.tar.gz"
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: Source code tarball
|
name: Source code tarball
|
||||||
path: "${{ runner.workspace }}/${{ env.install_name }}.tar.gz"
|
path: "${{ github.workspace }}/${{ env.install_name }}.tar.gz"
|
||||||
|
|
||||||
build_for_mingw:
|
build_for_mingw:
|
||||||
if: ${{ false }} # DISABLED TEMPORARILY
|
if: ${{ false }} # DISABLED TEMPORARILY
|
||||||
|
|
@ -262,7 +282,6 @@ jobs:
|
||||||
install_name: sfizz-${{ github.ref_name }}-mingw${{ matrix.bits }}
|
install_name: sfizz-${{ github.ref_name }}-mingw${{ matrix.bits }}
|
||||||
steps:
|
steps:
|
||||||
- name: Configure pacman repositories
|
- name: Configure pacman repositories
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
cat >>/etc/pacman.conf <<EOF
|
cat >>/etc/pacman.conf <<EOF
|
||||||
[multilib]
|
[multilib]
|
||||||
|
|
@ -272,7 +291,6 @@ jobs:
|
||||||
Server = https://github.com/jpcima/arch-mingw-w64/releases/download/repo.\$arch/
|
Server = https://github.com/jpcima/arch-mingw-w64/releases/download/repo.\$arch/
|
||||||
EOF
|
EOF
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
packages=(
|
packages=(
|
||||||
base-devel git ninja wget
|
base-devel git ninja wget
|
||||||
|
|
@ -284,36 +302,29 @@ jobs:
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
- name: Fix MinGW headers
|
- name: Fix MinGW headers
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
cp -vf "$GITHUB_WORKSPACE"/scripts/mingw_dwrite_3.h \
|
cp -vf "${{ github.workspace }}"/scripts/mingw_dwrite_3.h \
|
||||||
/usr/${{ matrix.platform }}-w64-mingw32/include/dwrite_3.h
|
/usr/${{ matrix.platform }}-w64-mingw32/include/dwrite_3.h
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ runner.workspace }}
|
|
||||||
run: |
|
run: |
|
||||||
options=(
|
options=(
|
||||||
-G Ninja
|
-G Ninja
|
||||||
-B build
|
-B build
|
||||||
-S "$GITHUB_WORKSPACE"
|
-S .
|
||||||
-D CMAKE_BUILD_TYPE=${{ env.build_type }}
|
-D CMAKE_BUILD_TYPE=${{ env.build_type }}
|
||||||
-D CMAKE_CXX_STANDARD=17
|
-D CMAKE_CXX_STANDARD=17
|
||||||
-D ENABLE_LTO=OFF
|
-D ENABLE_LTO=OFF
|
||||||
-D SFIZZ_STATIC_DEPENDENCIES=ON
|
-D SFIZZ_SNDFILE_STATIC=ON
|
||||||
-D SFIZZ_JACK=OFF
|
-D SFIZZ_JACK=OFF
|
||||||
-D PLUGIN_PUREDATA=ON
|
-D PLUGIN_PUREDATA=ON
|
||||||
-D PLUGIN_VST3=ON
|
-D PLUGIN_VST3=ON
|
||||||
)
|
)
|
||||||
${{ matrix.platform }}-w64-mingw32-cmake "${options[@]}"
|
${{ matrix.platform }}-w64-mingw32-cmake "${options[@]}"
|
||||||
- name: Build
|
- name: Build
|
||||||
shell: bash
|
|
||||||
working-directory: ${{ runner.workspace }}
|
|
||||||
run: ${{ matrix.platform }}-w64-mingw32-cmake \
|
run: ${{ matrix.platform }}-w64-mingw32-cmake \
|
||||||
--build build --config ${{ env.build_type }} --verbose -j 2
|
--build build --config ${{ env.build_type }} --verbose -j 2
|
||||||
- name: Install
|
- name: Install
|
||||||
if: ${{ github.ref_type == 'tag' }}
|
if: ${{ github.ref_type == 'tag' }}
|
||||||
working-directory: ${{ runner.workspace }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
DESTDIR="$(pwd)/${{ env.install_name }}" \
|
DESTDIR="$(pwd)/${{ env.install_name }}" \
|
||||||
${{ matrix.platform }}-w64-mingw32-cmake \
|
${{ matrix.platform }}-w64-mingw32-cmake \
|
||||||
|
|
@ -324,7 +335,7 @@ jobs:
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ matrix.pkg_platform }} MinGW tarball
|
name: ${{ matrix.pkg_platform }} MinGW tarball
|
||||||
path: "${{ runner.workspace }}/${{ env.install_name }}.tar.gz"
|
path: "${{ github.workspace }}/${{ env.install_name }}.tar.gz"
|
||||||
|
|
||||||
build_for_mod:
|
build_for_mod:
|
||||||
if: ${{ false }} # DISABLED: Old image which doesn't work with CMake > 3.5
|
if: ${{ false }} # DISABLED: Old image which doesn't work with CMake > 3.5
|
||||||
|
|
@ -424,7 +435,6 @@ jobs:
|
||||||
name: MOD devices tarball
|
name: MOD devices tarball
|
||||||
|
|
||||||
- name: Display file information
|
- name: Display file information
|
||||||
shell: bash
|
|
||||||
run: ls -lR
|
run: ls -lR
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue