Update CMakeLists.txt #102
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: Compile | |
on: | |
pull_request: {} | |
push: | |
tags: | |
- '*' | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
strategy: | |
matrix: | |
include: | |
- { name: "win64", os: "windows-2022", python-version: "3.9", python-major: "39"} | |
- { name: "win64", os: "windows-2022", python-version: "3.11", python-major: "311"} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Add msbuild to PATH | |
uses: microsoft/[email protected] | |
- name: Get CMake | |
uses: lukka/get-cmake@latest | |
- name: Build Windows (Release) | |
run: | | |
mkdir build | |
cmake . -DCMAKE_BUILD_TYPE=Release -Bbuild -DPython_ROOT_DIR=$pythonLocation | |
cd build | |
msbuild ChucKDesignerCHOP.sln /property:Configuration=Release | |
- name: Make distribution | |
run: | | |
mkdir ChucKDesigner-${{ matrix.name }}-Python${{ matrix.python-major }} | |
move ${{ github.workspace }}/Plugins/ChucK*.dll ChucKDesigner-${{ matrix.name }}-Python${{ matrix.python-major }} | |
7z a ChucKDesigner-${{ matrix.name }}-Python${{ matrix.python-major }}.zip ./ChucKDesigner-${{ matrix.name }}-Python${{ matrix.python-major }}/* -r | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ChucKDesigner-${{ matrix.name }}-Python${{ matrix.python-major }} | |
path: ChucKDesigner-${{ matrix.name }}-Python${{ matrix.python-major }}.zip | |
build-macos: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- { name: "macos-x86_64", os: "macos-11", python-version: "3.9", python-major: "39"} | |
- { name: "macos-x86_64", os: "macos-11", python-version: "3.11", python-major: "311"} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Setup Python 3.8 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.8' | |
- name: Setup Python | |
run: | | |
which python | |
python --version | |
pip install --upgrade certifi | |
cd install_script | |
python macos_install_python.py | |
- name: Get CMake | |
uses: lukka/get-cmake@latest | |
- name: Some Setup | |
run: | | |
cd thirdparty/chuck/src/core | |
bison -dv -b chuck chuck.y | |
flex -ochuck.yy.c chuck.lex | |
- name: Build MacOS (Release) | |
run: | | |
export PATH=/Library/Frameworks/Python.framework/Versions/${{ matrix.python-version }}:/Library/Frameworks/Python.framework/Versions/${{ matrix.python-version }}/bin:/Library/Frameworks/Python.framework/Versions/${{ matrix.python-version }}/lib:$PATH | |
which python3 | |
python3 --version | |
which python3 | |
python3 --version | |
mkdir build && cd build | |
cmake .. -G "Xcode" -DCMAKE_OSX_ARCHITECTURES="x86_64" -DCMAKE_OSX_DEPLOYMENT_TARGET=11.0 | |
xcodebuild -configuration Release -project ChucKDesignerCHOP.xcodeproj | |
ls -r * | |
install_name_tool -change @rpath/libChucKDesignerShared.dylib @loader_path/../../../libChucKDesignerShared.dylib Release/ChucKDesignerCHOP.plugin/Contents/MacOS/ChucKDesignerCHOP | |
install_name_tool -change @rpath/libChucKDesignerShared.dylib @loader_path/../../../libChucKDesignerShared.dylib Release/ChucKListenerCHOP.plugin/Contents/MacOS/ChucKListenerCHOP | |
- name: Make distribution | |
run: | | |
mkdir ChucKDesigner-${{ matrix.name }}-Python${{ matrix.python-major }} | |
cp ${{ github.workspace }}/build/Release/libChucKDesignerShared.dylib ChucKDesigner-${{ matrix.name }}-Python${{ matrix.python-major }} | |
mv ${{ github.workspace }}/build/Release/ChucKDesignerCHOP.plugin ChucKDesigner-${{ matrix.name }}-Python${{ matrix.python-major }} | |
mv ${{ github.workspace }}/build/Release/ChucKListenerCHOP.plugin ChucKDesigner-${{ matrix.name }}-Python${{ matrix.python-major }} | |
zip -r ChucKDesigner-${{ matrix.os }}-Python${{ matrix.python-major }}.zip ChucKDesigner-${{ matrix.name }}-Python${{ matrix.python-major }} | |
# Don't upload until we figure out codesigning. | |
# - name: Upload artifact | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: ChucKDesigner-${{ matrix.name }}-Python${{ matrix.python-major }} | |
# path: ChucKDesigner-${{ matrix.name }}-Python${{ matrix.python-major }}.zip | |
create-release: | |
if: startsWith(github.ref, 'refs/tags/v') | |
needs: [build-windows, build-macos] | |
runs-on: ubuntu-latest | |
name: "Create Release on GitHub" | |
steps: | |
- uses: actions/download-artifact@v3 | |
with: | |
path: "dist" | |
- uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "dist/*/*" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
draft: true |