Skip to content

Commit 1d4457a

Browse files
committed
add new workflow to faciliate testing
1 parent 4c73249 commit 1d4457a

File tree

1 file changed

+101
-0
lines changed

1 file changed

+101
-0
lines changed

.github/workflows/dispatch-build.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: dispatch-build
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
9+
runs-on: ${{matrix.os}}
10+
strategy:
11+
matrix:
12+
os: [macos-latest, ubuntu-18.04, windows-latest]
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
submodules: 'recursive'
18+
19+
- name: Install 7Zip (Windows)
20+
if: matrix.os == 'windows-latest'
21+
shell: powershell
22+
run: Install-Module 7Zip4PowerShell -Force -Verbose
23+
24+
- name: Get SC source code
25+
run: git clone https://github.com/supercollider/supercollider.git ${{github.workspace}}/supercollider
26+
27+
- name: Create Build Environment
28+
# Some projects don't allow in-source building, so create a separate build directory
29+
# We'll use this as our working directory for all subsequent commands
30+
run: cmake -E make_directory ${{github.workspace}}/build
31+
32+
- name: Configure CMake (Unix)
33+
shell: bash
34+
if: matrix.os != 'windows-latest'
35+
working-directory: ${{github.workspace}}/build
36+
run: cmake .. -DCMAKE_BUILD_TYPE='Release' -DSC_PATH=${{github.workspace}}/supercollider
37+
38+
# configure
39+
- name: Configure CMake (Windows)
40+
if: matrix.os == 'windows-latest'
41+
shell: pwsh
42+
working-directory: ${{github.workspace}}\build
43+
run: cmake .. -DCMAKE_BUILD_TYPE='Release' -DSC_PATH=${{github.workspace}}\supercollider
44+
45+
# build
46+
- name: Build (Unix)
47+
if: matrix.os != 'windows-latest'
48+
working-directory: ${{github.workspace}}/build
49+
shell: bash
50+
run: cmake --build . --config "Release" --target install
51+
52+
- name: Build (Windows)
53+
working-directory: ${{github.workspace}}\build
54+
if: matrix.os == 'windows-latest'
55+
shell: pwsh
56+
run: cmake --build . --config "Release" --target install
57+
58+
59+
60+
# Gather all files in a zip
61+
- name: Zip up build (Unix)
62+
if: matrix.os != 'windows-latest'
63+
shell: bash
64+
working-directory: ${{github.workspace}}/build
65+
run: zip -r mi-UGens-${{runner.os}} mi-UGens
66+
67+
# Gather all files in a zip
68+
- name: Zip up build (Windows)
69+
if: matrix.os == 'windows-latest'
70+
shell: pwsh
71+
working-directory: ${{github.workspace}}\build
72+
run: Compress-7Zip "mi-UGens" -ArchiveFileName "mi-UGens-${{runner.os}}.zip" -Format Zip -PreserveDirectoryRoot
73+
74+
- name: Check if release has been created
75+
uses: mukunku/[email protected]
76+
id: checkTag
77+
with:
78+
tag: 'v1'
79+
env:
80+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
81+
82+
# Publish build
83+
- name: Create Release
84+
if: steps.checkTag.outputs.exists == false
85+
id: create_release
86+
uses: actions/create-release@v1
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
89+
with:
90+
tag_name: ${{ github.ref }}
91+
release_name: mi-UGens-${{ github.ref }}
92+
draft: false
93+
prerelease: false
94+
95+
- name: Upload binaries to release
96+
uses: svenstaro/upload-release-action@v2
97+
with:
98+
repo_token: ${{ secrets.GITHUB_TOKEN }}
99+
file: ${{github.workspace}}/build/mi-UGens-${{runner.os}}.zip
100+
asset_name: mi-UGens-${{runner.os}}.zip
101+
tag: ${{ github.ref }}

0 commit comments

Comments
 (0)