linux package build files added, windows fixed #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/*/* | |