diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 705a4de..bd26608 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -41,5 +41,5 @@ jobs: STOCHAS_VERSION="${SVER}" ./scripts/${{ matrix.build_script }} - name: Show built product - run: ls product + run: ls -l product diff --git a/README.md b/README.md index ab6ae7f..20f0ce4 100644 --- a/README.md +++ b/README.md @@ -62,3 +62,15 @@ I have read somewhere it’s associated with how Xcode built the SDK at my end, - Plugin Midi input - Plugin Midi output - Midi Effect Plugin + +# Notes on CI + +Unlike the other things at surge-synthesizer land, because of a few +oddities in AU formatting and flags, a production build of stochas requires +multiple compile passes. As such, a set of scripts in `scripts/{os}-build.sh` +assemble the final product on a per-platform basis into a directory +called `product/` and the actions flow in `.github/workflows` calls +out to this, then uses the standard surge upload etc... pattern. + +If you want to change a production build, you can just run the scripts +on your local machine to see what they do and to adjust them. diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index db26619..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,331 +0,0 @@ -# Build tuning-workbench-synth with JUCE builds - -trigger: - branches: - include: - - main - tags: - include: - - v* # only build release tags -pr: -- main - -jobs: - -- job: Build - strategy: - matrix: - mac: - imageName: 'macos-latest' - isMac: True - doUpload: True - win-2019: - imageName: 'windows-2019' - isWindows: True - doUpload: True - lin: - imageName: 'ubuntu-latest' - isLinux: True - doUpload: True - lin-20: - imageName: 'ubuntu-20.04' - isLinux: True - - pool: - vmImage: $(imageName) - - steps: - - checkout: self - fetchDepth: 1 - # submodules: recursive # can't do submodules here b'cuz depth=1 fails with Github - - - - bash: | - sudo apt-get update - sudo apt-get install -y libgtk-3-dev - sudo apt-get install -y libwebkit2gtk-4.0 - sudo apt-get install -y libwebkit2gtk-4.0-dev - sudo apt-get install -y libcurl4-openssl-dev - sudo apt-get install -y alsa - sudo apt-get install -y alsa-tools - sudo apt-get install -y libasound2-dev - sudo apt-get install -y jack - sudo apt-get install -y libjack-dev - sudo apt-get install -y libfreetype6-dev - sudo apt-get install -y libxinerama-dev - sudo apt-get install -y libxcb-xinerama0 - sudo apt-get install -y libxinerama1 - sudo apt-get install -y x11proto-xinerama-dev - sudo apt-get install -y libxrandr-dev - sudo apt-get install -y libgl1-mesa-dev - sudo apt-get install -y libxcursor-dev - sudo apt-get install -y libxcursor1 - sudo apt-get install -y libxcb-cursor-dev - sudo apt-get install -y libxcb-cursor0 - sudo apt-get install -y --fix-missing - - apt list --installed - - find /usr/include -name "asoundlib.h" -print - displayName: Prepare Linux Host - condition: variables.isLinux - - - bash: | - set -ex - git submodule update --depth 1 --init --recursive - displayName: Submodule Update - - - bash: | - export SVER=`cat VERSION` - export GH=`git log -1 --format=%h` - echo "Version ${SVER} hash ${GH}" - # make it available below - echo "##vso[task.setvariable variable=STOCHAS_VERSION]${SVER}" - echo "##vso[task.setvariable variable=GH;isOutput=true]${GH}" - displayName: Determine Version - - # - # MAC BUILD AND CREATE DMG OF FILES - # - - bash: | - set -ex - # For now we expand this out so we can swap the STOCHAS_IS_SYNTH flag for the AU off - cmake -Bbuild -GXcode -DSTOCHAS_VERSION=${STOCHAS_VERSION} -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" - cmake --build build --target stochas_VST3 --config Release | xcpretty - cmake --build build --target stochas_CLAP --config Release | xcpretty - cmake --build build --target stochas_Standalone --config Release | xcpretty - - mkdir build/tmpasset - cp -r build/stochas_artefacts/Release/VST3/* build/tmpasset - cp -r build/stochas_artefacts/Release/CLAP/* build/tmpasset - cp -r build/stochas_artefacts/Release/Standalone/* build/tmpasset - - cmake -Bbuild -DSTOCHAS_IS_SYNTH=FALSE -DSTOCHAS_VERSION=${STOCHAS_VERSION} -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" - cmake --build build --target stochas_AU --config Release | xcpretty - cp -r build/stochas_artefacts/Release/AU/* build/tmpasset - - NM=stochas-${STOCHAS_VERSION}.${GH}-mac.dmg - - mkdir -p build/product/ - hdiutil create build/product/${NM} -ov -volname "Stochas ${STOCHAS_VERSION}" -fs HFS+ -srcfolder build/tmpasset - displayName: Build Mac - condition: variables.isMac - - # - # MAC EXECUTABLE INSTALLER - # - - bash: | - set -ex - # pull the packages from build assets to save bandwidth since this is normally a bit slow from the - # original site - wget -nv -O mac_packages https://github.com/surge-synthesizer/build-assets/raw/master/packages/Packages.dmg - mv mac_packages $(brew --cache -s packages) - brew install --cask packages - # path needed by packagesbuild - PACKAGES_TARGET=build.install/mac/stochas - mkdir -p ${PACKAGES_TARGET} - # some debugging help - find build/stochas_artefacts/Release -print - packagesbuild --package-version ${STOCHAS_VERSION} "install/mac/Stochas.pkgproj" - NM=stochas-mac-installer.dmg - hdiutil create -volname "Stochas ${STOCHAS_VERSION} Installer" -srcfolder ${PACKAGES_TARGET} -ov -fs HFS+ build/product/${NM} - displayName: Build Mac Installer - condition: and(variables.isMac, variables.doUpload) - - # - # WIN BUILD AND CREATE ZIP OF FILES - # - - bash: | - set -ex - # 64 bit - cmake -Bbuild -A x64 -DSTOCHAS_VERSION=${STOCHAS_VERSION} - cmake --build build --config Release - # 32 bit - cmake -Bbuild32 -A Win32 -DSTOCHAS_VERSION=${STOCHAS_VERSION} - cmake --build build32 --config Release - mkdir -p build/product - mkdir -p zip/x86 - mkdir -p zip/x64 - cp -r build/stochas_artefacts/Release/VST3/* zip/x64 - cp -r build/stochas_artefacts/Release/CLAP/* zip/x64 - cp -r build/stochas_artefacts/Release/Standalone/* zip/x64 - cp -r build32/stochas_artefacts/Release/VST3/* zip/x86 - cp -r build32/stochas_artefacts/Release/CLAP/* zip/x86 - cp -r build32/stochas_artefacts/Release/Standalone/* zip/x86 - NM=stochas-${STOCHAS_VERSION}.${GH}-win.zip - # see what we have - find build - powershell Compress-Archive -DestinationPath "build/product/${NM}" -Force -Path "zip" - displayName: Build Windows - condition: variables.isWindows - # - # WIN SETUP - # - - bash: | - set -ex - # build the innosetup install - nuget install innosetup - mkdir -p build/product/ - iscc //Obuild\\product //Fstochas_windows_installer //DSTOCHAS_VERSION=${STOCHAS_VERSION}.${GH} "install\\win\\install.iss" - - displayName: Package Windows - condition: and(variables.isWindows, variables.doUpload) - - # - # LINUX - # - - bash: | - set -ex - cmake -Bbuild -DSTOCHAS_VERSION=${STOCHAS_VERSION} - cmake --build build --config Release - LINARCH=`uname -m` - NM=stochas-${STOCHAS_VERSION}.${GH}-linux-${LINARCH}.tgz - mkdir -p build/product/ - mkdir -p build/Stochas/Standalone - cp -r build/stochas_artefacts/VST3/* build/Stochas - cp -r build/stochas_artefacts/CLAP/* build/Stochas - cp -r build/stochas_artefacts/Standalone/* build/Stochas/Standalone - tar cvzf "build/product/${NM}" -C build Stochas - displayName: Build Linux - condition: variables.isLinux - - # - # PUBLISH ARTIFACTS - # - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'MACOS_BUILD' - targetPath: 'build/product/' - displayName: Publish Mac DMG - condition: and(variables.isMac, variables.doUpload) - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'WINDOWS_BUILD' - targetPath: 'build/product/' - displayName: Publish Windows Zip - condition: and(variables.isWindows, variables.doUpload) - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'LINUX_BUILD' - targetPath: 'build/product/' - displayName: Publish Linux Tar - condition: and(variables.isLinux, variables.doUpload) - - -# -# UPDATE GITHUB RELEASES -# -- job: UpdateGithubRelease - dependsOn: Build - # only publish if it was merged to main (ie not on a pr) or if a tag was pushed - condition: and(succeeded(), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))) - pool: - vmImage: 'ubuntu-20.04' - - steps: - - task: DownloadPipelineArtifact@0 - inputs: - artifactName: 'MACOS_BUILD' - targetPath: $(Build.ArtifactStagingDirectory) - - - task: DownloadPipelineArtifact@0 - inputs: - artifactName: 'WINDOWS_BUILD' - targetPath: $(Build.ArtifactStagingDirectory) - - - task: DownloadPipelineArtifact@0 - inputs: - artifactName: 'LINUX_BUILD' - targetPath: $(Build.ArtifactStagingDirectory) - - - task: DownloadSecureFile@1 - inputs: - secureFile: discord-nightly-stochas.webhook - - - - bash: | - scripts/release-notes.sh > $(Build.ArtifactStagingDirectory)/ReleaseNotes.md - ls $(Build.ArtifactStagingDirectory) - md5sum $(Build.ArtifactStagingDirectory)/* - displayName: Fake up release notes and tag release - - - bash: | - GH=`git log -1 --format=%h` - DATE=$(date '+%Y-%m-%d') - # make it available below - echo "##vso[task.setvariable variable=GH]$GH" - echo "##vso[task.setvariable variable=BUILD_DATE;]$DATE" - displayName: Determine Hash - - # - # Developer release - # - - task: GitHubRelease@0 - displayName: "Create Dev Release" - condition: eq(variables['Build.SourceBranch'], 'refs/heads/main') - inputs: - gitHubConnection: surge-rackupdater - repositoryName: surge-synthesizer/stochas - action: 'edit' - - # Required when action == Create# Options: auto, manual - tagSource: manual - # we create a new tag - #tag: v1.0.1.$(GH) - tag: developer - title: Dev Release $(BUILD_DATE) $(GH) - isPreRelease: true - target: '$(Build.SourceVersion)' - addChangeLog: true - assetUploadMode: 'delete' - releaseNotesFile: $(Build.ArtifactStagingDirectory)/ReleaseNotes.md - assets: $(Build.ArtifactStagingDirectory)/*.* - - # - # STABLE RELEASE WHEN TAGGED with vX.X.X - # - - task: GitHubRelease@0 - displayName: "Create or edit New 'Stable' Release" - # will only run when we tag something starting with v - condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v') - inputs: - gitHubConnection: surge-rackupdater - repositoryName: surge-synthesizer/stochas - action: 'edit' - title: Stable Release ${{ replace(variables['Build.SourceBranch'], 'refs/tags/','') }} - tagSource: manual - # extract just the tag - tag: ${{ replace(variables['Build.SourceBranch'], 'refs/tags/','') }} - target: '$(Build.SourceVersion)' - addChangeLog: false - assetUploadMode: 'delete' - releaseNotesFile: $(Build.ArtifactStagingDirectory)/ReleaseNotes.md - assets: $(Build.ArtifactStagingDirectory)/*.* - # - # PUBLISH CANONICAL WHEN RELEASE - # - - task: GitHubRelease@0 - displayName: "Edit canonical latest" - # will only run when we tag something starting with v - condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/v') - inputs: - gitHubConnection: surge-rackupdater - repositoryName: surge-synthesizer/stochas - action: 'edit' - title: Latest Stable Release - tagSource: manual - # extract just the tag - tag: release_dl - target: '$(Build.SourceVersion)' - addChangeLog: false - assetUploadMode: 'delete' - releaseNotesFile: $(Build.ArtifactStagingDirectory)/ReleaseNotes.md - assets: $(Build.ArtifactStagingDirectory)/*.* - - - - bash: | - curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"A new Stochas Nightly is available.\n${GH} ${DATE}\nhttps://github.com/surge-synthesizer/stochas/releases/tag/developer\"}" `cat $AGENT_TEMPDIRECTORY/discord-nightly-stochas.webhook` - displayName: Tell Discord - condition: eq(variables['Build.SourceBranch'], 'refs/heads/main') diff --git a/build_win.sh b/build_win.sh deleted file mode 100644 index 2868df4..0000000 --- a/build_win.sh +++ /dev/null @@ -1,22 +0,0 @@ -# -# Run from git bash shell -# install target -# -# Inno setup path -# -#INNO="/c/Program\ Files\ \(x86\)/Inno\ Setup\ 5/Compil32.exe" -INNO="/c/Program Files (x86)/Inno Setup 5/iscc.exe" -VST2_PATH=/Z/dev/VST_SDK/VST2_SDK -STOCHAS_VERSION=`cat VERSION` -cmake -B build -A x64 -DSTOCHAS_VERSION=${STOCHAS_VERSION} -DVST2_PATH=${VST2_PATH} -DSTOCHAS_IS_SYNTH=TRUE -DSTOCHAS_IS_MIDI_EFFECT=TRUE -cmake --build build --config Release -retVal=$? -if [ $retVal -eq 0 ]; then - cmake -B build32 -A Win32 -DSTOCHAS_VERSION=${STOCHAS_VERSION} -DVST2_PATH=${VST2_PATH} -DSTOCHAS_IS_SYNTH=FALSE -DSTOCHAS_IS_MIDI_EFFECT=TRUE - cmake --build build32 --config Release - - retVal=$? - if [ $retVal -eq 0 ] && [ "$1" == "install" ]; then - "$INNO" //Obuild.install\\win //Fstochas_windows_install //DSTOCHAS_VERSION=${STOCHAS_VERSION} "install\\win\\install.iss" - fi -fi \ No newline at end of file diff --git a/scripts/linux-build.sh b/scripts/linux-build.sh index 462454b..8201190 100755 --- a/scripts/linux-build.sh +++ b/scripts/linux-build.sh @@ -1,16 +1,16 @@ #!/bin/bash -cmake -Bignore/build -DSTOCHAS_VERSION=${STOCHAS_VERSION} -cmake --build ignore/build --config Release +cmake -Bbuild -GNinja -DSTOCHAS_VERSION=${STOCHAS_VERSION} -DCMAKE_BUILD_TYPE=Release +cmake --build build --config Release --parallel LINARCH=`uname -m` GH=`git log -1 --format=%h` NM=stochas-${STOCHAS_VERSION}.${GH}.linux-${LINARCH}.tgz -mkdir -p ignore/build/product/ -mkdir -p ignore/build/Stochas/Standalone -cp -r ignore/build/stochas_artefacts/VST3/* build/Stochas -cp -r ignore/build/stochas_artefacts/CLAP/* build/Stochas -cp -r ignore/build/stochas_artefacts/Standalone/* build/Stochas/Standalone -tar cvzf "ignore/build/product/${NM}" -C ignore/build Stochas +mkdir -p build/product/ +mkdir -p build/Stochas/Standalone +cp -r build/stochas_artefacts/Release/VST3/* build/Stochas +cp -r build/stochas_artefacts/Release/CLAP/* build/Stochas +cp -r build/stochas_artefacts/Release/Standalone/* build/Stochas/Standalone +tar cvzf "build/product/${NM}" -C build Stochas mkdir product -mv ignore/build/product/* product \ No newline at end of file +mv build/product/* product \ No newline at end of file diff --git a/scripts/mac-build.sh b/scripts/mac-build.sh index ab973ac..20773db 100755 --- a/scripts/mac-build.sh +++ b/scripts/mac-build.sh @@ -6,19 +6,19 @@ if [ ! -f lib/sst-plugininfra/scripts/installer_mac/make_installer.sh ]; then die fi -cmake -Bignore/build -GNinja -DSTOCHAS_VERSION=${STOCHAS_VERSION} -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -cmake --build ignore/build --target stochas_VST3 --config Release -cmake --build ignore/build --target stochas_CLAP --config Release -cmake --build ignore/build --target stochas_Standalone --config Release +cmake -Bignore/build -GNinja -DCMAKE_BUILD_TYPE=Release -DSTOCHAS_VERSION=${STOCHAS_VERSION} -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" +cmake --build ignore/build --target stochas_VST3 --config Release --parallel +cmake --build ignore/build --target stochas_CLAP --config Release --parallel +cmake --build ignore/build --target stochas_Standalone --config Release --parallel mkdir -p ignore/mac_assets -cp -r ignore/build/stochas_artefacts/VST3/* ignore/mac_assets -cp -r ignore/build/stochas_artefacts/CLAP/* ignore/mac_assets -cp -r ignore/build/stochas_artefacts/Standalone/* ignore/mac_assets +cp -r ignore/build/stochas_artefacts/Release/VST3/* ignore/mac_assets +cp -r ignore/build/stochas_artefacts/Release/CLAP/* ignore/mac_assets +cp -r ignore/build/stochas_artefacts/Release/Standalone/* ignore/mac_assets -cmake -GNinja -Bignore/build_au -DSTOCHAS_IS_SYNTH=FALSE -DSTOCHAS_VERSION=${STOCHAS_VERSION} -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -cmake --build ignore/build_au --target stochas_AU --config Release -cp -r ignore/build_au/stochas_artefacts/AU/* ignore/mac_assets +cmake -GNinja -Bignore/build_au -DCMAKE_BUILD_TYPE=Release -DSTOCHAS_IS_SYNTH=FALSE -DSTOCHAS_VERSION=${STOCHAS_VERSION} -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" +cmake --build ignore/build_au --target stochas_AU --config Release --parallel +cp -r ignore/build_au/stochas_artefacts/Release/AU/* ignore/mac_assets mkdir -p ignore/mac_installer lib/sst-plugininfra/scripts/installer_mac/make_installer.sh Stochas ignore/mac_assets resources ignore/mac_installer ${STOCHAS_VERSION} diff --git a/scripts/win-build.sh b/scripts/win-build.sh index 28a0f75..1bc1fdf 100644 --- a/scripts/win-build.sh +++ b/scripts/win-build.sh @@ -2,8 +2,8 @@ set -ex # 64 bit -cmake -Bbuild -A x64 -DSTOCHAS_VERSION=${STOCHAS_VERSION} -cmake --build build --config Release +cmake -Bbuild -A x64 -DSTOCHAS_VERSION=${STOCHAS_VERSION} -DCMAKE_BUILD_TYPE=Release +cmake --build build --config Release --parallel # 32 bit mkdir -p build/product mkdir -p zip/x64