Skip to content

Commit 44b9077

Browse files
committed
c++17 and updated actions
1 parent 3126d39 commit 44b9077

File tree

2 files changed

+77
-67
lines changed

2 files changed

+77
-67
lines changed

.github/workflows/build.yml

Lines changed: 75 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,105 @@
11
on:
22
push:
33
tags:
4-
- 'v*'
5-
4+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
5+
workflow_dispatch:
6+
inputs:
7+
tag_name:
8+
description: 'Tag name'
9+
required: false
10+
default: 'manual_run'
611
jobs:
712
build:
813

9-
runs-on: ${{matrix.os}}
14+
runs-on: ${{ matrix.os }}
15+
name: ${{ matrix.name }}
1016
strategy:
1117
matrix:
12-
os: [macos-latest, ubuntu-18.04, windows-latest]
18+
include:
19+
20+
- name: 'Linux-x64'
21+
os: ubuntu-latest
22+
23+
- name: 'Windows-x64'
24+
os: windows-latest
25+
26+
- name: 'macOS-x64'
27+
os: macos-12
28+
29+
- name: 'macOS-12-arm64'
30+
arch: arm64
31+
os: macos-12
32+
33+
- name: 'macOS-latest-arm64'
34+
arch: arm64
35+
os: macos-latest
36+
37+
env:
38+
SC_PATH: ${{ github.workspace }}/supercollider
39+
TORCH_PATH: ${{ github.workspace }}/libtorch
40+
BUILD_PATH: ${{ github.workspace }}/build
41+
INSTALL_PATH: ${{ github.workspace }}/build/Install
42+
ARCHIVE_NAME: XPlayBuf-${{ matrix.name }}.zip
43+
CMAKE_OSX_ARCHITECTURES: '${{ matrix.arch }}'
1344

1445
steps:
1546
- uses: actions/checkout@v2
1647

17-
- name: Install 7Zip (Windows)
18-
if: matrix.os == 'windows-latest'
19-
shell: powershell
20-
run: Install-Module 7Zip4PowerShell -Force -Verbose
21-
22-
- name: Get SC source code
23-
run: git clone https://github.com/supercollider/supercollider.git ${{github.workspace}}/supercollider
48+
- name: Checkout SuperCollider
49+
uses: actions/checkout@v2
50+
with:
51+
repository: supercollider/supercollider
52+
path: ${{ env.SC_PATH }}
53+
ref: main
2454

55+
# Build
2556
- name: Create Build Environment
26-
# Some projects don't allow in-source building, so create a separate build directory
27-
# We'll use this as our working directory for all subsequent commands
28-
run: cmake -E make_directory ${{github.workspace}}/build
29-
30-
- name: Configure CMake (Unix)
3157
shell: bash
32-
if: matrix.os != 'windows-latest'
33-
working-directory: ${{github.workspace}}/build
34-
run: cmake .. -DCMAKE_BUILD_TYPE='Release' -DSC_PATH=${{github.workspace}}/supercollider -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/build/install
35-
36-
- name: Configure CMake (Windows)
37-
if: matrix.os == 'windows-latest'
38-
shell: pwsh
39-
working-directory: ${{github.workspace}}\build
40-
run: cmake .. -DCMAKE_BUILD_TYPE='Release' -DSC_PATH=${{github.workspace}}\supercollider -DCMAKE_INSTALL_PREFIX=${{github.workspace}}\build\install
41-
42-
- name: Build (Unix)
43-
if: matrix.os != 'windows-latest'
44-
working-directory: ${{github.workspace}}/build
58+
run: cmake -E make_directory $BUILD_PATH
59+
60+
- name: Configure CMake
4561
shell: bash
46-
run: cmake --build . --config "Release" --target install
62+
working-directory: ${{ env.BUILD_PATH }}
63+
run: cmake .. -DCMAKE_BUILD_TYPE=Release -DSC_PATH="$SC_PATH" -DCMAKE_INSTALL_PREFIX="$INSTALL_PATH"
4764

