-
Notifications
You must be signed in to change notification settings - Fork 14
135 lines (107 loc) · 4.4 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: Publish to releases and github.io website
on:
push:
tags:
- "v*.*"
- "v*.*.*"
workflow_dispatch:
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
jobs:
build_macos:
name: Build on macOS
runs-on: macos-latest
steps:
- name: Install dependencies
run: brew install ninja create-dmg
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/cache@v3
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
# Setup caching of build artifacts to reduce total build time (only Linux and MacOS)
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: macos-release
- name: Configure CMake
run: |
cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_POLICY_DEFAULT_CMP0135=NEW -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_OSX_DEPLOYMENT_TARGET=10.15 -DCMAKE_OSX_ARCHITECTURES="arm64;x86_64"
- name: Build
run: cmake --build ${{github.workspace}}/build --parallel 4 --config ${{env.BUILD_TYPE}}
- name: Checking that Samplin Safari runs
run: |
${{github.workspace}}/build/Samplin\ Safari.app/Contents/MacOS/Samplin\ Safari --help
- name: Creating dmg
run: |
RESULT="${{github.workspace}}/build/SamplinSafari.dmg"
test -f $RESULT && rm $RESULT
create-dmg --window-size 500 300 --icon-size 96 --volname "Samplin Safari Installer" --app-drop-link 360 105 --icon Samplin\ Safari.app 130 105 $RESULT ${{github.workspace}}/build/Samplin\ Safari.app
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ${{github.workspace}}/build/SamplinSafari.dmg
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_windows:
name: Build on Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_POLICY_DEFAULT_CMP0135=NEW
- name: Build
run: cmake --build ${{github.workspace}}/build --parallel --config ${{env.BUILD_TYPE}} --verbose
- name: Checking that Samplin Safari runs
run: |
"${{github.workspace}}/build/${{env.BUILD_TYPE}}/Samplin Safari.exe --help"
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
${{github.workspace}}/build/${{env.BUILD_TYPE}}/Samplin Safari.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build_emscripten:
name: Build and deploy emscripten webapp
runs-on: macos-12
steps:
- name: Install dependencies
run: |
brew install ninja emscripten
python3 -m pip install Pillow
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/cache@v3
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
# Setup caching of build artifacts to reduce total build time (only Linux and MacOS)
- name: ccache
uses: hendrikmuhs/[email protected]
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
run: |
emcmake cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
- name: Build
run: cmake --build ${{github.workspace}}/build --parallel 4
- name: Copy web app
working-directory: ${{github.workspace}}/build
run: |
mkdir deploy
cp Samplin\ Safari.data Samplin\ Safari.html Samplin\ Safari.js Samplin\ Safari.wasm SamplinSafari_favicon.png FileSaver.js deploy/
mv deploy/Samplin\ Safari.html deploy/index.html
- name: Publish
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ${{github.workspace}}/build/deploy