|
| 1 | +# Cetone Synth Series - GitHub Workflow |
| 2 | +# Based on Wasted Audio workflow (https://github.com/Wasted-Audio/wstd-eq/blob/master/.github/workflows/build.yml) |
| 3 | + |
| 4 | +name: build |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + |
| 9 | +jobs: |
| 10 | + linux-x86_64: |
| 11 | + runs-on: ubuntu-20.04 |
| 12 | + steps: |
| 13 | + - name: Checkout repository |
| 14 | + uses: actions/checkout@v3 |
| 15 | + with: |
| 16 | + submodules: recursive |
| 17 | + - name: Set up Python |
| 18 | + uses: actions/setup-python@v4 |
| 19 | + with: |
| 20 | + python-version: 3.9 |
| 21 | + - name: Install dependencies |
| 22 | + run: | |
| 23 | + sudo apt-get update -qq |
| 24 | + sudo apt-get install -yqq libgl1-mesa-dev |
| 25 | +
|
| 26 | + - name: Build plugins |
| 27 | + run: | |
| 28 | + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release |
| 29 | + make -C build -j $(nproc) |
| 30 | +
|
| 31 | + - name: Set sha8 (non-release) |
| 32 | + if: startsWith(github.ref, 'refs/tags/') != true |
| 33 | + id: slug1 |
| 34 | + run: echo "action_tag=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV |
| 35 | + - name: Set tag (release) |
| 36 | + if: startsWith(github.ref, 'refs/tags/') |
| 37 | + id: slug2 |
| 38 | + run: echo "action_tag=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV |
| 39 | + |
| 40 | + - name: Pack binaries |
| 41 | + run: | |
| 42 | + cd build |
| 43 | + mv bin ${{ github.event.repository.name }} |
| 44 | + tar -c -h -z -f ${{ github.event.repository.name }}-linux-x86_64-${{ github.event.pull_request.number || env.action_tag }}.tar.gz ${{ github.event.repository.name }}/ |
| 45 | + - uses: actions/upload-artifact@v4 |
| 46 | + with: |
| 47 | + name: ${{ github.event.repository.name }}-linux-x86_64-${{ github.event.pull_request.number || env.action_tag }} |
| 48 | + path: | |
| 49 | + build/*.tar.gz |
| 50 | +
|
| 51 | + - uses: softprops/action-gh-release@v1 |
| 52 | + if: startsWith(github.ref, 'refs/tags/') |
| 53 | + with: |
| 54 | + tag_name: ${{ github.ref_name }} |
| 55 | + name: ${{ github.ref_name }} |
| 56 | + draft: false |
| 57 | + prerelease: false |
| 58 | + # files: | |
| 59 | + # WSTD_DL3Y/*.tar.gz |
| 60 | + |
| 61 | + win64: |
| 62 | + runs-on: ubuntu-20.04 |
| 63 | + steps: |
| 64 | + - name: Checkout repository |
| 65 | + uses: actions/checkout@v3 |
| 66 | + with: |
| 67 | + submodules: recursive |
| 68 | + |
| 69 | + - name: Install dependencies |
| 70 | + run: | |
| 71 | + sudo apt-get update -qq |
| 72 | + sudo apt-get install -yqq binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 wine-stable |
| 73 | + - name: Deal with File does not contain a valid CIL image error |
| 74 | + run: | |
| 75 | + # See: https://github.com/orgs/community/discussions/64826 for more details. |
| 76 | + sudo apt remove --purge --auto-remove mono-runtime |
| 77 | + sudo apt-get install wine-binfmt |
| 78 | +
|
| 79 | + - name: Build win64 cross-compiled plugins |
| 80 | + env: |
| 81 | + EXE_WRAPPER: wine |
| 82 | + PKG_CONFIG: "false" |
| 83 | + WINEDEBUG: "-all" |
| 84 | + run: | |
| 85 | + echo "SET(CMAKE_SYSTEM_NAME Windows)" > windows-cross-build.cmake |
| 86 | + echo "SET(CMAKE_SYSTEM_PROCESSOR x86_64)" >> windows-cross-build.cmake |
| 87 | + echo "SET(CMAKE_C_COMPILER /usr/bin/x86_64-w64-mingw32-gcc)" >> windows-cross-build.cmake |
| 88 | + echo "SET(CMAKE_CXX_COMPILER /usr/bin/x86_64-w64-mingw32-g++)" >> windows-cross-build.cmake |
| 89 | + echo "SET(CMAKE_RC_COMPILER /usr/bin/x86_64-w64-mingw32-windres)" >> windows-cross-build.cmake |
| 90 | + echo "SET(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32/)" >> windows-cross-build.cmake |
| 91 | + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=windows-cross-build.cmake |
| 92 | + make -C build -j $(nproc) |
| 93 | +
|
| 94 | + - name: Set sha8 (non-release) |
| 95 | + if: startsWith(github.ref, 'refs/tags/') != true |
| 96 | + id: slug1 |
| 97 | + run: echo "action_tag=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV |
| 98 | + - name: Set tag (release) |
| 99 | + if: startsWith(github.ref, 'refs/tags/') |
| 100 | + id: slug2 |
| 101 | + run: echo "action_tag=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV |
| 102 | + - name: Pack binaries |
| 103 | + run: | |
| 104 | + cd build |
| 105 | + mv bin ${{ github.event.repository.name }} |
| 106 | + tar -c -h -z -f ${{ github.event.repository.name }}-win64-${{ github.event.pull_request.number || env.action_tag }}.tar.gz ${{ github.event.repository.name }}/ |
| 107 | + - uses: actions/upload-artifact@v4 |
| 108 | + with: |
| 109 | + name: ${{ github.event.repository.name }}-win64-${{ github.event.pull_request.number || env.action_tag }} |
| 110 | + path: | |
| 111 | + build/*.tar.gz |
| 112 | +
|
| 113 | + - uses: softprops/action-gh-release@v1 |
| 114 | + if: startsWith(github.ref, 'refs/tags/') |
| 115 | + with: |
| 116 | + tag_name: ${{ github.ref_name }} |
| 117 | + name: ${{ github.ref_name }} |
| 118 | + draft: false |
| 119 | + prerelease: false |
| 120 | + # files: | |
| 121 | + # WSTD_DL3Y/*.tar.gz |
| 122 | + |
| 123 | + macos-universal: |
| 124 | + runs-on: macos-14 |
| 125 | + steps: |
| 126 | + - uses: actions/checkout@v3 |
| 127 | + with: |
| 128 | + submodules: recursive |
| 129 | + |
| 130 | + - name: Install dependencies |
| 131 | + run: | |
| 132 | + echo "No need to install dependencies on macOS." |
| 133 | +
|
| 134 | + - name: Build macOS universal plugins |
| 135 | + env: |
| 136 | + CFLAGS: -arch x86_64 -arch arm64 -mtune=generic -msse -msse2 |
| 137 | + CXXFLAGS: -arch x86_64 -arch arm64 -mtune=generic -msse -msse2 |
| 138 | + LDFLAGS: -arch x86_64 -arch arm64 |
| 139 | + run: | |
| 140 | + cmake -S . -B build -DCMAKE_BUILD_TYPE=Release |
| 141 | + make -C build NOOPT=true -j $(sysctl -n hw.logicalcpu) |
| 142 | + cd build && ../dpf/utils/package-osx-bundles.sh |
| 143 | +
|
| 144 | + - name: Set sha8 (non-release) |
| 145 | + if: startsWith(github.ref, 'refs/tags/') != true |
| 146 | + id: slug1 |
| 147 | + run: echo "action_tag=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV |
| 148 | + - name: Set tag (release) |
| 149 | + if: startsWith(github.ref, 'refs/tags/') |
| 150 | + id: slug2 |
| 151 | + run: echo "action_tag=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV |
| 152 | + |
| 153 | + - uses: actions/upload-artifact@v4 |
| 154 | + with: |
| 155 | + name: ${{ github.event.repository.name }}-macOS-universal-${{ github.event.pull_request.number || env.action_tag }} |
| 156 | + path: | |
| 157 | + build/*-macOS.pkg |
| 158 | +
|
| 159 | + - uses: softprops/action-gh-release@v1 |
| 160 | + if: startsWith(github.ref, 'refs/tags/') |
| 161 | + with: |
| 162 | + tag_name: ${{ github.ref_name }} |
| 163 | + name: ${{ github.ref_name }} |
| 164 | + draft: false |
| 165 | + prerelease: false |
| 166 | + # files: | |
| 167 | + # WSTD_DL3Y/*-macOS.pkg |
0 commit comments