48-
- name: Build (Windows)
49-
working-directory: ${{github.workspace}}\build
50-
if: matrix.os == 'windows-latest'
51-
shell: pwsh
52-
run: cmake --build . --config "Release" --target install
65+
- name: Build
66+
shell: bash
67+
working-directory: ${{ env.BUILD_PATH }}
68+
env:
69+
CMAKE_BUILD_PARALLEL_LEVEL: 4
70+
run: cmake --build . --config Release --target install
5371

5472
# Gather all files in a zip
5573
- name: Zip up build (Unix)
56-
if: matrix.os != 'windows-latest'
74+
if: runner.os != 'Windows'
5775
shell: bash
58-
working-directory: ${{github.workspace}}/build
59-
run: zip -r XPlayBuf-${{runner.os}} install/XPlayBuf
76+
working-directory: ${{ env.INSTALL_PATH }}
77+
run: zip -r "$ARCHIVE_NAME" "XPlayBuf"
6078

61-
# Gather all files in a zip
6279
- name: Zip up build (Windows)
63-
if: matrix.os == 'windows-latest'
64-
shell: pwsh
65-
working-directory: ${{github.workspace}}\build
66-
run: Compress-7Zip "install\XPlayBuf" -ArchiveFileName "XPlayBuf-${{runner.os}}.zip" -Format Zip
67-
68-
- name: Check if release has been created
69-
uses: mukunku/[email protected]
70-
id: checkTag
71-
with:
72-
tag: 'v1'
73-
env:
74-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
if: runner.os == 'Windows'
81+
shell: bash
82+
working-directory: ${{ env.INSTALL_PATH }}
83+
run: 7z a "$ARCHIVE_NAME" -tzip "XPlayBuf"
7584

76-
# Publish build
77-
- name: Create Release
78-
if: steps.checkTag.outputs.exists == false
79-
id: create_release
80-
uses: actions/create-release@v1
81-
env:
82-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
85+
# Upload
86+
- name: Upload binaries to release
87+
if: github.event_name == 'push'
88+
uses: svenstaro/upload-release-action@v2
8389
with:
84-
tag_name: ${{ github.ref }}
85-
release_name: XPlayBuf-${{ github.ref }}
86-
draft: false
87-
prerelease: false
90+
repo_token: ${{ secrets.GITHUB_TOKEN }}
91+
file: ${{ env.INSTALL_PATH }}/${{ env.ARCHIVE_NAME }}
92+
body: ""
93+
tag: ${{ github.ref }}
8894

95+
# Upload: manual trigger
8996
- name: Upload binaries to release
97+
if: github.event_name == 'workflow_dispatch'
9098
uses: svenstaro/upload-release-action@v2
9199
with:
92100
repo_token: ${{ secrets.GITHUB_TOKEN }}
93-
file: ${{github.workspace}}/build/XPlayBuf-${{runner.os}}.zip
94-
asset_name: XPlayBuf-${{ github.ref_name }}-${{runner.os}}.zip
95-
tag: ${{ github.ref }}
101+
file: ${{ env.INSTALL_PATH }}/${{ env.ARCHIVE_NAME }}
102+
prerelease: true
103+
body: ""
104+
tag: ${{github.event.inputs.tag_name}}
105+

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
cmake_minimum_required(VERSION 3.5)
1010
set(project_name "XPlayBuf")
1111
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake_modules ${CMAKE_MODULE_PATH})
12-
set(CMAKE_CXX_STANDARD 11)
12+
set(CMAKE_CXX_STANDARD 17)
1313

1414
####################################################################################################
1515
# load modules
@@ -76,7 +76,7 @@ set(XPlayBuf_schelp_files
7676
)
7777

7878
sc_add_server_plugin(
79-
"XPlayBuf/XPlayBuf" # desination directory
79+
"XPlayBuf" # desination directory
8080
"XPlayBuf" # target name
8181
"${XPlayBuf_cpp_files}"
8282
"${XPlayBuf_sc_files}"

0 commit comments

Comments
 (0)