| 1 |
name: Build And Publish |
| 2 |
on: |
| 3 |
push: |
| 4 |
branches: |
| 5 |
- master |
| 6 |
- develop |
| 7 |
env: |
| 8 |
PACKAGENAME: CsoundQt |
| 9 |
jobs: |
| 10 |
buildjob: |
| 11 |
name: Build CsoundQt on ${{ matrix.os }} |
| 12 |
runs-on: ${{ matrix.os }} |
| 13 |
strategy: |
| 14 |
matrix: |
| 15 |
|
| 16 |
os: [macos-latest] |
| 17 |
include: |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
- os: macos-latest |
| 23 |
triplet: x64-osx |
| 24 |
|
| 25 |
|
| 26 |
steps: |
| 27 |
- name: Checkout repository |
| 28 |
uses: actions/checkout@v4 |
| 29 |
with: |
| 30 |
submodules: true |
| 31 |
|
| 32 |
- name: update submodules |
| 33 |
run: | |
| 34 |
echo "Calling git submodule update" |
| 35 |
git submodule update --init --recursive |
| 36 |
git submodule status --recursive |
| 37 |
|
| 38 |
echo "Finished submodules" |
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
- name: macos build |
| 46 |
if: runner.os == 'macOS' |
| 47 |
run: | |
| 48 |
set -o xtrace # echo each command before it is executed |
| 49 |
|
| 50 |
brew update |
| 51 |
brew install csound |
| 52 |
brew install qt5 |
| 53 |
brew link qt5 --force |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
csound_brew_root=$(brew --prefix csound) |
| 58 |
echo "Csound brew root: $csound_brew_root" |
| 59 |
|
| 60 |
# download missing csPerthread.hpp |
| 61 |
curl -o $csound_brew_root/Frameworks/CsoundLib64.framework/Versions/6.0/Headers/csPerfThread.hpp https://raw.githubusercontent.com/csound/csound/master/interfaces/csPerfThread.hpp |
| 62 |
|
| 63 |
ls -R "$csound_brew_root" |
| 64 |
|
| 65 |
# qmake CONFIG+=rtmidi CONFIG+=release CSOUND_LIBRARY_DIR+="$csound_lib" qcs.pro |
| 66 |
qmake CONFIG+=rtmidi CONFIG+=release qcs.pro |
| 67 |
make -j4 |
| 68 |
make install_first |
| 69 |
make install_pythonlinks |
| 70 |
# not sure if cocoa and printsupport are necessary any more... |
| 71 |
|
| 72 |
# remove Csound from bundle |
| 73 |
rm -fr bin/CsoundQt-d-cs6.app/Contents/Frameworks/CsoundLib64.framework |
| 74 |
|
| 75 |
install_name_tool -change @executable_path/../Frameworks/libcsnd6.6.0.dylib libcsnd6.6.0.dylib bin/CsoundQt-d-cs6.app/Contents/MacOS/CsoundQt-d-cs6 |
| 76 |
install_name_tool -change /usr/local/opt/csound/Frameworks/CsoundLib64.framework/Versions/6.0/CsoundLib64 CsoundLib64.framework/Versions/6.0/CsoundLib64 bin/CsoundQt-d-cs6.app/Contents/MacOS/CsoundQt-d-cs6 |
| 77 |
|
| 78 |
otool -L bin/CsoundQt-d-cs6.app/Contents/MacOS/CsoundQt-d-cs6 |
| 79 |
|
| 80 |
hdiutil create -fs HFS+ -srcfolder bin/CsoundQt-d-cs6.app -volname CsoundQt CsoundQt.dmg |
| 81 |
|
| 82 |
#macdeployqt bin/CsoundQt-d-cs6.app -qmldir=src/QML -dmg |
| 83 |
|
| 84 |
|
| 85 |
find . |
| 86 |
|
| 87 |
#echo "mkdir build-macos" |
| 88 |
#mkdir build-macos |
| 89 |
#echo "copying app to build-macos" |
| 90 |
#cp -r bin/CsoundQt-d-cs6.app build-macos |
| 91 |
#echo "Creating .dmg file" |
| 92 |
#hdiutil create -fs HFS+ -srcfolder build-macos -volname CsoundQt "CsoundQt.dmg" |
| 93 |
|
| 94 |
echo "Creating artifacts folder" |
| 95 |
mkdir -p artifacts |
| 96 |
echo "Copying .dmg to artifacts" |
| 97 |
cp CsoundQt.dmg artifacts |
| 98 |
echo "Listing artifacts" |
| 99 |
ls artifacts |
| 100 |
echo "ready!" |
| 101 |
|
| 102 |
|
| 103 |
- name: linux build |
| 104 |
if: runner.os == 'linux' |
| 105 |
run: | |
| 106 |
sudo apt update |
| 107 |
|
| 108 |
|
| 109 |
echo "--- Root dir ---" |
| 110 |
ls |
| 111 |
|
| 112 |
rm -fr build-linux |
| 113 |
mkdir build-linux |
| 114 |
cd build-linux |
| 115 |
|
| 116 |
- uses: actions/upload-artifact@v4 |
| 117 |
with: |
| 118 |
name: CsoundQt |
| 119 |
path: artifacts/* |
| 120 |
|
| 121 |
publish: |
| 122 |
name: Publish artifacts as a Pre-Release |
| 123 |
|
| 124 |
needs: [buildjob] |
| 125 |
runs-on: ubuntu-latest |
| 126 |
steps: |
| 127 |
- uses: actions/checkout@v4 |
| 128 |
|
| 129 |
- name: Load Release URL File from release job |
| 130 |
uses: actions/download-artifact@v4 |
| 131 |
with: |
| 132 |
name: CsoundQt |
| 133 |
path: artifacts |
| 134 |
|
| 135 |
- name: List files |
| 136 |
run: | |
| 137 |
ls -R |
| 138 |
|
| 139 |
- name: Publish |
| 140 |
uses: "marvinpinto/action-automatic-releases@latest" |
| 141 |
with: |
| 142 |
repo_token: "${{ secrets.GITHUB_TOKEN }}" |
| 143 |
automatic_release_tag: "latest" |
| 144 |
title: "Development Build" |
| 145 |
prerelease: True |
| 146 |
files: | |
| 147 |
artifacts/* |
| 148 |
|