From 6e79a384b31c92887f87b8100da42601f2c49e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20P=C4=85czkowski?= Date: Mon, 22 Feb 2021 22:25:08 -0800 Subject: [PATCH 01/11] cmake: add hints for finding libsndfile on windows for libsndfile installed using chocolatey --- cmake_modules/FindSndfile.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmake_modules/FindSndfile.cmake b/cmake_modules/FindSndfile.cmake index bdd4fee8e89..6d511653d2d 100644 --- a/cmake_modules/FindSndfile.cmake +++ b/cmake_modules/FindSndfile.cmake @@ -51,6 +51,8 @@ else() "${CMAKE_SOURCE_DIR}/../${CMAKE_LIBRARY_ARCHITECTURE}/libsndfile/include" "$ENV{ProgramW6432}/Mega-Nerd/libsndfile/include" "$ENV{ProgramFiles}/Mega-Nerd/libsndfile/include" + "$ENV{PROGRAMFILES\(X86\)}/libsndfile/include" + "$ENV{ProgramFiles}/libsndfile/include" PATHS /usr/local/include /usr/include ) @@ -64,6 +66,10 @@ else() "$ENV{ProgramW6432}/Mega-Nerd/libsndfile/bin" "$ENV{ProgramFiles}/Mega-Nerd/libsndfile/lib" "$ENV{ProgramFiles}/Mega-Nerd/libsndfile/bin" + "$ENV{PROGRAMFILES\(X86\)}/libsndfile/lib" + "$ENV{PROGRAMFILES\(X86\)}/libsndfile/bin" + "$ENV{ProgramFiles}/libsndfile/lib" + "$ENV{ProgramFiles}/libsndfile/bin" PATHS /usr/local/ /usr/lib ) @@ -77,6 +83,10 @@ else() "$ENV{ProgramW6432}/Mega-Nerd/libsndfile/bin" "$ENV{ProgramFiles}/Mega-Nerd/libsndfile/lib" "$ENV{ProgramFiles}/Mega-Nerd/libsndfile/bin" + "$ENV{PROGRAMFILES\(X86\)}/libsndfile/lib" + "$ENV{PROGRAMFILES\(X86\)}/libsndfile/bin" + "$ENV{ProgramFiles}/libsndfile/lib" + "$ENV{ProgramFiles}/libsndfile/bin" ) # Handle the QUIETLY and REQUIRED arguments and set SNDFILE_FOUND to TRUE if From eb23e5637d5f2c6a215a4179c4bcc8efb15fd59d Mon Sep 17 00:00:00 2001 From: brianlheim Date: Sun, 28 Feb 2021 12:21:01 +0100 Subject: [PATCH 02/11] cmake: search for sndfile.dll too in newer releases, the dll is actually called sndfile.dll, not libsndfile.dll. --- cmake_modules/FindSndfile.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake_modules/FindSndfile.cmake b/cmake_modules/FindSndfile.cmake index 6d511653d2d..1c8b76f9433 100644 --- a/cmake_modules/FindSndfile.cmake +++ b/cmake_modules/FindSndfile.cmake @@ -75,7 +75,7 @@ else() ) # used by Windows only find_path(SNDFILE_LIBRARY_DIR - NAMES libsndfile.dll libsndfile-1.dll + NAMES libsndfile.dll libsndfile-1.dll sndfile.dll HINTS "${CMAKE_SOURCE_DIR}/../${CMAKE_LIBRARY_ARCHITECTURE}/libsndfile/lib" "${CMAKE_SOURCE_DIR}/../${CMAKE_LIBRARY_ARCHITECTURE}/libsndfile/bin" From 1b8e7a11f55fc0e7a82b16c3bba9f0a691d723a3 Mon Sep 17 00:00:00 2001 From: brianlheim Date: Sun, 28 Feb 2021 11:41:13 +0100 Subject: [PATCH 03/11] MSVC: add /Zc:__cplusplus --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c486c645034..032c016d5b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -358,6 +358,7 @@ if(MSVC) set(${flag} "${${flag}} /wd4800") # forcing value to bool 'true' or 'false' (performance warning) set(${flag} "${${flag}} /wd4996") # The POSIX name for this item is deprecated. endforeach() + add_compile_options("/Zc:__cplusplus") # _ENABLE_ATOMIC_ALIGNMENT_FIX prevents the build from breaking when VS2015 update 2 upwards are used # see http://boost.2283326.n4.nabble.com/lockfree-ENABLE-ATOMIC-ALIGNMENT-FIX-for-VS-2015-Update-2-td4685955.html From a8bddcf774d0dba28c7354633b643b7fded4ee29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20P=C4=85czkowski?= Date: Mon, 22 Feb 2021 20:15:36 -0800 Subject: [PATCH 04/11] gha: add windows build --- .github/workflows/actions.yml | 200 ++++++++++++++++++++++++++++++++-- 1 file changed, 193 insertions(+), 7 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 42a1f2d4fb5..660012d9472 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -313,6 +313,169 @@ jobs: path: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }} retention-days: 7 # quickly remove test artifacts + Windows: + needs: lint + runs-on: windows-${{ matrix.os-version }} + strategy: + fail-fast: false + matrix: + include: + + - job-name: '32-bit' + fftw-arch: 'x32' + 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' + chocolatey-options: '--forcex86' # '--forcex86' for 32-bit build + use-qtwebengine: 'ON' # might need to be turned off for MinGW + ableton-link: 'ON' # might need to be turned off for MinGW + 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' + chocolatey-options: '' # '--forcex86' for 32-bit build + use-qtwebengine: 'ON' # might need to be turned off for MinGW + ableton-link: 'ON' # might need to be turned off for MinGW + 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 + ableton-link: 'OFF' # might need to be turned off for MinGW + 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 }}' + 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@v2 + with: + submodules: recursive + - name: prepare timestamp for cache + id: current-date + run: | + echo "::set-output name=stamp::$(date '+%Y-%m-%d')" + echo "::set-output name=week::$(date '+%V')" + - name: cache qt + id: cache-qt + uses: actions/cache@v1 + with: + path: ../Qt + key: ${{ runner.os }}-v1-${{ matrix.os-version }}-${{ matrix.qt-version }}-qt${{ matrix.qt-arch }} + - name: install qt using aqtinstall + uses: jurplel/install-qt-action@v2 + with: + modules: 'qtwebengine' + version: ${{ matrix.qt-version }} + arch: ${{ matrix.qt-arch }} + cached: ${{ steps.cache-qt.outputs.cache-hit }} + - name: install libsndfile + run: choco install libsndfile ${{ matrix.chocolatey-options }} + - name: download fftw + shell: bash + env: + FFTW_PATH: ${{ env.LIBS_DOWNLOAD_PATH }}/fftw + run: | + mkdir -p $FFTW_PATH && cd $FFTW_PATH + curl -L ${{ matrix.fftw-url }} -o fftw.zip + 7z x fftw.zip -y + # add env var for subsequent steps + echo 'FFTW_PATH<> $GITHUB_ENV + echo $FFTW_PATH >> $GITHUB_ENV + echo 'EOF' >> $GITHUB_ENV + - name: create fftw msvc library + if: matrix.vcvars-script + shell: cmd + env: + FFTW_ARCH: ${{ matrix.fftw-arch }} + run: | + call "%VCVARS_SCRIPT_PATH%" + cd "%FFTW_PATH%" + lib.exe /machine:%FFTW_ARCH% /def:libfftw3f-3.def + - name: move fftw + shell: bash + run: | + mv $FFTW_PATH "C:/Program Files/fftw" + - 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/sdk_downloads/asiosdk2.3.zip -o asio.zip + 7z x asio.zip -y + mv ASIOSDK2.3 $GITHUB_WORKSPACE/external_libraries/portaudio/asiosdk + - name: configure + shell: bash + env: + CMAKE_GENERATOR: ${{ matrix.cmake-generator }} + CMAKE_ARCH: ${{ matrix.cmake-arch }} + USE_WEBENGINE: ${{ matrix.use-qtwebengine }} + ABLETON_LINK: ${{ matrix.ableton-link }} + run: | + export PATH=$Qt5_DIR/bin:$PATH + + mkdir $BUILD_PATH && cd $BUILD_PATH + + cmake -G "$CMAKE_GENERATOR" -A "$CMAKE_ARCH" -D CMAKE_PREFIX_PATH="$Qt5_DIR" -D SUPERNOVA=ON -D SC_USE_QTWEBENGINE=$USE_WEBENGINE -D SC_ABLETON_LINK=$ABLETON_LINK -D CMAKE_BUILD_TYPE=Release .. # build type is specified here for MinGW build + + - name: build + shell: bash + run: | + cmake --build $BUILD_PATH --config Release --target install + - 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@v2 + if: matrix.artifact-suffix + with: + name: ${{ env.ARTIFACT_FILE }} + path: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }}.zip + retention-days: 7 # quickly remove test artifacts + - 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@v2 + if: matrix.create-installer == 'true' + with: + name: ${{ env.INSTALLER_FILE }} + path: ${{ env.INSTALL_PATH }}/*.exe + retention-days: 7 # quickly remove test artifacts + test: strategy: fail-fast: false @@ -396,8 +559,8 @@ jobs: PYCHARM_HOSTED: 1 # enable color output QPM_DEBUG: 1 run: qpm test.run -l $SCRIPT_RUN --path $SCLANG --include $QUARKS_PATH $TESTS_PATH - - deploy: + + deploy_s3: strategy: fail-fast: false matrix: @@ -410,8 +573,30 @@ jobs: s3-artifact-suffx: '' 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 + upload-to-github: true + upload-to-s3: true + s3-os-name: win32 + s3-artifact-suffx: '' + s3-create-latest-link: true # create link to pointing to the "latest" build + + - artifact-suffix: win32-installer + upload-to-github: true + upload-to-s3: false + + - artifact-suffix: win64 + upload-to-github: true + upload-to-s3: true + s3-os-name: win64 + s3-artifact-suffx: '' + s3-create-latest-link: true # create link to pointing to the "latest" build + + - artifact-suffix: win64-installer + upload-to-github: true + upload-to-s3: false + if: github.repository_owner == 'supercollider' || startsWith(github.ref, 'refs/tags/') # run in the main repo and everywhere on tagged commits - needs: [lint, macOS] + needs: [lint, macOS, Windows] runs-on: ubuntu-18.04 name: 'deploy ${{ matrix.artifact-suffix }} build' env: @@ -427,6 +612,7 @@ jobs: steps: - name: download artifacts uses: actions/download-artifact@v2 + if: (env.UPLOAD_TO_GH_RELEASE == 'true') || (env.UPLOAD_TO_S3 == 'true') with: name: ${{ env.ARTIFACT_FILE }} path: ${{ env.INSTALL_PATH }} @@ -442,13 +628,13 @@ jobs: if: env.UPLOAD_TO_S3 == 'true' run: | mkdir $S3_ARTIFACT_PATH - cp $INSTALL_PATH/$ARTIFACT_FILE $S3_ARTIFACT_PATH/$S3_ARTIFACT_NAME - - # set S3_BUILD_LOCATION + mv $INSTALL_PATH/*.* $S3_ARTIFACT_PATH/$S3_ARTIFACT_NAME + + # set S3_BUILD_LOCATION echo 'S3_BUILD_URL<> $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<> $GITHUB_ENV From 778a7e79d6770d13abbd6a35106dd18cb386135f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20P=C4=85czkowski?= Date: Sun, 28 Feb 2021 22:05:51 -0800 Subject: [PATCH 05/11] gha: remove double zip from filenames move instead of copy archive for s3 upload --- .github/workflows/actions.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 660012d9472..148a5077ddb 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -124,7 +124,7 @@ jobs: SHARED_LIBSCSYNTH: ${{ matrix.shared-libscsynth }} CC: ${{ matrix.c-compiler }} CXX: ${{ matrix.cxx-compiler }} - ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}.zip' + ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}' steps: - uses: actions/checkout@v2 with: @@ -179,13 +179,13 @@ jobs: make install -j2 - name: create archive if: matrix.artifact-suffix - run: cd $INSTALL_PATH && zip --symlinks -r $ARTIFACT_FILE . + run: cd $INSTALL_PATH && zip --symlinks -r $ARTIFACT_FILE.zip . - name: upload artifacts uses: actions/upload-artifact@v2 if: matrix.artifact-suffix with: name: ${{ env.ARTIFACT_FILE }} - path: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }} + path: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }}.zip retention-days: 7 # quickly remove test artifacts macOS: @@ -232,7 +232,7 @@ jobs: 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 }}.zip' + ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}' steps: - uses: actions/checkout@v2 with: @@ -304,13 +304,13 @@ jobs: run: cmake --build $BUILD_PATH --config Release --target install - name: create archive if: matrix.artifact-suffix - run: cd $INSTALL_PATH && zip --symlinks -r $ARTIFACT_FILE SuperCollider # this assumes that we end up with the build in the folder SuperCollider + run: cd $INSTALL_PATH && zip --symlinks -r $ARTIFACT_FILE.zip SuperCollider # this assumes that we end up with the build in the folder SuperCollider - name: upload artifacts uses: actions/upload-artifact@v2 if: matrix.artifact-suffix with: name: ${{ env.ARTIFACT_FILE }} - path: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }} + path: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }}.zip retention-days: 7 # quickly remove test artifacts Windows: @@ -497,7 +497,7 @@ jobs: name: 'test on ${{ matrix.name }}' env: INSTALL_PATH: ${{ github.workspace }}/build/Install - ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}.zip' + ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}' QUARKS_PATH: ${{ github.workspace }}/build/Quarks TESTS_PATH: ${{ github.workspace }}/testsuite/classlibrary SCLANG: ${{ github.workspace }}/${{ matrix.sclang }} @@ -518,7 +518,7 @@ jobs: cd $INSTALL_PATH echo `pwd` echo `ls -s` - unzip $ARTIFACT_FILE + unzip $ARTIFACT_FILE.zip - name: setup Linux environment if: runner.os == 'Linux' run: | @@ -601,7 +601,7 @@ jobs: name: 'deploy ${{ matrix.artifact-suffix }} build' env: INSTALL_PATH: ${{ github.workspace }}/build/Install - ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}.zip' + ARTIFACT_FILE: 'SuperCollider-${{ needs.lint.outputs.sc-version }}-${{ matrix.artifact-suffix }}' UPLOAD_TO_GH_RELEASE: ${{ matrix.upload-to-github && startsWith(github.ref, 'refs/tags/') }} UPLOAD_TO_S3: ${{ matrix.upload-to-s3 && (secrets.S3_ACCESS_KEY_ID != 0) && !startsWith(github.ref, 'refs/tags/') }} S3_CREATE_LATEST_LINK: ${{ matrix.s3-create-latest-link && matrix.upload-to-s3 && (secrets.S3_ACCESS_KEY_ID != 0) && startsWith(github.ref, 'refs/heads/') }} @@ -620,7 +620,7 @@ jobs: uses: softprops/action-gh-release@v1 if: env.UPLOAD_TO_GH_RELEASE == 'true' with: - files: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }} + files: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }}.zip draft: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 5c60f8ec271239bc766363a6a7678394e0216c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20P=C4=85czkowski?= Date: Mon, 1 Mar 2021 00:36:04 -0800 Subject: [PATCH 06/11] gha: fix artifact extension handling --- .github/workflows/actions.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 148a5077ddb..f544aaa6a16 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -571,6 +571,7 @@ jobs: upload-to-s3: true s3-os-name: osx s3-artifact-suffx: '' + artifact-extension: 'zip' 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 @@ -578,6 +579,7 @@ jobs: upload-to-s3: true s3-os-name: win32 s3-artifact-suffx: '' + artifact-extension: 'zip' s3-create-latest-link: true # create link to pointing to the "latest" build - artifact-suffix: win32-installer @@ -589,6 +591,7 @@ jobs: upload-to-s3: true s3-os-name: win64 s3-artifact-suffx: '' + artifact-extension: 'zip' s3-create-latest-link: true # create link to pointing to the "latest" build - artifact-suffix: win64-installer @@ -606,7 +609,7 @@ jobs: UPLOAD_TO_S3: ${{ matrix.upload-to-s3 && (secrets.S3_ACCESS_KEY_ID != 0) && !startsWith(github.ref, 'refs/tags/') }} S3_CREATE_LATEST_LINK: ${{ matrix.s3-create-latest-link && matrix.upload-to-s3 && (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 }}.zip + S3_ARTIFACT_NAME: SC-${{ github.sha }}${{ matrix.s3-artifact-suffx }}.${{ matrix.artifact-extension }} S3_BUILD_LOCATION: builds/supercollider/supercollider/${{ matrix.s3-os-name }} S3_ROOT_URL: 'https://supercollider.s3.amazonaws.com' steps: @@ -620,7 +623,7 @@ jobs: uses: softprops/action-gh-release@v1 if: env.UPLOAD_TO_GH_RELEASE == 'true' with: - files: ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE }}.zip + files: ${{ env.INSTALL_PATH }}/*.* draft: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From f387140932e1c2ae03bc7b6dc57af73558b35c60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20P=C4=85czkowski?= Date: Mon, 1 Mar 2021 10:25:21 -0800 Subject: [PATCH 07/11] gha: separate s3 and github deployment --- .github/workflows/actions.yml | 62 ++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index f544aaa6a16..804b6cedf46 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -567,47 +567,32 @@ jobs: include: - artifact-suffix: macOS - upload-to-github: true - upload-to-s3: true s3-os-name: osx s3-artifact-suffx: '' artifact-extension: 'zip' 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 - upload-to-github: true - upload-to-s3: true s3-os-name: win32 s3-artifact-suffx: '' artifact-extension: 'zip' s3-create-latest-link: true # create link to pointing to the "latest" build - - artifact-suffix: win32-installer - upload-to-github: true - upload-to-s3: false - - artifact-suffix: win64 - upload-to-github: true - upload-to-s3: true s3-os-name: win64 s3-artifact-suffx: '' artifact-extension: 'zip' s3-create-latest-link: true # create link to pointing to the "latest" build - - artifact-suffix: win64-installer - upload-to-github: true - upload-to-s3: false - - if: github.repository_owner == 'supercollider' || startsWith(github.ref, 'refs/tags/') # run in the main repo and everywhere on tagged commits + if: github.repository_owner == 'supercollider' # run in the main repo needs: [lint, macOS, Windows] runs-on: ubuntu-18.04 - name: 'deploy ${{ matrix.artifact-suffix }} build' + 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 }}' - UPLOAD_TO_GH_RELEASE: ${{ matrix.upload-to-github && startsWith(github.ref, 'refs/tags/') }} - UPLOAD_TO_S3: ${{ matrix.upload-to-s3 && (secrets.S3_ACCESS_KEY_ID != 0) && !startsWith(github.ref, 'refs/tags/') }} - S3_CREATE_LATEST_LINK: ${{ matrix.s3-create-latest-link && matrix.upload-to-s3 && (secrets.S3_ACCESS_KEY_ID != 0) && startsWith(github.ref, 'refs/heads/') }} + 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.artifact-extension }} S3_BUILD_LOCATION: builds/supercollider/supercollider/${{ matrix.s3-os-name }} @@ -615,20 +600,10 @@ jobs: steps: - name: download artifacts uses: actions/download-artifact@v2 - if: (env.UPLOAD_TO_GH_RELEASE == 'true') || (env.UPLOAD_TO_S3 == 'true') with: name: ${{ env.ARTIFACT_FILE }} path: ${{ env.INSTALL_PATH }} - - name: upload to the release page - uses: softprops/action-gh-release@v1 - if: env.UPLOAD_TO_GH_RELEASE == 'true' - with: - files: ${{ env.INSTALL_PATH }}/*.* - draft: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: preapre s3 upload - if: env.UPLOAD_TO_S3 == 'true' run: | mkdir $S3_ARTIFACT_PATH mv $INSTALL_PATH/*.* $S3_ARTIFACT_PATH/$S3_ARTIFACT_NAME @@ -659,7 +634,6 @@ jobs: 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: @@ -677,3 +651,31 @@ jobs: 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-18.04 + 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@v2 + 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/* + # ${{ env.INSTALL_PATH }}/${{ env.ARTIFACT_FILE_PREFIX }}-macOS-legacy/* + ${{ 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 }} \ No newline at end of file From 0f994a8b9d075d03a257943a98cf4d71a4254822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20P=C4=85czkowski?= Date: Mon, 1 Mar 2021 12:25:04 -0800 Subject: [PATCH 08/11] gha: skip s3 upload when secret key is not present --- .github/workflows/actions.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index 804b6cedf46..d971e3c24f5 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -600,10 +600,12 @@ jobs: steps: - name: download artifacts uses: actions/download-artifact@v2 + 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 @@ -634,6 +636,7 @@ jobs: 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: From bcb21131d6e3f55dd911f69d2551a388d3a96f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20P=C4=85czkowski?= Date: Mon, 1 Mar 2021 16:11:30 -0800 Subject: [PATCH 09/11] gha: update build parameters --- .github/workflows/actions.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index d971e3c24f5..cfff0cec5dc 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -435,22 +435,19 @@ jobs: mv ASIOSDK2.3 $GITHUB_WORKSPACE/external_libraries/portaudio/asiosdk - name: configure shell: bash - env: - CMAKE_GENERATOR: ${{ matrix.cmake-generator }} - CMAKE_ARCH: ${{ matrix.cmake-arch }} - USE_WEBENGINE: ${{ matrix.use-qtwebengine }} - ABLETON_LINK: ${{ matrix.ableton-link }} run: | export PATH=$Qt5_DIR/bin:$PATH mkdir $BUILD_PATH && cd $BUILD_PATH - cmake -G "$CMAKE_GENERATOR" -A "$CMAKE_ARCH" -D CMAKE_PREFIX_PATH="$Qt5_DIR" -D SUPERNOVA=ON -D SC_USE_QTWEBENGINE=$USE_WEBENGINE -D SC_ABLETON_LINK=$ABLETON_LINK -D CMAKE_BUILD_TYPE=Release .. # build type is specified here for MinGW build + 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 SC_ABLETON_LINK=${{ matrix.ableton-link }} -D CMAKE_BUILD_TYPE=Release .. # build type is specified here for MinGW build - name: build shell: bash run: | - cmake --build $BUILD_PATH --config Release --target install + 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 From fd1d68c56d09d7639d02c5fe4a09733e7a10c305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20P=C4=85czkowski?= Date: Mon, 1 Mar 2021 16:52:52 -0800 Subject: [PATCH 10/11] CMakeLists: explain MSVC __cplusplus flag --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 032c016d5b2..b7c03bd4fae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -358,6 +358,10 @@ if(MSVC) set(${flag} "${${flag}} /wd4800") # forcing value to bool 'true' or 'false' (performance warning) set(${flag} "${${flag}} /wd4996") # The POSIX name for this item is deprecated. endforeach() + +# this flag causes MSVC to correctly report __cplusplus, which prevents a compiler error +# caused by some versions of libsndfile's C++ header redefining nullptr as NULL. +# See https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ add_compile_options("/Zc:__cplusplus") # _ENABLE_ATOMIC_ALIGNMENT_FIX prevents the build from breaking when VS2015 update 2 upwards are used From ad1be6ac6ee5592cd6e989c58a14a354744d5ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20P=C4=85czkowski?= Date: Mon, 1 Mar 2021 17:23:28 -0800 Subject: [PATCH 11/11] gha: don't run s3 deployment step on pull requests --- .github/workflows/actions.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/actions.yml b/.github/workflows/actions.yml index cfff0cec5dc..826b779dd99 100644 --- a/.github/workflows/actions.yml +++ b/.github/workflows/actions.yml @@ -581,7 +581,7 @@ jobs: artifact-extension: 'zip' s3-create-latest-link: true # create link to pointing to the "latest" build - if: github.repository_owner == 'supercollider' # run in the main repo + 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-18.04 name: 'deploy ${{ matrix.artifact-suffix }} to s3'