Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Towards an installer and a nightly #4

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ jobs:
- name: windows x64
os: windows-latest

- name: windows arm64ec
os: windows-latest
cmakeConfig: -G"Visual Studio 17 2022" -A arm64ec -DCMAKE_SYSTEM_VERSION=10

- name: macOS
os: macos-latest
cmakeConfig: -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64"
Expand All @@ -40,7 +36,7 @@ jobs:
- name: Build pull request version
run: |
cmake -S . -B ./build ${{ matrix.cmakeConfig }} -DCMAKE_BUILD_TYPE=Debug -DJI_LATTICE_COPY_AFTER_BUILD=FALSE
cmake --build ./build --config Debug --target ji-lattice-plugin-installer --parallel 3
cmake --build ./build --config Debug --target ji-lattice-installer --parallel 3

build_plugin_lindoc:
name: PR - U20 Docker
Expand All @@ -58,7 +54,7 @@ jobs:
username: ${{ github.actor }}
token: ${{ secrets.GITHUB_TOKEN }}
cmakeArgs: -DCMAKE_BUILD_TYPE=Debug -GNinja -DJI_LATTICE_COPY_AFTER_BUILD=FALSE
target: ji-lattice-plugin-installer
target: ji-lattice-installer

- name: Confirm Build
run: |
Expand Down
141 changes: 141 additions & 0 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
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
- os: macos-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 }}
gccversion: 9

- 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 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
cmake --build ./build --config Release --target ji-lattice-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 }}

build_plugin_docker:
name: Docker Build Ubuntu20 ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: JILattice
installer_dir: linux-docker

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: recursive

- name: Build in Docker
uses: surge-synthesizer/sst-githubactions/cmake-in-docker@main
with:
image: ghcr.io/surge-synthesizer/sst-dockerimages/ubuntu20_gcc11:main
username: ${{ github.actor }}
token: ${{ secrets.GITHUB_TOKEN }}
cmakeArgs: -DCMAKE_BUILD_TYPE=Release -GNinja
target: ji-lattice-installer


- name: Show Installer Directory
run: |
ls -l ./build/installer

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: build/installer
name: build-docker-${{matrix.installer_dir }}

publish-ji-lattice-nightly:
name: Publish JI Lattice 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_OTHER_WEBHOOK }}
tag: Nightly
title: "A New JI Lattice Nightly is Available"


publish-ji-lattice-release:
name: Publish JI Lattice 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_OTHER_WEBHOOK }}
tag: ${{ github.ref_name }}
title: "A New JI Lattice Release is Available"
subtitle: "Release ${{ github.ref_name }}"

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
path = libs/melatonin_inspector
url = https://github.com/sudara/melatonin_inspector.git
branch = main
[submodule "libs/sst/sst-plugininfra"]
path = libs/sst/sst-plugininfra
url = https://github.com/surge-synthesizer/sst-plugininfra.git
21 changes: 15 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@ option(JI_LATTICE_COPY_AFTER_BUILD "Copy the plugin after build" TRUE)
include (cmake/CPM.cmake)

CPMAddPackage("gh:juce-framework/JUCE#8.0.4")
CPMAddPackage("gh:free-audio/clap-juce-extensions#main")

# Set this here so we can use it in installer also
set(PRODUCT_NAME "Lattices")

