Update the macos runner to macos-12. #67
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: github ci | |
on: | |
push: | |
branches: [ faustgen2, testing ] | |
tags: [ '*' ] | |
pull_request: | |
branches: [ faustgen2 ] | |
jobs: | |
macos-build: | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: version | |
run: | | |
echo "version=$(git describe --tags)" >> $GITHUB_ENV | |
- name: dependencies | |
run: | | |
brew install llvm@14 | |
brew link llvm@14 | |
- name: make | |
run: | | |
echo version: $version | |
mkdir build && cd build | |
cmake .. && make | |
# staged install into dist | |
cmake --install . --prefix dist | |
# copy over libLLVM.dylib and fix the loader path of the external | |
llvmdir="$(brew --prefix)/opt/llvm@14/lib" | |
(cd dist/Faustgen2~; for x in $(otool -L faustgen2~.pd_darwin | sed -n 's|.*llvm@14/lib/\(.*\.dylib\).*|\1|p'); do echo "$llvmdir/$x:"; cp $llvmdir/$x .; install_name_tool -change $llvmdir/$x @loader_path/$x faustgen2~.pd_darwin; done) | |
cp ../README.md ../LICENSE dist/faustgen2~ | |
chmod 0444 dist/faustgen2~/default.dsp | |
- name: upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pd-faustgen2-${{ env.version }}-macos-x86_64 | |
path: build/dist | |
retention-days: 2 | |
macos-arm-build: | |
runs-on: macos-12 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: version | |
run: | | |
echo "version=$(git describe --tags)" >> $GITHUB_ENV | |
- name: prepare | |
run: | | |
# This is a bit tricky since we want to cross-compile for arm64 on | |
# an x86_64 Big Sur runner using the llvm@14 arm64 homebrew package. | |
# Here is a suitable snapshot of the package that we prepared: | |
curl -L https://github.com/agraef/pd-faustgen/releases/download/llvm-14-homebrew/llvm-14.0.6-homebrew-macos11-arm64.zip -o llvm.zip | |
unzip llvm.zip | |
- name: make | |
run: | | |
echo version: $version | |
# we need llvm-config for the static build | |
export PATH=$PWD/llvm/bin:$PATH | |
mkdir build && cd build | |
cmake .. -DLLVM_DIR=./llvm/lib/cmake/llvm -DCMAKE_OSX_ARCHITECTURES="arm64" && make | |
# staged install into dist | |
cmake --install . --prefix dist | |
# copy over libLLVM.dylib and fix the loader path of the external | |
for x in $(otool -L dist/faustgen2~/faustgen2~.pd_darwin | sed -n 's|.*llvm@14/lib/\(.*\.dylib\).*|\1|p'); do echo "../llvm/lib/$x:"; cp ../llvm/lib/$x dist/faustgen2~; install_name_tool -change @@HOMEBREW_PREFIX@@/opt/llvm@14/lib/$x @loader_path/$x dist/faustgen2~/faustgen2~.pd_darwin; done | |
cp ../README.md ../LICENSE dist/faustgen2~ | |
chmod 0444 dist/faustgen2~/default.dsp | |
- name: upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pd-faustgen2-${{ env.version }}-macos-arm64 | |
path: build/dist | |
retention-days: 2 | |
ubuntu-build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: install dependencies | |
run: sudo apt-get install -y pkg-config libedit-dev | |
- name: version | |
run: | | |
echo "version=$(git describe --tags)" >> $GITHUB_ENV | |
- name: prepare | |
run: | | |
curl -o ./llvm.tar.xz https://releases.llvm.org/9.0.0/clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz | |
tar xvf ./llvm.tar.xz && mv clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04 llvm | |
- name: make | |
run: | | |
echo version: $version | |
mkdir build && cd build | |
cmake .. -DCMAKE_C_FLAGS=-m64 -DUSE_LLVM_CONFIG=off -DLLVM_DIR=./llvm/lib/cmake/llvm -DCMAKE_BUILD_TYPE=Release -DINSTALL_DIR=faustgen2~ -DCMAKE_INSTALL_PREFIX=/ | |
cmake --build . --config Release --target faustgen_tilde_project | |
make install DESTDIR=$PWD/dist | |
cp ../README.md ../LICENSE dist/faustgen2~ | |
chmod 0444 dist/faustgen2~/default.dsp | |
- name: upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pd-faustgen2-${{ env.version }}-ubuntu-x86_64 | |
path: build/dist | |
retention-days: 2 | |
windows-build: | |
runs-on: windows-2019 | |
# We use bash for the entire build since powershell just drives me insane. | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: version | |
run: | | |
echo "version=$(git describe --tags)" >> $GITHUB_ENV | |
# The Windows runner has an LLVM installation in /c/Program Files/LLVM | |
# which is pretty useless since it lacks important development tools. | |
# In particular, we need llvm-config (even with USE_LLVM_CONFIG=off) | |
# for the faust staticlib build to work. So we just get rid of the | |
# runner's LLVM version and move our version in its place. | |
- name: prepare | |
run: | | |
mkdir build && cd build | |
curl -L https://github.com/agraef/pd-faustgen/releases/download/llvm-9.0.0-windows-build/llvm-9.0.0-windows-x64-mt.zip -o llvm.zip | |
7z x llvm.zip | |
rm -rf "/c/Program Files/LLVM" | |
mv llvm "/c/Program Files/LLVM" | |
echo "llvmdir=/c/Program Files/LLVM" >> $GITHUB_ENV | |
- name: make | |
run: | | |
cd build | |
echo "version: $version" | |
echo "llvmdir: $llvmdir" | |
echo "llvm-config: $(which llvm-config)" | |
cmake .. -G "Visual Studio 16 2019" -A x64 -DUSE_LLVM_CONFIG=off -DLLVM_DIR="$llvmdir/lib/cmake/llvm" | |
cmake --build . --config Release | |
cmake --install . --prefix dist | |
cp ../README.md dist/faustgen2~ | |
cp ../LICENSE dist/faustgen2~ | |
chmod 0444 dist/faustgen2~/default.dsp | |
- name: upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pd-faustgen2-${{ env.version }}-windows-x86_64 | |
path: build/dist | |
retention-days: 2 | |
tarball: | |
#if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
fetch-depth: 0 | |
- name: make dist | |
run: | | |
echo "version=$(git describe --tags)" >> $GITHUB_ENV | |
./make-dist.sh | |
- name: upload | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pd-faustgen2-${{ env.version }}-source | |
path: pd-faustgen2-*.tar.gz | |
retention-days: 2 | |
release: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
needs: [macos-build, macos-arm-build, windows-build, ubuntu-build, tarball] | |
steps: | |
- uses: actions/download-artifact@v3 | |
- name: ziptie | |
run: | | |
mkdir dist | |
for x in pd-faustgen2-*; do (cd $x && zip -r ../dist/$x.zip *); done | |
- name: release | |
uses: softprops/action-gh-release@v1 | |
with: | |
prerelease: true | |
draft: true | |
files: dist/*.zip |