Skip to content

dispatch-build

dispatch-build #70

Workflow file for this run

name: dispatch-build
on:
workflow_dispatch:
jobs:
build:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [macos-14, macos-13, windows-latest]
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install 7Zip (Windows)
if: matrix.os == 'windows-latest'
shell: powershell
run: Install-Module 7Zip4PowerShell -Force -Verbose
- name: Get SC source code
run: git clone https://github.com/supercollider/supercollider.git ${{github.workspace}}/supercollider
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake (Unix)
shell: bash
if: matrix.os != 'windows-latest'
working-directory: ${{github.workspace}}/build
run: cmake .. -DCMAKE_BUILD_TYPE='Release' -DSC_PATH=${{github.workspace}}/supercollider
- name: Configure CMake (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
working-directory: ${{github.workspace}}\build
run: cmake .. -DCMAKE_BUILD_TYPE='Release' -DSC_PATH=${{github.workspace}}\supercollider
- name: Build (Unix)
if: matrix.os != 'windows-latest'
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config "Release" --target install
- name: Build (Windows)
working-directory: ${{github.workspace}}\build
if: matrix.os == 'windows-latest'
shell: pwsh
run: cmake --build . --config "Release" --target install
- name: Zip up build (macOS-14)
if: matrix.os == 'macos-14'
shell: bash
working-directory: ${{github.workspace}}/build
run: zip -r OversamplingOscillators-mac_arm.zip OversamplingOscillators
- name: Zip up build (macOS-13)
if: matrix.os == 'macos-13'
shell: bash
working-directory: ${{github.workspace}}/build
run: zip -r OversamplingOscillators-mac_intel.zip OversamplingOscillators
- name: Zip up build (Windows)
if: matrix.os == 'windows-latest'
shell: pwsh
working-directory: ${{github.workspace}}\build
run: Compress-7Zip "OversamplingOscillators" -ArchiveFileName "OversamplingOscillators-${{runner.os}}.zip" -Format Zip -PreserveDirectoryRoot
- name: Check if release has been created
uses: mukunku/tag-exists-action@v1.6.0
id: checkTag
with:
tag: 'v1'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release (macOS-14)
if: steps.checkTag.outputs.exists == false && matrix.os == 'macos-14'
id: create_release_arm
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: OversamplingOscillators-arm-${{ github.ref }}
draft: false
prerelease: false
- name: Create Release (macOS-13)
if: steps.checkTag.outputs.exists == false && matrix.os == 'macos-13'
id: create_release_x86
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: OversamplingOscillators-x86-${{ github.ref }}
draft: false
prerelease: false
- name: Upload binaries to release (macOS-14)
if: matrix.os == 'macos-14'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{github.workspace}}/build/OversamplingOscillators-mac_arm.zip
asset_name: OversamplingOscillators-mac_arm.zip
tag: ${{ github.ref }}
- name: Upload binaries to release (macOS-13)
if: matrix.os == 'macos-13'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{github.workspace}}/build/OversamplingOscillators-mac_intel.zip
asset_name: OversamplingOscillators-mac_intel.zip
tag: ${{ github.ref }}
- name: Upload binaries to release (Windows)
if: matrix.os == 'windows-latest'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{github.workspace}}/build/OversamplingOscillators-${{runner.os}}.zip
asset_name: OversamplingOscillators-${{runner.os}}.zip
tag: ${{ github.ref }}
# # for windows we have to explicitly add the libsamplerate build job here, for some reason...
# # - name: build_libsamplerate_win
# # if: matrix.os == 'windows-latest'
# # run: |
# # cd projects/MiBraids/libsamplerate
# # mkdir -p build && cd build && cmake -DLIBSAMPLERATE_EXAMPLES=OFF -DBUILD_TESTING=OFF ..
# # cmake --build . --config 'Release'
# - name: Create Build Environment
# # Some projects don't allow in-source building, so create a separate build directory
# # We'll use this as our working directory for all subsequent commands
# run: cmake -E make_directory ${{github.workspace}}/build
# - name: Configure CMake (Unix)
# shell: bash
# if: matrix.os != 'windows-latest'
# working-directory: ${{github.workspace}}/build
# run: cmake .. -DCMAKE_BUILD_TYPE='Release' -DSC_PATH=${{github.workspace}}/supercollider
# # configure
# - name: Configure CMake (Windows)
# if: matrix.os == 'windows-latest'
# shell: pwsh
# working-directory: ${{github.workspace}}\build
# run: cmake .. -DCMAKE_BUILD_TYPE='Release' -DSC_PATH=${{github.workspace}}\supercollider
# # build
# - name: Build (Unix)
# if: matrix.os != 'windows-latest'
# working-directory: ${{github.workspace}}/build
# shell: bash
# run: cmake --build . --config "Release" --target install
# - name: Build (Windows)
# working-directory: ${{github.workspace}}\build
# if: matrix.os == 'windows-latest'
# shell: pwsh
# run: cmake --build . --config "Release" --target install
# # Gather all files in a zip
# - name: Zip up build (Unix)
# if: matrix.os != 'windows-latest'
# shell: bash
# working-directory: ${{github.workspace}}/build
# run: zip -r OversamplingOscillators-${{runner.os}} OversamplingOscillators
# # Gather all files in a zip
# - name: Zip up build (Windows)
# if: matrix.os == 'windows-latest'
# shell: pwsh
# working-directory: ${{github.workspace}}\build
# run: Compress-7Zip "OversamplingOscillators" -ArchiveFileName "OversamplingOscillators -${{runner.os}}.zip" -Format Zip -PreserveDirectoryRoot
# - name: Check if release has been created
# uses: mukunku/tag-exists-action@v1.6.0
# id: checkTag
# with:
# tag: 'v1'
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# # Publish build
# - name: Create Release
# if: steps.checkTag.outputs.exists == false
# id: create_release
# uses: actions/create-release@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
# with:
# tag_name: ${{ github.ref }}
# release_name: OversamplingOscillators-${{ github.ref }}
# draft: false
# prerelease: false
# - name: Upload binaries to release
# uses: svenstaro/upload-release-action@v2
# with:
# repo_token: ${{ secrets.GITHUB_TOKEN }}
# file: ${{github.workspace}}/build/OversamplingOscillators-${{runner.os}}.zip
# asset_name: OversamplingOscillators-${{runner.os}}.zip
# tag: ${{ github.ref }}