juce_add_plugin(${PROJECT_NAME}
PRODUCT_NAME "Lattices"
COMPANY_NAME "TBD Tuners"
BUNDLE_ID "org.tbd.tuners.lattices"
PLUGIN_MANUFACTURER_CODE TbdL
PRODUCT_NAME ${PRODUCT_NAME}
COMPANY_NAME "Surge Synth Team"
BUNDLE_ID "org.surge-synth-team.ji-lattice-plugin"
PLUGIN_MANUFACTURER_CODE VmbA
PLUGIN_CODE LatT

IS_SYNTH TRUE
Expand All @@ -32,6 +36,12 @@ juce_add_plugin(${PROJECT_NAME}
COPY_PLUGIN_AFTER_BUILD ${JI_LATTICE_COPY_AFTER_BUILD}
)

clap_juce_extensions_plugin(TARGET ${PROJECT_NAME}
CLAP_ID "org.sure-synth-team.ji-lattice-plugin.clap"
CLAP_FEATURES "instrument" microtonal "just intonation")



juce_add_binary_data(lattices-binary
NAMESPACE LatticesBinary
HEADER_NAME LatticesBinary.h
Expand Down Expand Up @@ -86,5 +96,4 @@ target_link_libraries(${PROJECT_NAME} PRIVATE
# lattices-assets
)

add_custom_target(${PROJECT_NAME}-installer)
add_dependencies(${PROJECT_NAME}-installer ${PROJECT_NAME}_All)
include(cmake/basic-installer.cmake)
File renamed without changes.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

The code in this repo builds a microtonal control plugin which makes extended Just Intonation easy to explore on regular 12-note interfaces. A baseline was put down by BaconPaul in early 2023, which I (Andreya) have been building on in the second half of 2024. It is currently in Alpha. More on that below.

![A screenshot of the plugin](resources/LatticesSegmentScreenshot.png)

Lattices works by tuning nearby synths to Just Intonation by acting as an **MTS-ESP source** (for more info on what that means, [click here](https://surge-synthesizer.github.io/tuning-guide/#mts-esp)), and displaying a **lattice pattern** that help navigate the harmonic possibilities.

Expand Down
123 changes: 123 additions & 0 deletions cmake/basic-installer.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
# A basic installer setup.
#
# This cmake file introduces two targets
# ji-lattice-products: moves all the built assets to a well named directory
# ji-lattice-installer: depends on ji-lattice-products, builds an installer
#
# Right now ji-lattice-installer builds just the crudest zip file but this is the target
# on which we will hang the proper installers later

set(JI_LATTICE_PRODUCT_DIR ${CMAKE_BINARY_DIR}/ji-lattice-products)
message(STATUS "Setting up installer for ${PRODUCT_NAME} into ${JI_LATTICE_PRODUCT_DIR}")
file(MAKE_DIRECTORY ${JI_LATTICE_PRODUCT_DIR})

add_custom_target(ji-lattice-products ALL)
add_custom_target(ji-lattice-installer)

function(ji_lattice_package format)
get_target_property(output_dir ji-lattice-plugin RUNTIME_OUTPUT_DIRECTORY)

if (TARGET ji-lattice-plugin_${format})
add_dependencies(ji-lattice-products ji-lattice-plugin_${format})
add_custom_command(
TARGET ji-lattice-products
POST_BUILD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND echo "Installing ${output_dir}/${format} to ${JI_LATTICE_PRODUCT_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy_directory ${output_dir}/${format}/ ${JI_LATTICE_PRODUCT_DIR}/
)
endif ()
endfunction()

ji_lattice_package(VST3)
ji_lattice_package(VST)
ji_lattice_package(LV2)
ji_lattice_package(AU)
ji_lattice_package(CLAP)
ji_lattice_package(Standalone)

if (WIN32)
message(STATUS "Including special windows cleanup installer stage")
add_custom_command(TARGET ji-lattice-products
POST_BUILD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND} -E echo "Cleaning up windows goobits"
COMMAND ${CMAKE_COMMAND} -E rm -f "${JI_LATTICE_PRODUCT_DIR}/${PRODUCT_NAME}.exp"
COMMAND ${CMAKE_COMMAND} -E rm -f "${JI_LATTICE_PRODUCT_DIR}/${PRODUCT_NAME}.ilk"
COMMAND ${CMAKE_COMMAND} -E rm -f "${JI_LATTICE_PRODUCT_DIR}/${PRODUCT_NAME}.lib"
COMMAND ${CMAKE_COMMAND} -E rm -f "${JI_LATTICE_PRODUCT_DIR}/${PRODUCT_NAME}.pdb"
)
endif ()

add_dependencies(ji-lattice-installer ji-lattice-products)

add_custom_command(
TARGET ji-lattice-installer
POST_BUILD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND echo "Installing LICENSE and so forth to ${JI_LATTICE_PRODUCT_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/resources/LICENSE.distribution ${JI_LATTICE_PRODUCT_DIR}/LICENSE
# COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/Installer/ZipReadme.txt ${JI_LATTICE_PRODUCT_DIR}/Readme.txt
)

find_package(Git)

if (Git_FOUND)
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --short HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE VERSION_CHUNK
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else ()
set(VERSION_CHUNK "unknownhash")
endif ()

string(TIMESTAMP JI_LATTICE_DATE "%Y-%m-%d")
if (WIN32)
set(JI_LATTICE_ZIP JI-Lattice-${JI_LATTICE_DATE}-${VERSION_CHUNK}-${CMAKE_SYSTEM_NAME}-${BITS}bit.zip)
else ()
set(JI_LATTICE_ZIP JI-Lattice-${JI_LATTICE_DATE}-${VERSION_CHUNK}-${CMAKE_SYSTEM_NAME}.zip)
endif ()


if (APPLE)
message(STATUS "Configuring for mac installer.")
add_custom_command(
TARGET ji-lattice-installer
POST_BUILD
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory installer
COMMAND ${CMAKE_SOURCE_DIR}/libs/sst/sst-plugininfra/scripts/installer_mac/make_installer.sh "${PRODUCT_NAME}" ${CMAKE_BINARY_DIR}/ji-lattice-products ${CMAKE_SOURCE_DIR}/resources/installer_mac ${CMAKE_BINARY_DIR}/installer "${JI_LATTICE_DATE}-${VERSION_CHUNK}"
)
elseif (WIN32)
message(STATUS "Configuring for win installer")
add_custom_command(
TARGET ji-lattice-installer
POST_BUILD
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory installer
COMMAND 7z a -r installer/${JI_LATTICE_ZIP} ${JI_LATTICE_PRODUCT_DIR}/
COMMAND ${CMAKE_COMMAND} -E echo "ZIP Installer in: installer/${JI_LATTICE_ZIP}")
find_program(JI_LATTICE_NUGET_EXE nuget.exe PATHS ENV "PATH")
if(JI_LATTICE_NUGET_EXE)
message(STATUS "NuGet found at ${JI_LATTICE_NUGET_EXE}")
add_custom_command(
TARGET ji-lattice-installer
POST_BUILD
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${JI_LATTICE_NUGET_EXE} install Tools.InnoSetup -version 6.2.1
COMMAND Tools.InnoSetup.6.2.1/tools/iscc.exe /O"installer" /DJI_LATTICE_SRC="${CMAKE_SOURCE_DIR}" /DJI_LATTICE_BIN="${CMAKE_BINARY_DIR}" /DMyAppVersion="${JI_LATTICE_DATE}-${VERSION_CHUNK}" "${CMAKE_SOURCE_DIR}/resources/installer_win/jilattice64.iss")
else()
message(STATUS "NuGet not found")
endif()
else ()
message(STATUS "Basic Installer: Target is installer/${JI_LATTICE_ZIP}")
add_custom_command(
TARGET ji-lattice-installer
POST_BUILD
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} -E make_directory installer
COMMAND ${CMAKE_COMMAND} -E tar cvf installer/${JI_LATTICE_ZIP} --format=zip ${JI_LATTICE_PRODUCT_DIR}/
COMMAND ${CMAKE_COMMAND} -E echo "Installer in: installer/${JI_LATTICE_ZIP}")
endif ()
1 change: 1 addition & 0 deletions libs/sst/sst-plugininfra
Submodule sst-plugininfra added at 4ef383
Loading
Loading