-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
77 additions
and
67 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,95 +1,105 @@ | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
workflow_dispatch: | ||
inputs: | ||
tag_name: | ||
description: 'Tag name' | ||
required: false | ||
default: 'manual_run' | ||
jobs: | ||
build: | ||
|
||
runs-on: ${{matrix.os}} | ||
runs-on: ${{ matrix.os }} | ||
name: ${{ matrix.name }} | ||
strategy: | ||
matrix: | ||
os: [macos-latest, ubuntu-18.04, windows-latest] | ||
include: | ||
|
||
- name: 'Linux-x64' | ||
os: ubuntu-latest | ||
|
||
- name: 'Windows-x64' | ||
os: windows-latest | ||
|
||
- name: 'macOS-x64' | ||
os: macos-12 | ||
|
||
- name: 'macOS-12-arm64' | ||
arch: arm64 | ||
os: macos-12 | ||
|
||
- name: 'macOS-latest-arm64' | ||
arch: arm64 | ||
os: macos-latest | ||
|
||
env: | ||
SC_PATH: ${{ github.workspace }}/supercollider | ||
TORCH_PATH: ${{ github.workspace }}/libtorch | ||
BUILD_PATH: ${{ github.workspace }}/build | ||
INSTALL_PATH: ${{ github.workspace }}/build/Install | ||
ARCHIVE_NAME: XPlayBuf-${{ matrix.name }}.zip | ||
CMAKE_OSX_ARCHITECTURES: '${{ matrix.arch }}' | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- 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: Checkout SuperCollider | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: supercollider/supercollider | ||
path: ${{ env.SC_PATH }} | ||
ref: main | ||
|
||
# Build | ||
- 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 -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install | ||
|
||
- 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 -DCMAKE_INSTALL_PREFIX=${{github.workspace}}\build\install | ||
|
||
- name: Build (Unix) | ||
if: matrix.os != 'windows-latest' | ||
working-directory: ${{github.workspace}}/build | ||
run: cmake -E make_directory $BUILD_PATH | ||
|
||
- name: Configure CMake | ||
shell: bash | ||
run: cmake --build . --config "Release" --target install | ||
working-directory: ${{ env.BUILD_PATH }} | ||
run: cmake .. -DCMAKE_BUILD_TYPE=Release -DSC_PATH="$SC_PATH" -DCMAKE_INSTALL_PREFIX="$INSTALL_PATH" | ||
|
||
- name: Build (Windows) | ||
working-directory: ${{github.workspace}}\build | ||
if: matrix.os == 'windows-latest' | ||
shell: pwsh | ||
run: cmake --build . --config "Release" --target install | ||
- name: Build | ||
shell: bash | ||
working-directory: ${{ env.BUILD_PATH }} | ||
env: | ||
CMAKE_BUILD_PARALLEL_LEVEL: 4 | ||
run: cmake --build . --config Release --target install | ||
|
||
# Gather all files in a zip | ||
- name: Zip up build (Unix) | ||
if: matrix.os != 'windows-latest' | ||
if: runner.os != 'Windows' | ||
shell: bash | ||
working-directory: ${{github.workspace}}/build | ||
run: zip -r XPlayBuf-${{runner.os}} install/XPlayBuf | ||
working-directory: ${{ env.INSTALL_PATH }} | ||
run: zip -r "$ARCHIVE_NAME" "XPlayBuf" | ||
|
||
# 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 "install\XPlayBuf" -ArchiveFileName "XPlayBuf-${{runner.os}}.zip" -Format Zip | ||
|
||
- name: Check if release has been created | ||
uses: mukunku/[email protected] | ||
id: checkTag | ||
with: | ||
tag: 'v1' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
if: runner.os == 'Windows' | ||
shell: bash | ||
working-directory: ${{ env.INSTALL_PATH }} | ||
run: 7z a "$ARCHIVE_NAME" -tzip "XPlayBuf" | ||
|
||
# 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 | ||
# Upload | ||
- name: Upload binaries to release | ||
if: github.event_name == 'push' | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: XPlayBuf-${{ github.ref }} | ||
draft: false | ||
prerelease: false | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ${{ env.INSTALL_PATH }}/${{ env.ARCHIVE_NAME }} | ||
body: "" | ||
tag: ${{ github.ref }} | ||
|
||
# Upload: manual trigger | ||
- name: Upload binaries to release | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
file: ${{github.workspace}}/build/XPlayBuf-${{runner.os}}.zip | ||
asset_name: XPlayBuf-${{ github.ref_name }}-${{runner.os}}.zip | ||
tag: ${{ github.ref }} | ||
file: ${{ env.INSTALL_PATH }}/${{ env.ARCHIVE_NAME }} | ||
prerelease: true | ||
body: "" | ||
tag: ${{github.event.inputs.tag_name}} | ||
|
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