Skip to content

Commit

Permalink
Merge pull request #2 from schweizerweb/cmake
Browse files Browse the repository at this point in the history
Cmake
  • Loading branch information
schweizerweb authored Sep 19, 2023
2 parents d6a4f4a + 1a24177 commit dfb87e4
Show file tree
Hide file tree
Showing 291 changed files with 9,876 additions and 11,340 deletions.
85 changes: 85 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: CI on multiple platforms

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false

# build on
# Windows: cl
# MacOS: clang/clang++
# Ubuntu: clang/clang++ & gcc/g++
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
build_type: [Release]
c_compiler: [gcc, clang, cl]
include:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
name: Windows
- os: ubuntu-latest
c_compiler: gcc
cpp_compiler: g++
name: Linux
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
name: Linux
- os: macos-latest
c_compiler: clang
cpp_compiler: clang++
name: macOS
exclude:
- os: windows-latest
c_compiler: gcc
- os: windows-latest
c_compiler: clang
- os: ubuntu-latest
c_compiler: cl
- os: macos-latest
c_compiler: cl
- os: macos-latest
c_compiler: gcc

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- if: ${{ runner.os == 'Linux' }}
name: Install JUCE dependencies (Linux only)
id: juce_dependencies
run: |
sudo apt-get update
sudo apt-get install -y g++ libgtk-3-dev libgtk2.0-dev libwebkit2gtk-4.0-dev webkit2gtk-4.0 libfreetype6-dev libx11-dev libxinerama-dev libxrandr-dev libxcursor-dev mesa-common-dev libasound2-dev freeglut3-dev libxcomposite-dev libcurl4-openssl-dev
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}

- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config ${{ matrix.build_type }}

23 changes: 23 additions & 0 deletions .github/workflows/gitlab-mirror.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: GitLab Auto-Mirror

on: [push, delete]

env:
MIRRORING_BASE_URL: gitlab.zhdk.ch
MIRRORING_ORG_NAME: icst-github-mirror
MIRRORING_REPO_NAME: ${{ github.event.repository.name }}

jobs:
mirror_to_gitlab:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url:
git@${{ env.MIRRORING_BASE_URL }}:${{ env.MIRRORING_ORG_NAME }}/${{ env.MIRRORING_REPO_NAME }}.git
ssh_private_key:
${{ secrets.GITLAB_MIRROR_SSH_PRIVATE_KEY }}
146 changes: 146 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: Release for multiple platforms

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+.[0-9]+'

workflow_dispatch:
inputs:
version:
description: Release Version
default: 0.0.0.1
required: true

jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.VERSION }}
hasTweak: ${{ steps.get_version.outputs.HASTWEAK }}
steps:
- name: Get the version
id: get_version
shell: bash
run: |
[ "${{github.event_name}}" == "workflow_dispatch" ] && v=${{github.event.inputs.version}} || v=${GITHUB_REF/refs\/tags\//}
va=${v}
if [[ ${va} =~ [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ ]]; then hasTweak=true; else hasTweak=false; fi
echo "HASTWEAK=${hasTweak}" >> "$GITHUB_OUTPUT"
echo "VERSION=${va}" >> "$GITHUB_OUTPUT"
build:
needs: prepare
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false

# build on
# Windows: cl
# MacOS: clang/clang++
# Ubuntu: clang/clang++
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
build_type: [Release]
c_compiler: [clang, cl]
include:
- os: windows-latest
c_compiler: cl
cpp_compiler: cl
name: Windows
- os: ubuntu-latest
c_compiler: clang
cpp_compiler: clang++
name: Linux
- os: macos-latest
c_compiler: clang
cpp_compiler: clang++
name: macOS
exclude:
- os: windows-latest
c_compiler: clang
- os: ubuntu-latest
c_compiler: cl
- os: macos-latest
c_compiler: cl

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- if: ${{ runner.os == 'Linux' }}
name: Install JUCE dependencies (Linux only)
id: juce_dependencies
run: |
sudo apt-get update
sudo apt-get install -y g++ libgtk-3-dev libgtk2.0-dev libwebkit2gtk-4.0-dev webkit2gtk-4.0 libfreetype6-dev libx11-dev libxinerama-dev libxrandr-dev libxcursor-dev mesa-common-dev libasound2-dev freeglut3-dev libxcomposite-dev libcurl4-openssl-dev
- name: Set Project Version
shell: bash
run: |
sed -i.bak "s/.*#version_replacement_tag#.*/VERSION ${{ needs.prepare.outputs.version }}/" CMakeLists.txt
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_C_COMPILER=${{ matrix.c_compiler }}
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-S ${{ github.workspace }}
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}

- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config ${{ matrix.build_type }}

- if: ${{ runner.os == 'macOS' }}
name: Install packagesbuild
shell: bash
run: |
wget http://s.sudre.free.fr/Software/files/Packages.dmg
hdiutil attach Packages.dmg -mountpoint "/Volumes/PackagesTmp"
sudo installer -package "/Volumes/PackagesTmp/Install Packages.pkg" -target /
hdiutil detach /Volumes/PackagesTmp
- name: Build Installer
shell: bash
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ../Setup/build_installer.sh -p ${{ matrix.name }} -t "${{ needs.prepare.outputs.version }}" -n "ICST_AmbiPlugins_${{ matrix.name }}_${{ needs.prepare.outputs.version }}"

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}
path: ${{ steps.strings.outputs.build-output-dir }}/packages/*

publish:
name: Publish Release
needs: [prepare, build]
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Download artiacts
uses: actions/download-artifact@v3
with:
path: artifacts

- name: Release
uses: softprops/action-gh-release@v1
with:
name: ${{ needs.prepare.outputs.version }}
prerelease: ${{ needs.prepare.outputs.hasTweak }}
files: |
artifacts/*/*
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Encoder/Builds/
Encoder/JuceLibraryCode/
bin/
packages/
build/
*AutoGen.jucer
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "JUCE"]
path = JUCE
url = https://github.com/juce-framework/JUCE.git
branch = master
Loading

0 comments on commit dfb87e4

Please sign in to comment.