Skip to content

Fix RC file compilation #20

Fix RC file compilation

Fix RC file compilation #20

Workflow file for this run

name: CI
on:
push:
paths-ignore:
- 'examples/**'
- 'HelpSource/**'
- 'sounds/**'
- '*.md'
pull_request:
paths-ignore:
- 'examples/**'
- 'HelpSource/**'
- 'sounds/**'
- '*.md'
schedule:
- cron: '0 0 * * 0' # run weekly to refresh cache
jobs:
lint:
runs-on: ubuntu-20.04
outputs:
sc-version: ${{ steps.set-version.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: lint class library
run: |
sudo npm install -g lintspaces-cli
lintspaces -e .editorconfig SCClassLibrary/**/*.sc || true # ignore failure
- name: lint cpp files
run: |
sudo apt-get install -y clang-format-8
echo "Running tools/clang-format.py lintall"
tools/clang-format.py -c clang-format-8 -d clang-format-diff-8 lintall || exit 1
echo "Lint successful"
- name: set version string for artifacts
id: set-version
run: |
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
FULL_TAG=${GITHUB_REF#refs/tags/}
SC_VERSION=${FULL_TAG##Version-}
else
SC_VERSION=$GITHUB_SHA
fi
echo "version=$SC_VERSION" >> $GITHUB_OUTPUT
Linux:
needs: lint
runs-on: ubuntu-${{ matrix.os-version }}
strategy:
fail-fast: false
matrix:
include:
- job-name: 'focal gcc7'
os-version: '20.04'
c-compiler: 'gcc-7'
cxx-compiler: 'g++-7'
use-syslibs: false
shared-libscsynth: false
- job-name: 'focal gcc9 shared libscsynth'
os-version: '20.04'
c-compiler: 'gcc-9'
cxx-compiler: 'g++-9'
use-syslibs: false
shared-libscsynth: true
- job-name: 'jammy gcc10 use system libraries'
os-version: '22.04'
c-compiler: 'gcc-10'
cxx-compiler: 'g++-10'
use-syslibs: true
shared-libscsynth: false
- job-name: 'jammy gcc11'
os-version: '22.04'
c-compiler: 'gcc-11'
cxx-compiler: 'g++-11'
use-syslibs: false
shared-libscsynth: false
- job-name: 'jammy gcc12'
os-version: '22.04'
c-compiler: 'gcc-12'
cxx-compiler: 'g++-12'
use-syslibs: false
shared-libscsynth: false
artifact-suffix: 'linux-jammy-gcc12' # set if needed - will trigger artifact upload
- job-name: 'focal clang7'
os-version: '20.04'
c-compiler: 'clang-7'
cxx-compiler: 'clang++-7'
use-syslibs: false
shared-libscsynth: false
- job-name: 'focal clang11'
os-version: '20.04'
c-compiler: 'clang-11'
cxx-compiler: 'clang++-11'
use-syslibs: false
shared-libscsynth: false
- job-name: 'focal clang12'
os-version: '20.04'
c-compiler: 'clang-12'
cxx-compiler: 'clang++-12'
use-syslibs: false
shared-libscsynth: false
- job-name: 'jammy clang13'
os-version: '22.04'
c-compiler: 'clang-13'
cxx-compiler: 'clang++-13'
use-syslibs: false
shared-libscsynth: false
- job-name: 'jammy clang14'
os-version: '22.04'
c-compiler: 'clang-14'
cxx-compiler: 'clang++-14'
use-syslibs: false
shared-libscsynth: false
name: Linux ${{ matrix.job-name }}
env:
BUILD_PATH: ${{ github.workspace }}/build
INSTALL_PATH: ${{ github.workspace }}/build/Install
USE_SYSLIBS: ${{ matrix.use-syslibs }}
SHARED_LIBSCSYNTH: ${{ matrix.shared-libscsynth }}
CC: ${{ matrix.c-compiler }}
CXX: ${{ matrix.cxx-compiler }}
ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}'
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: prepare daily timestamp for cache
id: current-date
run: echo "stamp=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: cache ccache
uses: actions/cache@v3
with:
path: |
~/.ccache
~/.cache/ccache
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.c-compiler }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-${{ steps.current-date.outputs.stamp }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.c-compiler }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install --yes build-essential cmake pkg-config libjack-jackd2-dev libsndfile1-dev libasound2-dev libavahi-client-dev libreadline6-dev libfftw3-dev libicu-dev libxt-dev libudev-dev emacs ccache
# install appropriate clang/gcc compilers
if [[ "$CC" =~ clang-[1-9] ]]; then
sudo apt-get install -y $CC # package names are clang-X
sudo apt-get install -y libc++-${CC##clang-}-dev libc++abi-${CC##clang-}-dev # install additional libraries; package names are libc++-X-dev and libc++abi-X-dev
elif [[ "$CC" =~ gcc-[1-9] ]]; then
sudo apt-get install -y $CXX # package names are g++-X
fi
- name: install system libraries
if: env.USE_SYSLIBS == 'true'
run: sudo apt-get install --yes libboost-thread-dev libboost-system-dev libboost-filesystem-dev libboost-regex-dev libboost-test-dev libboost-program-options-dev libyaml-cpp-dev
- name: install qt from apt
run: sudo apt-get install qtbase5-dev qt5-qmake qttools5-dev qttools5-dev-tools qtdeclarative5-dev libqt5svg5-dev libqt5websockets5-dev qtwebengine5-dev
- name: configure
run: |
mkdir $BUILD_PATH && cd $BUILD_PATH
EXTRA_CMAKE_FLAGS=
if $USE_SYSLIBS; then EXTRA_CMAKE_FLAGS="-DSYSTEM_BOOST=ON -DSYSTEM_YAMLCPP=ON"; fi
if $SHARED_LIBSCSYNTH; then EXTRA_CMAKE_FLAGS="-DLIBSCSYNTH=ON $EXTRA_CMAKE_FLAGS"; fi
cmake $EXTRA_CMAKE_FLAGS -DSC_EL=ON -DSC_VIM=ON -DSC_ED=ON -DSC_QT=ON -DSC_IDE=ON -DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PATH -DCMAKE_BUILD_TYPE=Release .. # --debug-output
- name: build
run: |
cd $BUILD_PATH
make install -j2
- name: create archive
if: matrix.artifact-suffix
run: cd $INSTALL_PATH && zip --symlinks -r $ARTIFACT_FILE.zip .
- name: upload artifacts
uses: actions/upload-artifact@v3
if: matrix.artifact-suffix
with:
name: ${{ env.ARTIFACT_FILE }}
path: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }}.zip
macOS:
needs: lint
runs-on: macos-${{ matrix.os-version }}
strategy:
fail-fast: false
matrix:
include:
- job-name: 'universal'
os-version: '12'
xcode-version: '13.4.1'
deployment-target: '10.14'
cmake-architectures: 'x86_64;arm64'
use-syslibs: false
shared-libscsynth: false
system-portaudio: true
build-libsndfile: false
build-readline: false
build-fftw: false
artifact-suffix: 'macOS-universal'
verify-app: true
- job-name: 'x64 legacy'
os-version: '11'
xcode-version: '12.4'
qt-version: '5.9.9' # will use qt from aqtinstall
deployment-target: '10.11'
cmake-architectures: x86_64
use-syslibs: false
shared-libscsynth: false
build-libsndfile: true
system-portaudio: false
vcpkg-triplet: x64-osx-release-supercollider # required for build-libsndfile
artifact-suffix: 'macOS-x64-legacy' # set if needed - will trigger artifact upload
- job-name: 'x64 use system libraries'
os-version: '12'
xcode-version: '13.4.1'
deployment-target: '10.14'
cmake-architectures: x86_64
use-syslibs: true
shared-libscsynth: false
verify-app: true
- job-name: 'x64 shared libscsynth'
os-version: '12'
xcode-version: '13.4.1'
deployment-target: '10.14'
cmake-architectures: x86_64
use-syslibs: false
shared-libscsynth: true
verify-app: true
name: macOS ${{ matrix.job-name }}
env:
BUILD_PATH: ${{ github.workspace }}/build
INSTALL_PATH: ${{ github.workspace }}/build/Install
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
USE_SYSLIBS: ${{ matrix.use-syslibs }}
SHARED_LIBSCSYNTH: ${{ matrix.shared-libscsynth }}
ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}.dmg'
DEVELOPER_DIR: '/Applications/Xcode_${{ matrix.xcode-version }}.app/Contents/Developer'
MACOSX_DEPLOYMENT_TARGET: '${{ matrix.deployment-target }}'
CMAKE_OSX_ARCHITECTURES: '${{ matrix.cmake-architectures }}'
BREW_UNIVERSAL_WORKDIR: ${{ github.workspace }}/brew-universal
SKIP_SIGNING: 1 # for brew-install-universal
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: prepare timestamp for cache
id: current-date
run: |
echo "stamp=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "week=$(date '+%U')" >> $GITHUB_OUTPUT
- name: cache ccache
uses: actions/cache@v3
with:
path: ~/Library/Caches/ccache
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-${{ matrix.qt-version }}-${{ matrix.cmake-architectures }}-${{ steps.current-date.outputs.stamp }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-${{ matrix.qt-version }}-${{ matrix.cmake-architectures }}-
- name: cleanup homebrew downloads # always remove existing downloads first, as we bring back relevant downloads from cache
run: rm -rf $(brew --cache)
- name: cache homebrew downloads
uses: actions/cache@v3
id: cache-homebrew
with:
path: ~/Library/Caches/Homebrew/downloads
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-${{ matrix.qt-version }}-${{ matrix.cmake-architectures }}-homebrew-${{ steps.current-date.outputs.week }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-${{ matrix.qt-version }}-${{ matrix.cmake-architectures }}-homebrew-
- name: cache homebrew universal packages
uses: actions/cache@v3
if: matrix.cmake-architectures != 'x86_64' && (matrix.build-libsndfile != true || matrix.build-readline != true || matrix.build-fftw != true)
with:
path: ${{ env.BREW_UNIVERSAL_WORKDIR }}
key: ${{ runner.os }}-v1-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.deployment-target }}-brew_universal-${{ steps.current-date.outputs.week }}
restore-keys: ${{ runner.os }}-v1-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.deployment-target }}-brew_universal-
- name: cache vcpkg
if: matrix.vcpkg-triplet
uses: actions/cache@v3
with:
path: ~/.cache/vcpkg/archives
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.deployment-target }}-${{ matrix.vcpkg-triplet }}-${{ steps.current-date.outputs.stamp }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.deployment-target }}-${{ matrix.vcpkg-triplet }}-
- name: install dependencies
run: |
brew install ccache
# add ccamke to PATH - see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions
echo "/usr/local/opt/ccache/libexec" >> $GITHUB_PATH
if [[ "${{ matrix.system-portaudio }}" != "false" ]]; then brew install portaudio; fi
if [[ "${{ matrix.build-fftw }}" != "true" ]]; then brew install fftw; fi
# install universal versions of homebrew libraries
if [[ "${{ matrix.cmake-architectures }}" != "x86_64" ]]; then
echo "Downloading script for creating universal binaries from homebrew packages"
curl -O -J -L https://gist.githubusercontent.com/dyfer/6c83905d4593750105897e51e87ec345/raw/18f34a3def7dff91f34b30c17a4ccd50b4df264d/brew-install-universal.sh
chmod +x brew-install-universal.sh
if [[ "${{ matrix.build-libsndfile }}" != "true" ]]; then ./brew-install-universal.sh libsndfile; fi
if [[ "${{ matrix.build-readline }}" != "true" ]]; then ./brew-install-universal.sh readline; fi
if [[ "${{ matrix.build-fftw }}" != "true" ]]; then ./brew-install-universal.sh fftw; fi
if [[ "${{ matrix.system-portaudio }}" != "false" ]]; then ./brew-install-universal.sh portaudio; fi
fi
- name: install libsndfile # to make it compatible with older OSes (lower deployment target)
if: matrix.build-libsndfile == true && matrix.vcpkg-triplet
run: |
brew uninstall --ignore-dependencies libsndfile libvorbis libogg flac opus
vcpkg install libsndfile --triplet="${{ matrix.vcpkg-triplet }}" --overlay-triplets="$GITHUB_WORKSPACE/vcpkg/triplets"
- name: install readline # to allow cross-compiling
if: matrix.build-readline == true && matrix.vcpkg-triplet
run: |
brew uninstall --ignore-dependencies readline
vcpkg install readline --triplet="${{ matrix.vcpkg-triplet }}" --overlay-triplets="$GITHUB_WORKSPACE/vcpkg/triplets"
# vcpkg readline currently fails on arm64 (ncurses dependency)
# see https://github.com/microsoft/vcpkg/issues/22654
- name: install fftw # to allow cross-compiling
if: matrix.build-fftw == true && matrix.vcpkg-triplet
run: |
vcpkg install fftw3 --triplet="${{ matrix.vcpkg-triplet }}" --overlay-triplets="$GITHUB_WORKSPACE/vcpkg/triplets"
- name: install system libraries
if: env.USE_SYSLIBS == 'true'
run: brew install yaml-cpp boost
- name: install qt from homebrew
if: matrix.cmake-architectures == 'x86_64' && !matrix.qt-version
run: brew install qt5
- name: install qt universal binary from homebrew
if: matrix.cmake-architectures != 'x86_64' && !matrix.qt-version
run: ./brew-install-universal.sh qt5
- name: install qt using aqtinstall
uses: jurplel/install-qt-action@v3
if: matrix.qt-version
env:
DEVELOPER_DIR: '' # remove developer dir which causes installation to fail
with:
modules: 'qtwebengine'
version: ${{ matrix.qt-version }}
cache: true
cache-key-prefix: ${{ runner.os }}-v1-${{ matrix.os-version }}-${{ matrix.xcode-version }}-${{ matrix.use-syslibs }}-${{ matrix.shared-libscsynth }}-qt${{ matrix.qt-version }}
- name: configure
run: |
mkdir $BUILD_PATH && cd $BUILD_PATH
EXTRA_CMAKE_FLAGS=
if $USE_SYSLIBS; then EXTRA_CMAKE_FLAGS="-DSYSTEM_BOOST=ON -DSYSTEM_YAMLCPP=ON $EXTRA_CMAKE_FLAGS"; fi
if $SHARED_LIBSCSYNTH; then EXTRA_CMAKE_FLAGS="-DLIBSCSYNTH=ON $EXTRA_CMAKE_FLAGS"; fi
if [[ -z "${{ matrix.qt-version }}" ]]; then EXTRA_CMAKE_FLAGS="-DCMAKE_PREFIX_PATH=`brew --prefix qt5` $EXTRA_CMAKE_FLAGS"; fi
if [[ "${{ matrix.verify-app }}" == "true" ]]; then EXTRA_CMAKE_FLAGS="-DSC_VERIFY_APP=ON $EXTRA_CMAKE_FLAGS"; fi
if [[ "${{ matrix.system-portaudio }}" == "false" ]]; then EXTRA_CMAKE_FLAGS="-DSYSTEM_PORTAUDIO=OFF $EXTRA_CMAKE_FLAGS"; fi
if [[ -n "${{ matrix.vcpkg-triplet }}" ]]; then
export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
EXTRA_CMAKE_FLAGS="-DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg-triplet }} -DCMAKE_BUILD_TYPE=Release $EXTRA_CMAKE_FLAGS"
fi
echo "EXTRA_CMAKE_FLAGS:" $EXTRA_CMAKE_FLAGS
cmake -G"Xcode" -DRULE_LAUNCH_COMPILE=ccache -DSUPERNOVA=ON $EXTRA_CMAKE_FLAGS ..
- name: build
run: cmake --build $BUILD_PATH --config Release --target install
- name: create archive
if: matrix.artifact-suffix
run: |
cd $INSTALL_PATH
ln -s /Applications SuperCollider/Applications
mkdir -p SuperCollider/.background
cp ../../package/background_2_arrow.png SuperCollider/.background/background_2_arrow.png
cp ../../package/ds_store SuperCollider/.DS_Store
# the following assumes that we end up with the build in the folder SuperCollider
# hdiutil sometimes fails with "create failed - Resource busy"
# when that happens, we run it again
hdiutil create -srcfolder SuperCollider -format UDZO -fs HFS+ $ARTIFACT_FILE || hdiutil create -srcfolder SuperCollider -format UDZO -fs HFS+ $ARTIFACT_FILE
- name: upload artifacts
uses: actions/upload-artifact@v3
if: matrix.artifact-suffix
with:
name: ${{ env.ARTIFACT_FILE }}
path: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }}
Windows:
needs: lint
runs-on: windows-${{ matrix.os-version }}
strategy:
fail-fast: false
matrix:
include:
- job-name: '32-bit'
fftw-arch: 'x86'
cmake-arch: 'Win32'
os-version: '2019'
qt-version: '5.15.2'
qt-arch: 'win32_msvc2019'
fftw-url: 'ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll32.zip'
cmake-generator: 'Visual Studio 16 2019'
msvc-year: '2019'
vcvars-script: 'vcvars32.bat'
vcpkg-triplet: x86-windows-release
use-qtwebengine: 'ON' # might need to be turned off for MinGW
qt-modules: 'qtwebengine'
artifact-suffix: 'win32' # set if needed - will trigger artifact upload
create-installer: ${{ startsWith(github.ref, 'refs/tags/') }}
installer-suffix: 'win32-installer'
- job-name: '64-bit'
fftw-arch: 'x64'
cmake-arch: 'x64'
os-version: '2019'
qt-version: '5.15.2'
qt-arch: 'win64_msvc2019_64'
fftw-url: 'ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip'
cmake-generator: 'Visual Studio 16 2019'
msvc-year: '2019'
vcvars-script: 'vcvars64.bat'
vcpkg-triplet: x64-windows-release
use-qtwebengine: 'ON' # might need to be turned off for MinGW
qt-modules: 'qtwebengine'
artifact-suffix: 'win64' # set if needed - will trigger artifact upload
create-installer: ${{ startsWith(github.ref, 'refs/tags/') }}
installer-suffix: 'win64-installer'
- job-name: '64-bit MinGW'
fftw-arch: 'x64'
os-version: '2019'
qt-version: '5.15.2'
qt-arch: 'win64_mingw81'
fftw-url: 'ftp://ftp.fftw.org/pub/fftw/fftw-3.3.5-dll64.zip'
cmake-generator: 'MinGW Makefiles'
chocolatey-options: '' # '--forcex86' for 32-bit build
use-qtwebengine: 'OFF' # might need to be turned off for MinGW
qt-modules: ''
artifact-suffix: 'win64-mingw' # set if needed - will trigger artifact upload
name: Windows ${{ matrix.job-name }}
env:
BUILD_PATH: ${{ github.workspace }}/build
INSTALL_PATH: ${{ github.workspace }}/build/Install
LIBS_DOWNLOAD_PATH: ${{ github.workspace }}/../3rd-party
VCVARS_SCRIPT_PATH: 'C:/Program Files (x86)/Microsoft Visual Studio/${{ matrix.msvc-year }}/Enterprise/VC/Auxiliary/Build/${{ matrix.vcvars-script }}'
FFTW_INSTALL_DIR: "C:/Program Files/fftw"
ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}'
INSTALLER_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.installer-suffix }}'
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: prepare timestamp for cache
id: current-date
shell: bash
run: echo "stamp=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: cache vcpkg
if: matrix.vcpkg-triplet
uses: actions/cache@v3
with:
path: ~/AppData/Local/vcpkg/archives
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.cmake-arch }}-${{ matrix.vcpkg-triplet }}-${{ steps.current-date.outputs.stamp }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.cmake-arch }}-${{ matrix.vcpkg-triplet }}-
- name: cache ccache
uses: actions/cache@v3
with:
path: ~/AppData/Local/ccache # updated in ccache 4.7, see https://github.com/ccache/ccache/issues/1023
key: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.cmake-arch }}-${{ matrix.qt-arch }}-${{ matrix.qt-version }}-${{ steps.current-date.outputs.stamp }}
restore-keys: ${{ runner.os }}-${{ matrix.os-version }}-${{ matrix.cmake-arch }}-${{ matrix.qt-arch }}-${{ matrix.qt-version }}-
- name: install qt using aqtinstall
uses: jurplel/install-qt-action@v3
with:
modules: ${{ matrix.qt-modules }}
version: ${{ matrix.qt-version }}
arch: ${{ matrix.qt-arch }}
cache: true
cache-key-prefix: ${{ runner.os }}-v1-${{ matrix.os-version }}-${{ matrix.qt-version }}-qt${{ matrix.qt-arch }}
- name: install ccache
shell: bash
run: |
choco install ccache --no-progress
echo "`echo c:/ProgramData/chocolatey/lib/ccache/tools/ccache*`" >> $GITHUB_PATH # put the direct path before the path of the choco's "shim" (link subsitute)
- name: install libsndfile
shell: bash
run: |
if [[ -n "${{ matrix.vcpkg-triplet }}" ]]; then
vcpkg install libsndfile --triplet="${{ matrix.vcpkg-triplet }}" --overlay-triplets="$GITHUB_WORKSPACE/vcpkg/triplets"
else
choco install libsndfile --no-progress ${{ matrix.chocolatey-options }}
fi
- name: download fftw
shell: bash
run: |
mkdir -p "$FFTW_INSTALL_DIR" && cd "$FFTW_INSTALL_DIR"
curl -L ${{ matrix.fftw-url }} -o fftw.zip
7z x fftw.zip -y
- name: create fftw msvc library
if: matrix.vcvars-script
shell: cmd
working-directory: ${{ env.FFTW_INSTALL_DIR }}
run: |
call "%VCVARS_SCRIPT_PATH%"
lib.exe /machine:${{ matrix.fftw-arch }} /def:libfftw3f-3.def
- name: install asio sdk
shell: bash
env:
ASIO_PATH: ${{ env.LIBS_DOWNLOAD_PATH }}/asio_sdk
run: |
mkdir -p $ASIO_PATH && cd $ASIO_PATH
curl -L https://www.steinberg.net/asiosdk -o asio.zip
7z x asio.zip -y
mv asiosdk_* $GITHUB_WORKSPACE/external_libraries/portaudio/asiosdk
- name: install readline
if: matrix.vcpkg-triplet
shell: bash
run: |
vcpkg install readline --triplet="${{ matrix.vcpkg-triplet }}" --overlay-triplets="$GITHUB_WORKSPACE/vcpkg/triplets"
- name: configure
shell: bash
run: |
export PATH=$Qt5_DIR/bin:$PATH
export VCPKG_ROOT=$VCPKG_INSTALLATION_ROOT
mkdir $BUILD_PATH && cd $BUILD_PATH
cmake -G "${{ matrix.cmake-generator }}" -A "${{ matrix.cmake-arch }}" -D CMAKE_PREFIX_PATH="$Qt5_DIR" -D SUPERNOVA=ON -D SC_USE_QTWEBENGINE=${{ matrix.use-qtwebengine }} -D CMAKE_BUILD_TYPE=Release -DVCPKG_TARGET_TRIPLET="${{ matrix.vcpkg-triplet }}" .. # build type is specified here for MinGW build and for vcpkg
- name: build
shell: bash
run: |
BUILD_PARALLELISM=
if [[ ${{ startsWith(matrix.cmake-generator, 'MinGW') }} == true ]]; then BUILD_PARALLELISM="-- -j2"; fi
cmake --build $BUILD_PATH --config Release --target install $BUILD_PARALLELISM
- name: create archive
if: matrix.artifact-suffix
shell: bash
run: cd $INSTALL_PATH && 7z a $ARTIFACT_FILE.zip -tzip SuperCollider # this assumes that we end up with the build in the folder SuperCollider
- name: upload artifacts
uses: actions/upload-artifact@v3
if: matrix.artifact-suffix
with:
name: ${{ env.ARTIFACT_FILE }}
path: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }}.zip
- name: create installer
if: matrix.create-installer == true
shell: bash
run: |
export PATH="C:\Program Files (x86)\NSIS":$PATH
cmake --build $BUILD_PATH --config Release --target installer
- name: upload installer
uses: actions/upload-artifact@v3
if: matrix.create-installer == true
with:
name: ${{ env.INSTALLER_FILE }}
path: ${{ env.INSTALL_PATH }}/*.exe
test:
strategy:
fail-fast: false
matrix:
include:
- name: macOS
runs-on: macos-12
sclang: 'build/Install/SuperCollider/SuperCollider.app/Contents/MacOS/sclang'
artifact-suffix: macOS-universal
artifact-extension: '.dmg'
- name: Linux
runs-on: ubuntu-22.04
sclang: 'build/Install/bin/sclang'
artifact-suffix: linux-jammy-gcc12
# - name: Windows
# runs-on: windows-2022
# sclang: 'build/Install/SuperCollider/sclang'
# artifact-suffix: win64
needs: [lint, Linux, macOS, Windows] # unfortunately we can't use matrix expression here to make Linux test depend only on Linux build
runs-on: '${{ matrix.runs-on }}'
name: 'test on ${{ matrix.name }}'
env:
INSTALL_PATH: ${{ github.workspace }}/build/Install
ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}${{ matrix.artifact-extension }}'
TESTS_PATH: ${{ github.workspace }}/testsuite/classlibrary
SCLANG: ${{ github.workspace }}/${{ matrix.sclang }}
TEST_LIST_PROTO: ${{ github.workspace }}/testsuite/scripts/test_run_proto_gha.scd
TEST_LIST_RESULT: ${{ github.workspace }}/testsuite/scripts/run/gha_result.scxtar
SCRIPT_RUN_TESTS: ${{ github.workspace }}/testsuite/scripts/sclang_test_runner.scd
SCRIPT_ADD_PATH: ${{ github.workspace }}/testsuite/scripts/add_include_path.scd
SCRIPT_PRINT_RESULTS: ${{ github.workspace }}/testsuite/scripts/print_results.scd
steps:
- uses: actions/checkout@v3
with:
submodules: false # don't need submodules for testing
- name: download artifacts
uses: actions/download-artifact@v3
with:
name: ${{ env.ARTIFACT_FILE }}
path: ${{ env.INSTALL_PATH }}
- name: extract artifact
shell: bash
run: |
cd $INSTALL_PATH
echo Contents of `pwd`:
ls
if [[ ${{ runner.os }} == "macOS" ]]; then
hdiutil attach $ARTIFACT_FILE
echo "mkdir SuperCollider"
mkdir SuperCollider
cp -R /Volumes/SuperCollider/* SuperCollider/
else
unzip $ARTIFACT_FILE.zip
fi
- name: setup Linux environment
if: runner.os == 'Linux'
run: |
# install dependencies
sudo apt-get update
sudo apt-get install --yes libsndfile1 libavahi-client-dev libfftw3-dev libicu-dev libudev-dev qtbase5-dev qtwebengine5-dev jackd1 socat
# add bin to PATH so that scsynth can be found
echo "$INSTALL_PATH/bin" >> $GITHUB_PATH
# start jack
jackd --no-realtime --silent -d dummy &
# start virtual display server
export DISPLAY=:99
echo "DISPLAY=$DISPLAY" >> $GITHUB_ENV
Xvfb $DISPLAY -screen 0 1024x768x16 &
- name: setup macOS environment
if: runner.os == 'macOS'
env:
HOMEBREW_NO_ANALYTICS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: brew install coreutils # to get 'timeout' utility
- name: setup Windows environment
if: runner.os == 'Windows'
shell: bash
run: |
# install jack
# even though SC on Windows doesn't use JACK directly
# it will use JackRouter ASIO device
curl -O -J -L https://github.com/jackaudio/jack2-releases/releases/download/v1.9.22/jack2-win64-v1.9.22.exe
echo "installing JACK2"
./jack2-win64-v1.9.22.exe //TYPE="router" //SILENT //SUPPRESSMSGBOXES
# add bin to PATH so that scsynth can be found
echo "$INSTALL_PATH/SuperCollider" >> $GITHUB_PATH
# start jack
/c/Program\ Files/JACK2/jackd.exe --no-realtime -d dummy &
- name: run tests
shell: bash
continue-on-error: true
run: |
# add path
$SCLANG $SCRIPT_ADD_PATH $TESTS_PATH
# run tests
timeout 1200 $SCLANG $SCRIPT_RUN_TESTS $TEST_LIST_PROTO $TEST_LIST_RESULT
- name: post test results
shell: bash
run: |
$SCLANG $SCRIPT_PRINT_RESULTS $TEST_LIST_RESULT
deploy_s3:
strategy:
fail-fast: false
matrix:
include:
- artifact-suffix: macOS-universal
s3-os-name: osx
s3-artifact-suffx: ''
s3-artifact-extension: 'dmg'
artifact-extension: '.dmg' # for download-artifacts action, for non-zip only, should include `.`
s3-create-latest-link: true # create link to pointing to the "latest" build; activate only one per branch per s3-os-name
- artifact-suffix: win32
s3-os-name: win32
s3-artifact-suffx: ''
s3-artifact-extension: 'zip'
s3-create-latest-link: true # create link to pointing to the "latest" build
- artifact-suffix: win64
s3-os-name: win64
s3-artifact-suffx: ''
s3-artifact-extension: 'zip'
s3-create-latest-link: true # create link to pointing to the "latest" build
if: github.repository_owner == 'supercollider' && github.event_name != 'pull_request' # run in the main repo, but not on pull requests
needs: [lint, macOS, Windows]
runs-on: ubuntu-latest
name: 'deploy ${{ matrix.artifact-suffix }} to s3'
env:
INSTALL_PATH: ${{ github.workspace }}/build/Install
ARTIFACT_FILE: SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}${{ matrix.artifact-extension }}
UPLOAD_TO_S3: ${{ (secrets.S3_ACCESS_KEY_ID != 0) && !startsWith(github.ref, 'refs/tags/') }}
S3_CREATE_LATEST_LINK: ${{ matrix.s3-create-latest-link && (secrets.S3_ACCESS_KEY_ID != 0) && startsWith(github.ref, 'refs/heads/') }}
S3_ARTIFACT_PATH: ${{ github.workspace }}/build/s3-upload
S3_ARTIFACT_NAME: SC-${{ github.sha }}${{ matrix.s3-artifact-suffx }}.${{ matrix.s3-artifact-extension }}
S3_BUILD_LOCATION: builds/supercollider/supercollider/${{ matrix.s3-os-name }}
S3_ROOT_URL: 'https://supercollider.s3.amazonaws.com'
steps:
- name: download artifacts
uses: actions/download-artifact@v3
if: env.UPLOAD_TO_S3 == 'true'
with:
name: ${{ env.ARTIFACT_FILE }}
path: ${{ env.INSTALL_PATH }}
- name: preapre s3 upload
if: env.UPLOAD_TO_S3 == 'true'
run: |
mkdir $S3_ARTIFACT_PATH
mv $INSTALL_PATH/*.* $S3_ARTIFACT_PATH/$S3_ARTIFACT_NAME
# set S3_BUILD_LOCATION
echo 'S3_BUILD_URL<<EOF' >> $GITHUB_ENV
echo ${{ env.S3_ROOT_URL }}/${{ env.S3_BUILD_LOCATION }}/${{ env.S3_ARTIFACT_NAME }} >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
if [[ $S3_CREATE_LATEST_LINK == true ]]; then
# set LATEST_HTML_PATH and LATEST_HTML_URL
echo 'LATEST_HTML_PATH<<EOF' >> $GITHUB_ENV
echo ${{ env.S3_ARTIFACT_PATH }}/${GITHUB_REF#refs/heads/}-latest.html >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
echo 'LATEST_HTML_URL<<EOF' >> $GITHUB_ENV
echo ${{ env.S3_ROOT_URL }}/${{ env.S3_BUILD_LOCATION }}/${GITHUB_REF#refs/heads/}-latest.html >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
fi
- name: create latest link
if: env.S3_CREATE_LATEST_LINK == 'true'
env:
FWD_HTML: '<html><head><meta http-equiv="refresh" content="0; url=''${{ env.S3_BUILD_URL }}''" /></head></html>'
run: |
mkdir -p "${LATEST_HTML_PATH%/*}"
echo writing $FWD_HTML to $LATEST_HTML_PATH
echo $FWD_HTML > $LATEST_HTML_PATH
echo html file contents:
cat $LATEST_HTML_PATH
- name: upload to S3
uses: jakejarvis/s3-sync-action@master
if: env.UPLOAD_TO_S3 == 'true'
with:
args: --acl public-read
env:
AWS_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }}
AWS_S3_BUCKET: supercollider
AWS_S3_ENDPOINT: https://s3-us-west-2.amazonaws.com
AWS_REGION: 'us-west-2'
SOURCE_DIR: ${{ env.S3_ARTIFACT_PATH }}
DEST_DIR: ${{ env.S3_BUILD_LOCATION }}
- name: post S3 build location
if: env.UPLOAD_TO_S3 == 'true'
run: |
echo "::group::S3 build location"
echo $S3_BUILD_URL
if [[ -n "$LATEST_HTML_URL" ]]; then echo $LATEST_HTML_URL; fi
echo "::endgroup::"
# release - list of files uploaded to GH release is specified in the *upload* step
deploy_gh:
if: startsWith(github.ref, 'refs/tags/') # run on tagged commits
needs: [lint, macOS, Windows]
runs-on: ubuntu-latest
name: 'deploy release'
env:
INSTALL_PATH: ${{ github.workspace }}/Install
ARTIFACT_FILE_PREFIX: 'SuperCollider-${{ needs.lint.outputs.sc-version }}'
steps:
- name: download artifacts
uses: actions/download-artifact@v3
with:
path: ${{ env.INSTALL_PATH }} # no "name" paramter - download all artifacts
- name: upload to the release page
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-macOS-x64.dmg/*
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-macOS-universal.dmg/*
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-macOS-arm64.dmg/*
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-macOS-x64-legacy.dmg/*
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-win32-installer/*
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-win64-installer/*
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-win32/*
${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-win64/*
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}