jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

171 lines
6.2KB

  1. name: build
  2. on:
  3. push:
  4. branches:
  5. - '*'
  6. pull_request:
  7. branches:
  8. - '*'
  9. env:
  10. CACHE_VERSION: 20250801
  11. PAWPAW_VERSION: 8b1198b3b9c7f01d4466e82d2cc6947da855d594
  12. PAWPAW_SKIP_LTO: 1
  13. jobs:
  14. macos:
  15. strategy:
  16. matrix:
  17. target: [intel, universal]
  18. runs-on: macos-13
  19. steps:
  20. - uses: actions/checkout@v4
  21. with:
  22. submodules: recursive
  23. - name: Set up cache
  24. uses: actions/cache@v4
  25. with:
  26. path: |
  27. ~/PawPawBuilds
  28. key: macos-${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  29. - name: Set up dependencies
  30. run: |
  31. brew install cmake jq meson
  32. - name: Bootstrap dependencies
  33. shell: bash
  34. run: |
  35. if [ ! -d PawPaw ]; then
  36. git clone https://github.com/DISTRHO/PawPaw.git
  37. git -C PawPaw checkout ${PAWPAW_VERSION}
  38. fi
  39. ./PawPaw/.github/workflows/bootstrap-deps.sh macos-${{ matrix.target }}
  40. ./PawPaw/bootstrap-jack2.sh macos-${{ matrix.target }}
  41. ./PawPaw/.cleanup.sh macos-${{ matrix.target }}
  42. - name: Build jack2
  43. shell: bash
  44. run: |
  45. pushd PawPaw && source local.env macos-${{ matrix.target }} && popd
  46. python ./waf configure --platform=darwin --prefix=/usr/local
  47. python ./waf build -j $(sysctl -n hw.logicalcpu)
  48. python ./waf install --destdir=$(pwd)/destdir
  49. - name: Set sha8 (non-release)
  50. if: startsWith(github.ref, 'refs/tags/') != true
  51. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  52. - name: Set sha8 (release)
  53. if: startsWith(github.ref, 'refs/tags/')
  54. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  55. - name: Generate macOS package
  56. shell: bash
  57. run: |
  58. ./macosx/generate-pkg.sh $(pwd)/destdir/usr/local ${{ github.event.pull_request.number || env.SHA8 }}
  59. - uses: actions/upload-artifact@v4
  60. with:
  61. name: jack2-macOS-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  62. path: macosx/jack2-osx-*.pkg
  63. windows:
  64. strategy:
  65. matrix:
  66. target: [win32, win64]
  67. runs-on: ubuntu-22.04
  68. steps:
  69. - uses: actions/checkout@v4
  70. with:
  71. submodules: recursive
  72. - name: Set up cache
  73. uses: actions/cache@v4
  74. with:
  75. path: |
  76. ~/PawPawBuilds
  77. key: ${{ matrix.target }}-v${{ env.CACHE_VERSION }}
  78. - name: Restore debian packages cache
  79. shell: bash
  80. run: |
  81. if [ -d ~/PawPawBuilds/debs ] && [ "$(ls ~/PawPawBuilds/debs | wc -l)" -ne 0 ]; then
  82. sudo cp ~/PawPawBuilds/debs/*.deb /var/cache/apt/archives/;
  83. fi
  84. - name: Fix GitHub's mess
  85. shell: bash
  86. run: |
  87. sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
  88. sudo dpkg --add-architecture i386
  89. sudo apt-get update -qq
  90. sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386
  91. - name: Set up dependencies
  92. shell: bash
  93. run: |
  94. if [ ! -d PawPaw ]; then
  95. git clone https://github.com/DISTRHO/PawPaw.git
  96. git -C PawPaw checkout ${PAWPAW_VERSION}
  97. fi
  98. sudo ./PawPaw/.github/workflows/bootstrap-deps.sh ${{ matrix.target }}
  99. sudo apt-get install -y build-essential llvm xvfb wine-stable
  100. - name: Cache debian packages
  101. shell: bash
  102. run: |
  103. mkdir -p ~/PawPawBuilds/debs
  104. sudo mv /var/cache/apt/archives/*.deb ~/PawPawBuilds/debs/
  105. - name: Bootstrap dependencies
  106. shell: bash
  107. run: |
  108. ./PawPaw/bootstrap-jack2.sh ${{ matrix.target }}
  109. ./PawPaw/.cleanup.sh ${{ matrix.target }}
  110. - name: Build jack2
  111. shell: bash
  112. run: |
  113. pushd PawPaw && source local.env ${{ matrix.target }} && popd
  114. export PATH+=":/usr/i686-w64-mingw32/bin"
  115. export LDFLAGS+="-L~/PawPawBuilds/targets/win64/lib32"
  116. ./waf configure --platform=win32 --prefix=$(pwd)/destdir --static ${{ matrix.target == 'win64' && '--mixed' || '' }}
  117. ./waf build -j $(nproc)
  118. ./waf install
  119. - name: Generate MSVC lib files
  120. if: ${{ matrix.target == 'win32' }}
  121. shell: bash
  122. run: |
  123. pushd $(pwd)/destdir/lib
  124. llvm-dlltool -m i386 -D libjack.dll -d libjack.def -l libjack.lib
  125. llvm-dlltool -m i386 -D libjacknet.dll -d libjacknet.def -l libjacknet.lib
  126. llvm-dlltool -m i386 -D libjackserver.dll -d libjackserver.def -l libjackserver.lib
  127. popd
  128. - name: Generate MSVC lib files
  129. if: ${{ matrix.target == 'win64' }}
  130. shell: bash
  131. run: |
  132. # 32bit
  133. pushd $(pwd)/destdir/lib32
  134. llvm-dlltool -m i386 -D libjack.dll -d libjack.def -l libjack.lib
  135. popd
  136. # 64bit
  137. pushd $(pwd)/destdir/lib
  138. llvm-dlltool -m i386:x86-64 -D libjack64.dll -d libjack64.def -l libjack64.lib
  139. llvm-dlltool -m i386:x86-64 -D libjacknet64.dll -d libjacknet64.def -l libjacknet64.lib
  140. llvm-dlltool -m i386:x86-64 -D libjackserver64.dll -d libjackserver64.def -l libjackserver64.lib
  141. popd
  142. - name: Set sha8 (non-release)
  143. if: startsWith(github.ref, 'refs/tags/') != true
  144. run: echo "SHA8=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV
  145. - name: Set sha8 (release)
  146. if: startsWith(github.ref, 'refs/tags/')
  147. run: echo "SHA8=$(echo ${{ github.ref_name }})" >> $GITHUB_ENV
  148. - name: Generate Windows installer
  149. shell: bash
  150. run: |
  151. # Setup wine
  152. export WINEDLLOVERRIDES="mscoree,mshtml="
  153. export WINEPREFIX=$(pwd)/innosetup
  154. xvfb-run wineboot -u
  155. # Download and install innosetup
  156. curl -L https://jrsoftware.org/download.php/is.exe?site=2 -o is.exe
  157. xvfb-run wine is.exe /allusers /dir=C:\\InnoSeup /nocancel /norestart /verysilent
  158. # create installer
  159. ln -sf $(pwd)/destdir windows/inno/${{ matrix.target }}
  160. pushd windows/inno
  161. echo "#define VERSION \"${{ github.event.pull_request.number || env.SHA8 }}\"" > version.iss
  162. xvfb-run wine ${WINEPREFIX}/drive_c/InnoSeup/ISCC.exe ${{ matrix.target }}-mini.iss
  163. popd
  164. - uses: actions/upload-artifact@v4
  165. with:
  166. name: jack2-${{ matrix.target }}-${{ github.event.pull_request.number || env.SHA8 }}
  167. path: windows/inno/jack2-*.exe