Skip to content

Commit

Permalink
update automation and release
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyvanoekel committed Oct 6, 2024
1 parent a28f6ad commit 6efaf2c
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 30 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/build-cmajor-windows.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build Cmajor Tools on Windows

on:
workflow_dispatch:

jobs:
build:
runs-on: windows-2019
steps:
- name: Checkout Cmajor
uses: actions/checkout@v4
with:
repository: cmajor-lang/cmajor
path: cmajor
fetch-depth: 1

- name: Convert submodule URLs from SSH to HTTPS and init
if: steps.cmajor-cache.outputs.cache-hit != 'true'
run: |
cd cmajor
git submodule deinit -f .
git config --global url."https://github.com/".insteadOf [email protected]:
git submodule update --init --recursive --depth 1
- name: Build Cmajor
run: |
cd cmajor
cmake -Bbuild -G "Visual Studio 16 2019" -A x64 .
cmake --build build --config Release
- name: Upload Cmajor Executable as Artifact
uses: actions/upload-artifact@v4
with:
name: cmaj-executable
path: ./cmajor/build/tools/command/Release/cmaj.exe
87 changes: 59 additions & 28 deletions .github/workflows/build-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,69 +7,100 @@ on:

jobs:
build:
runs-on: windows-latest
runs-on: windows-2019

steps:
- name: Checkout Cmajor
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: cmajor-lang/cmajor
path: cmajor
fetch-depth: 1

- name: Cache Cmajor Build
id: cmajor-cache
uses: actions/cache@v3
with:
path: cmajor/build
key: cmajor-build-${{ hashFiles('cmajor/**/CMakeLists.txt') }}-4

- name: Convert submodule URLs from SSH to HTTPS
if: steps.cmajor-cache.outputs.cache-hit != 'true'
run: |
cd cmajor
git submodule deinit -f .
git config --global url."https://github.com/".insteadOf [email protected]:
git submodule update --init --recursive --depth 1
- name: Build Cmajor if cache misses
if: steps.cmajor-cache.outputs.cache-hit != 'true'
run: |
cd cmajor
cmake -Bbuild -G "Visual Studio 17 2022" -A x64 .
cmake --build build --config Release
- name: Initialize choc
run: |
cd cmajor
git config --global url."https://github.com/".insteadOf [email protected]:
git submodule update --init --recursive --depth 1 -- include/choc
- name: Download Artifacts
uses: dawidd6/action-download-artifact@v6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build-cmajor-windows.yaml
name: cmaj-executable
path: ./cmajor/build/tools/command/Release

- name: Checkout current repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
path: src

- name: Checkout CLAP
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
repository: free-audio/clap
path: clap
fetch-depth: 1

# Juce builds a VST3 and stand-alone exe "successfully" but:
# - The VST3 is broken and doesn't show the gui, locally compiled VST3 does work. This should be solvable with some time and effort.
# - The exe is built without asio support and as windows audio is broken the resulting latency makes it unusable. Due to licensing BS this is unsolvable.
# Leaving the JUCE steps commented out for now.

# - name: Checkout JUCE
# uses: actions/checkout@v4
# with:
# repository: juce-framework/JUCE
# path: juce
# fetch-depth: 1

- name: Set Corrected Current Directory Path
shell: powershell
run: |
$currentDir = (Get-Location).Path -replace '\\', '/'
echo "CURRENT_DIR=$currentDir" >> $env:GITHUB_ENV
# - name: Set JUCE environment variable
# run: echo "JUCE_PATH=${{ env.CURRENT_DIR }}/juce" >> $GITHUB_ENV

- name: Generate CLAP Plugin
run: ./cmajor/build/tools/command/Release/cmaj.exe generate --target=clap --output=${{ github.workspace }}\\oscilluna-clap --clapIncludePath=${{ github.workspace }}\\clap\\include --cmajorIncludePath=${{ github.workspace }}\\cmajor\\include ${{ github.workspace }}\\src\\Oscilluna.cmajorpatch

- name: Generate Web Assembly
run: ./cmajor/build/tools/command/Release/cmaj.exe generate --target=webaudio-html --output=${{ github.workspace }}\\oscilluna-web --cmajorIncludePath=${{ github.workspace }}\\cmajor\\include ${{ github.workspace }}\\src\\Oscilluna.cmajorpatch

- name: Zip folder
run: |
Compress-Archive -Path ./oscilluna-web -DestinationPath ./oscilluna-web.zip
# - name: Generate Juce
# run: ./cmajor/build/tools/command/Release/cmaj.exe generate --target=juce --output=./oscilluna-juce --cmajorIncludePath=${{ env.CURRENT_DIR }}/cmajor/include ./src/Oscilluna.cmajorpatch

# - name: Directory Tree for oscilluna-web
# shell: pwsh
# run: |
# Get-ChildItem -Recurse oscilluna-web | Out-File -FilePath oscilluna-web-tree.txt
# Get-Content oscilluna-web-tree.txt

- name: Build CLAP plugin
run: |
cd oscilluna-clap
cmake -B build -DCLAP_INCLUDE_PATH="${{ github.workspace }}\\clap\\include" -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
# - name: Build JUCE
# run: |
# cd oscilluna-juce
# cmake -B build -DJUCE_PATH="${{ env.CURRENT_DIR }}/juce" -DCMAKE_BUILD_TYPE=Release
# cmake --build build --config Release

- name: Create release
uses: softprops/action-gh-release@v2
with:
files: oscilluna-clap/build/Release/Oscilluna.clap
files: |
oscilluna-clap/build/Release/Oscilluna.clap
oscilluna-web.zip
tag_name: ${{ github.ref_name }}
name: Oscilluna CLAP Plugin (Windows) - ${{ github.ref_name }}"
name: Oscilluna CLAP Plugin (Windows) - ${{ github.ref_name }}
prerelease: false
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
.DS_Store
/clap
/juce
/juce
/web
2 changes: 1 addition & 1 deletion Oscilluna.cmajorpatch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"CmajorVersion": 1,
"ID": "com.lily.oscilluna",
"version": "0.0.3",
"version": "0.0.4",
"name": "Oscilluna",
"description": "Oscilluna is a creative synthesizer that lets you draw custom waveshapes.",
"category": "generator",
Expand Down

0 comments on commit 6efaf2c

Please sign in to comment.