Build using Github actions

Hi everyone,

I am very new to JUCE so be patient with me.
I have a JUCE plugin and I would like to implement CI/CD for it using Github actions. My final goal is to have my plugin built, signed and deployed automatically.
For the signed part, I already wrote a shell script to sign it, notarize it, check its status and staple (all for Mac OS) so I think that part should be fine.
But for the build part I am not sure what I am doing wrong. There is a topic on the issue (Continuous Integration with CMake + GitHub Actions) which I followed but I do not know if I have followed it correctly.
Here’s the steps I learned from the previous topic to take using github actions

  1. checkout my repo (my plugin app)
  2. checkout JUCE: we want to use this to build our plugin with it
  3. create a build environment with juce
  4. create JUCE configuration and JUCE build environment
  5. create build environment for the plugin

My yml file is as displayed below

name: MyPluginName
on: [push]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [macos-latest]
steps:
- name: “Preparation”
uses: actions/checkout@v2

    - name: "(JUCE) Clone Repository"
      uses: actions/checkout@v2
      with:
        repository: juce-framework/JUCE
        path: ${{runner.workspace}}/myRepo/JUCE

    - name: "(JUCE) Create Build Environment"
      working-directory: ${{runner.workspace}}/myRepo/JUCE
      run: cmake -E make_directory ${{runner.workspace}}/myRepo/JUCE/build

    - name: "(JUCE) Configuration"
      working-directory: ${{runner.workspace}}/myRepo/JUCE/build
      run: cmake ${{runner.workspace}}/myRepo/JUCE

    - name: "(JUCE) Build"
      working-directory: ${{runner.workspace}}/myRepo/JUCE/build
      run: cmake --build .

    - name: "(MyPluginName) Create Build Environment"
      working-directory: ${{runner.workspace}}/MyPluginName
      run: cmake -E make_directory ${{runner.workspace}}/build

    - name: "(MyPluginName) Configuration"
      working-directory: ${{runner.workspace}}/myRepo/build
      run: cmake ${{runner.workspace}}/myRepo

    - name: "(MyPluginName) Build"
      working-directory: ${{runner.workspace}}/myRepo/build
      run: cmake --build . --config $BUILD_TYPE

It keeps failing at (MyPluginName) Create Build Environment because of
Run cmake -E make_directory /Users/runner/work/bc_wtih_actions/build
** cmake -E make_directory /Users/runner/work/bc_wtih_actions/build**
** shell: /bin/bash -e {0}**
** env:**
** BUILD_TYPE: Release**
** Error: No such file or directory**

Does anyone have any idea how to fix it? Anyone has a working sample of it? I would very much appreciate it.
Thank you

PS: there is a chance that my approach has not been correct. Any guidance on that would also be appreciated.

For your issue, maybe add JUCE as a submodule?

You don’t need to do step 2-4, check out Pamplejuce by @sudara for a great example on how to do this.

I build and test with a bash script since it’s way easier to debug locally and I would do this as much as possible.
GPT 4 is pretty good at translating GH actions to bash/Powershell if you need a point to get started with these.

1 Like