diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml new file mode 100644 index 00000000..7da92658 --- /dev/null +++ b/.github/workflows/build-pr.yml @@ -0,0 +1,73 @@ +name: Build Pull Request +on: + pull_request: + +defaults: + run: + shell: bash + +jobs: + build_plugin: + name: PR - ${{ matrix.name }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - name: "windows msvc" + os: windows-latest + target: scxt_plugin_Standalone + cmakeConfig: -A x64 + runTests: false + - name: "windows clang" + os: windows-latest + target: scxt_plugin_Standalone + cmakeConfig: -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang + runTests: false + - name: "mac standalone" + os: macos-latest + target: scxt_plugin_Standalone + runTests: true + - name: "ubuntu standalone" + os: ubuntu-latest + target: scxt_plugin_Standalone + runTests: true + + - name: "windows clap first" + os: windows-latest + target: scxt_clapfirst_all + cmakeConfig: -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DSCXT_JUCE_CLASSIC_STYLE=FALSE + runTests: false + - name: "mac clap first" + os: macos-latest + target: scxt_clapfirst_all + cmakeConfig: -DSCXT_JUCE_CLASSIC_STYLE=FALSE + runTests: false + - name: "ubuntu clap first" + os: ubuntu-latest + target: scxt_clapfirst_all + cmakeConfig: -DSCXT_JUCE_CLASSIC_STYLE=FALSE + runTests: false + + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Prepare for JUCE + uses: surge-synthesizer/sst-githubactions/prepare-for-juce@main + with: + os: ${{ runner.os }} + + - name: Build pull request version + run: | + cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Debug ${{ matrix.cmakeConfig }} + cmake --build ./build --config Debug --target ${{ matrix.target }} --parallel 3 + + - name: Run Tests + if: ${{ matrix.runTests }} + run: | + cmake --build build --config Debug --target scxt-test --parallel 4 + ./build/tests/scxt-test + diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml new file mode 100644 index 00000000..991aac63 --- /dev/null +++ b/.github/workflows/build-release.yml @@ -0,0 +1,110 @@ +name: Build Release Installer +on: + push: + branches: + - main + tags: + - 'v**' + +defaults: + run: + shell: bash + +jobs: + build_plugin: + name: Release Build - ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + include: + - os: windows-latest + cmakeArgs: -D"CMAKE_OSX_ARCHITECTURES=arm64;x86_64" + - os: macos-latest + cmakeArgs: -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang + - os: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - uses: apple-actions/import-codesign-certs@v3 + if: runner.os == 'macOS' + with: + p12-file-base64: ${{ secrets.MAC_CERTS_P12 }} + p12-password: ${{ secrets.CERT_PWD }} + + - name: Prepare for JUCE + uses: surge-synthesizer/sst-githubactions/prepare-for-juce@main + with: + os: ${{ runner.os }} + + + - name: Build release version + run: | + + export MAC_SIGNING_CERT="${{ secrets.MAC_SIGNING_CERT_NAME }}" + export MAC_INSTALLING_CERT="${{ secrets.MAC_INSTALLING_CERT_NAME }}" + + export MAC_SIGNING_ID="${{ secrets.MAC_SIGNING_ID }}" + export MAC_SIGNING_1UPW="${{ secrets.MAC_SIGNING_1UPW }}" + export MAC_SIGNING_TEAM="${{ secrets.MAC_SIGNING_TEAM }}" + + cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Release ${{ matrix.cmakeArgs }} + cmake --build ./build --config Release --target shortcircuit-installer --parallel 3 + + - name: Show Installer Directory + run: | + ls -l ./build/installer + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + path: build/installer + name: build-${{ matrix.os }} + + publish-scxt-nightly: + name: Publish scxt Nightly + if: ${{ github.ref == 'refs/heads/main' && github.repository_owner == 'surge-synthesizer' }} + runs-on: ubuntu-latest + needs: [ build_plugin ] + steps: + - name: Upload to Nightly + uses: surge-synthesizer/sst-githubactions/upload-to-release@main + with: + tag: Nightly + reuse_tag: true + create_tag: false + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Post to Discord + uses: surge-synthesizer/sst-githubactions/discord-release-notify@main + with: + webhook: ${{ secrets.DISCORD_MONOPLUGS_WEBHOOK }} + tag: Nightly + title: "A New ShortCircuit Nightly is Available" + subtitle: "Still pre-alpha! Use care!" + + + publish-scxt-release: + name: Publish scxt Release + if: startsWith(github.ref, 'refs/tags/v') && github.repository_owner == 'surge-synthesizer' + runs-on: ubuntu-latest + needs: [ build_plugin ] + steps: + - name: Upload to Release + uses: surge-synthesizer/sst-githubactions/upload-to-release@main + with: + tag: ${{ github.ref_name }} + reuse_tag: false + create_tag: true + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Post to Discord + uses: surge-synthesizer/sst-githubactions/discord-release-notify@main + with: + webhook: ${{ secrets.DISCORD_MONOPLUGS_WEBHOOK }} + tag: ${{ github.ref_name }} + title: "A New ShortCircuit XT Release is Available" + subtitle: "Release ${{ github.ref_name }}" + diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 391f08c0..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,414 +0,0 @@ -# ShortCircuit XT PR and Main Pipeline - -trigger: - - main - -pr: - - main - -variables: - - group: mac-signing - -jobs: - - job: BuildCodeQuality - condition: eq(variables['Build.Reason'], 'PullRequest') - pool: - vmImage: 'ubuntu-20.04' - - steps: - - checkout: self - fetchDepth: 1 - # submodules: recursive # can't do submodules here b'cuz depth=1 fails with Github - - - bash: | - set -e - mkdir ignore - pushd ignore - git clone https://github.com/jidicula/clang-format-action - popd - ./ignore/clang-format-action/check.sh 17 src llvm - ./ignore/clang-format-action/check.sh 17 src-ui llvm - ./ignore/clang-format-action/check.sh 17 tests llvm - ./ignore/clang-format-action/check.sh 17 clients llvm - - displayName: Do Codequal - - - job: PRBuild - condition: eq(variables['Build.Reason'], 'PullRequest') - strategy: - matrix: - mac-x86: - imageName: 'macos-latest' - cmakeArgs: -D"CMAKE_OSX_ARCHITECTURES=x86_64" - scxtTarget: scxt_plugin_Standalone - xcodeVersion: 14.2 - isMac: True - mac-arm: - imageName: 'macos-latest' - cmakeArgs: -D"CMAKE_OSX_ARCHITECTURES=arm64" - scxtTarget: scxt_plugin_Standalone - xcodeVersion: 14.2 - isMac: True - mac-x86-clap-first: - imageName: 'macos-latest' - cmakeArgs: -D"CMAKE_OSX_ARCHITECTURES=x86_64" -DSCXT_JUCE_CLASSIC_STYLE=FALSE - isMac: True - xcodeVersion: 14.2 - scxtTarget: scxt_clapfirst_all - win-clang: - imageName: 'windows-latest' - cmakeArgs: -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang - scxtTarget: scxt_plugin_Standalone - isWindows: True - win-msvc: - imageName: 'windows-latest' - cmakeArgs: -A x64 - scxtTarget: scxt_plugin_Standalone - isWindowsMSVC: True - win-msvc-clap-first: - imageName: 'windows-latest' - cmakeArgs: -A x64 -DSCXT_JUCE_CLASSIC_STYLE=FALSE - isWindowsMSVC: True - scxtTarget: scxt_clapfirst_all - lin: - imageName: 'ubuntu-latest' - isLinux: True - scxtTarget: scxt_plugin_Standalone - cmakeArgs: - #lin-gcc13: - # imageName: 'ubuntu-latest' - # isLinux: True - # scxtTarget: scxt_plugin_Standalone - # cmakeArgs: -DCMAKE_CXX_COMPILER=g++-13 -DCMAKE_C_COMPILER=gcc-13 - lin-clap-first: - imageName: 'ubuntu-latest' - isLinux: True - cmakeArgs: -DSCXT_JUCE_CLASSIC_STYLE=FALSE - scxtTarget: scxt_clapfirst_all - - pool: - vmImage: $(imageName) - - steps: - - checkout: self - fetchDepth: 1 - - - bash: | - set -e - - sudo apt-get update - - sudo apt-get install -y \ - devscripts \ - libxcb-cursor-dev \ - libxcb-keysyms1-dev \ - libxcb-util-dev \ - libxkbcommon-dev \ - libxkbcommon-x11-dev \ - ninja-build \ - xcb \ - libgtk-3-dev \ - libwebkit2gtk-4.0 \ - libwebkit2gtk-4.0-dev \ - libcurl4-openssl-dev \ - alsa \ - alsa-tools \ - libasound2-dev \ - libjack-dev \ - libfreetype6-dev \ - libxinerama-dev \ - libxcb-xinerama0 \ - libxinerama1 \ - x11proto-xinerama-dev \ - libxrandr-dev \ - libgl1-mesa-dev \ - libxcursor-dev \ - libxcursor1 \ - libxcb-cursor-dev \ - libxcb-cursor0 - - condition: variables.isLinux - displayName: linux - run apt-get - - - - bash: | - git submodule update --depth 1 --init --recursive - displayName: Get SubModules - - - bash: | - sudo xcode-select -s /Applications/Xcode_$(xcodeVersion).app - displayName: Select XCode - condition: variables.isMac - - - bash: | - echo cmake -Bbuild -DCMAKE_BUILD_TYPE=Debug $(cmakeArgs) - cmake -Bbuild -DAZURE_PIPELINE=1 -DCMAKE_BUILD_TYPE=Debug -DSCXT_COPY_PLUGIN_AFTER_BUILD=FALSE $(cmakeArgs) - displayName: Run CMake (Debug) - - - bash: | - cmake --build build --config Debug --target $(scxtTarget) --parallel 4 - displayName: Build SCXT and scxt-test - - - bash: | - cmake --build build --config Debug --target scxt-test --parallel 4 - ./build/tests/scxt-test - displayName: Run Tests SCXT - condition: variables.isLinux - - - job: ReleaseBuild - condition: not(eq(variables['Build.Reason'], 'PullRequest')) - strategy: - matrix: - mac: - imageName: 'macos-latest' - cmakeArgs: -D"CMAKE_OSX_ARCHITECTURES=arm64;x86_64" - xcodeVersion: 14.2 - isMac: True - win: - imageName: 'windows-latest' - cmakeArgs: -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang - isWindows: True - lin: - imageName: 'ubuntu-latest' - isLinux: True - cmakeArgs: - - - pool: - vmImage: $(imageName) - - steps: - - checkout: self - fetchDepth: 5 - # submodules: recursive # can't do submodules here b'cuz depth=1 fails with Github - - - bash: | - set -e - - sudo apt-get update - - sudo apt-get install -y \ - devscripts \ - libxcb-cursor-dev \ - libxcb-keysyms1-dev \ - libxcb-util-dev \ - libxkbcommon-dev \ - libxkbcommon-x11-dev \ - ninja-build \ - xcb \ - libgtk-3-dev \ - libwebkit2gtk-4.0 \ - libwebkit2gtk-4.0-dev \ - libcurl4-openssl-dev \ - alsa \ - alsa-tools \ - libasound2-dev \ - libjack-dev \ - libfreetype6-dev \ - libxinerama-dev \ - libxcb-xinerama0 \ - libxinerama1 \ - x11proto-xinerama-dev \ - libxrandr-dev \ - libgl1-mesa-dev \ - libxcursor-dev \ - libxcursor1 \ - libxcb-cursor-dev \ - libxcb-cursor0 - - condition: variables.isLinux - displayName: linux - run apt-get - - - - task: InstallAppleCertificate@2 - inputs: - certSecureFile: 'dev_id.p12' - certPwd: '$(MAC_EXPORTED_CERT_PW)' - condition: variables.isMac - - - task: InstallAppleCertificate@2 - inputs: - certSecureFile: 'inst_id.p12' - certPwd: '$(MAC_EXPORTED_CERT_PW)' - condition: variables.isMac - - - bash: | - git submodule update --depth 1 --init --recursive - displayName: Get SubModules - - - bash: | - sudo xcode-select -s /Applications/Xcode_$(xcodeVersion).app - displayName: Select XCode - condition: variables.isMac - - - bash: | - cmake -Bbuild -DAZURE_PIPELINE=1 -DCMAKE_BUILD_TYPE=Release -DSCXT_COPY_PLUGIN_AFTER_BUILD=FALSE $(cmakeArgs) - displayName: Run CMake (Release) - - - bash: | - cmake --build build --config Release --target shortcircuit-installer --parallel 4 - displayName: Build SCXT Installer for Main - env: - MAC_INSTALLING_CERT: $(MAC_INSTALLING_CERT) - MAC_SIGNING_1UPW: $(MAC_SIGNING_1UPW) - MAC_SIGNING_CERT: $(MAC_SIGNING_CERT) - MAC_SIGNING_ID: $(MAC_SIGNING_ID) - MAC_SIGNING_TEAM: $(MAC_SIGNING_TEAM) - - - - bash: | - mkdir -p build/stage_git/git_info - git log -1 --pretty=format:'%h : %s - %an' > build/stage_git/git_info/git_nightly_sc3_log_display - git log -1 --pretty=format:'%h : %s%n%aD%n%an%n%n%B' > build/stage_git/git_info/git_nightly_sc3_log_long_display - git log -5 --pretty=format:'%h : %s - %an' > build/stage_git/git_info/git_nightly_sc3_recent_five - git log -1 --pretty=format:'%h' > build/stage_git/git_info/git_nightly_sc3_log_hash - - cat build/stage_git/git_info/* - - condition: variables.isLinux - displayName: Use the linux build to make git log info - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'INSTALLER_MAC_DIST' - targetPath: 'build/installer' - condition: variables.isMac - displayName: mac - publish mac zip - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'INSTALLER_WIN_DIST' - targetPath: 'build/installer' - condition: variables.isWindows - displayName: win - publish win zip - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'INSTALLER_LIN_DIST' - targetPath: 'build/installer' - condition: variables.isLinux - displayName: lin - publish lin zip - - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'GIT_INFO' - targetPath: 'build/stage_git/' - condition: variables.isLinux - displayName: lin - publish git info - - - job: Release - dependsOn: ReleaseBuild - condition: and(succeeded(), not(eq(variables['Build.Reason'], 'PullRequest'))) - strategy: - matrix: - lin: - imageName: 'ubuntu-20.04' - - pool: - vmImage: $(imageName) - - steps: - - checkout: self - persistCredentials: true - - - task: DownloadSecureFile@1 - inputs: - secureFile: discord-nightly-shortcircuit.webhook - - - task: DownloadPipelineArtifact@0 - inputs: - artifactName: 'INSTALLER_MAC_DIST' - targetPath: $(System.DefaultWorkingDirectory) - - - task: DownloadPipelineArtifact@0 - inputs: - artifactName: 'INSTALLER_WIN_DIST' - targetPath: $(System.DefaultWorkingDirectory) - - - task: DownloadPipelineArtifact@0 - inputs: - artifactName: 'INSTALLER_LIN_DIST' - targetPath: $(System.DefaultWorkingDirectory) - - - - task: DownloadPipelineArtifact@0 - inputs: - artifactName: 'GIT_INFO' - targetPath: $(System.DefaultWorkingDirectory) - - - bash: | - set -e - set -x - - mkdir -p releases - - mv *.zip *.dmg *.exe releases - - ls -l $(System.DefaultWorkingDirectory)/git_info/ - echo "## ShortCircuit Nightly Build" > releases/ReleaseNotes.md - echo " " >> releases/ReleaseNotes.md - echo "**This is an incomplete pre-alpha build of SCXT. Please beware.** " >> releases/ReleaseNotes.md - echo "The software has missing features, known bugs, may crash, and more. If you " >> releases/ReleaseNotes.md - echo "choose to use it, please strongly consider a limiter in your DAW and dont " >> releases/ReleaseNotes.md - echo "use in-ear headphones as DSP errors may make unbounded noise. " >> releases/ReleaseNotes.md - echo "For more info, please join our discord!" >> releases/ReleaseNotes.md - echo " " >> releases/ReleaseNotes.md - date +"**Last Updated On: %Y-%m-%d %H:%M:%S %Z**" >> releases/ReleaseNotes.md - echo " " >> releases/ReleaseNotes.md - echo "5 most recent commits in this install:" >> releases/ReleaseNotes.md - echo "
" >> releases/ReleaseNotes.md
-          cat $(System.DefaultWorkingDirectory)/git_info/git_nightly_sc3_recent_five >> releases/ReleaseNotes.md
-          echo " " >> releases/ReleaseNotes.md
-          echo "
" >> releases/ReleaseNotes.md - - echo "---------------" - cat releases/ReleaseNotes.md - echo "---------------" - - ls -alFh releases - displayName: Prepare Release - - - task: GitHubRelease@0 - displayName: "Create Github Nightly Release" - # condition: eq(variables.SURGE_IS_MAIN, 'true') - inputs: - gitHubConnection: surge-rackupdater - repositoryName: surge-synthesizer/shortcircuit-xt - action: 'edit' - tag: Nightly - target: '$(Build.SourceVersion)' - addChangeLog: false - assetUploadMode: 'delete' - releaseNotesFile: $(System.DefaultWorkingDirectory)/releases/ReleaseNotes.md - assets: $(System.DefaultWorkingDirectory)/releases/*.* - - # ToDo: Non-nightly release - # - bash: | - # git tag $(SURGE_VERSION) - # git push origin $(SURGE_VERSION) - # displayName: "Create Github Tag for Stable" - # condition: eq(variables.SURGE_IS_MAIN, 'false') - - # - task: GitHubRelease@0 - # displayName: "Create Github Stable Release" - # condition: eq(variables.SURGE_IS_MAIN, 'false') - # inputs: - # gitHubConnection: surge-rackupdater - # repositoryName: surge-synthesizer/releases-xt - # action: 'create' - # tag: $(SURGE_VERSION) - # tagSource: 'auto' - # target: '$(Build.SourceVersion)' - # addChangeLog: false - # assetUploadMode: 'delete' - # releaseNotesFile: $(System.DefaultWorkingDirectory)/releases/ReleaseNotes.md - # assets: $(System.DefaultWorkingDirectory)/releases/*.* - - - - bash: | - # Finally tell discord - export GIT_LOG_DISP=`cat git_info/git_nightly_sc3_log_display | sed -e s/\"//g` - - curl -i -H "Accept: application/json" -H "Content-Type:application/json" -X POST --data "{\"content\": \"A ShortcircuitXT Nightly is available. Still pre-alpha, but many core things are starting to work.\n${GIT_LOG_DISP}\nhttps://github.com/surge-synthesizer/shortcircuit-xt/releases/tag/Nightly\"}" `cat $AGENT_TEMPDIRECTORY/discord-nightly-shortcircuit.webhook` - displayName: Tell Discord