forked from synthizer/synthizer
-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (162 loc) · 4.93 KB
/
ci.yaml
File metadata and controls
168 lines (162 loc) · 4.93 KB
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
on:
push: {}
pull_request: {}
jobs:
ubuntu:
runs-on: ${{matrix.os}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: "Build CI"
run: |
cd $GITHUB_WORKSPACE
./ci/build_linux.sh
strategy:
matrix:
include:
- os: ubuntu-20.04
- os: ubuntu-18.04
windows:
runs-on: "${{ matrix.OS }}"
env:
VCVARS_PATH: ${{matrix.VCVARS_PATH}}
BUILDING_SYNTHIZER: "1"
CI_WINDOWS: "1"
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Init submodules
shell: cmd
run: |
git submodule update --init --recursive
- name: Configure MSVC Environment Variables
shell: cmd
run: |
call "%VCVARS_PATH%"
set > %GITHUB_ENV%
- name: install ninja
shell: powershell
run: |
choco install ninja
- name: Build C Libraries
shell: powershell
run: |
set-location $Env:GITHUB_WORKSPACE
./ci/build_c.ps1
strategy:
fail-fast: true
matrix:
include:
- VCVARS_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\enterprise\VC\Auxiliary\Build\vcvars32.bat
OS: windows-2019
- VCVARS_PATH: C:\Program Files (x86)\Microsoft Visual Studio\2019\enterprise\VC\Auxiliary\Build\vcvars64.bat
OS: windows-2019
- VCVARS_PATH: C:\Program Files\Microsoft Visual Studio\2022\enterprise\VC\Auxiliary\Build\vcvars64.bat
OS: windows-2022
osx:
runs-on: ${{matrix.os}}
steps:
- name: Checkout
uses: actions/checkout@v2
- shell: bash
run: |
set -ex
brew install ninja
cd $GITHUB_WORKSPACE
git submodule update --init --recursive
mkdir build
cd build
cmake -G Ninja ..
ninja
ninja test
strategy:
matrix:
include:
- os: macos-12
- os: macos-11
build_docs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Cache mdbook
id: cache_mdbook
uses: actions/cache@v2
with:
key: ${{ runner.os }}-mdbook
path: |
~/mdbook
- name: Install mdbook
if: steps.cache_mdbook.outputs.cache-hit != 'true'
run: |
mkdir -p ~/mdbook
curl -H "Accept-Encoding: gzip" https://files.ahicks.io/synthizer_ci/mdbook/mdbook | gunzip - > ~/mdbook/mdbook
curl -H "Accept-Encoding: gzip" https://files.ahicks.io/synthizer_ci/mdbook/mdbook-linkcheck | gunzip - > ~/mdbook/mdbook-linkcheck
chmod +x ~/mdbook/*
- name: Build Manual
run: |
cd $GITHUB_WORKSPACE/manual
export PATH=~/mdbook:$PATH
mdbook build
- uses: actions/upload-artifact@v2
with:
name: manual
path: manual/book/html/**
deploy_docs:
if: startsWith(github.ref, 'refs/tags') && !github.event_type != 'pull_request'
runs-on: ubuntu-20.04
needs: ["build_docs", "windows", "ubuntu", "osx"]
env:
DOCS_DEPLOY_KEY: ${{secrets.docs_deploy_key}}
DOCS_DEPLOY_KEY_PUB: ${{secrets.docs_deploy_key_pub}}
steps:
- name: Install SSH Deploy Key
run: |
mkdir -p ~/.ssh
echo "$DOCS_DEPLOY_KEY" > ~/.ssh/id_rsa
echo "$DOCS_DEPLOY_KEY_PUB" > ~/.ssh/id_rsa.pub
chmod 400 ~/.ssh/id_rsa
- name: Clone Repository
run: |
cd $GITHUB_WORKSPACE
git clone --recursive git@github.com:synthizer/synthizer.github.io .
rm -rf *
- name: Download Docs
uses: actions/download-artifact@v2
with:
name: manual
- name: Commit and Push Docs
run: |
git config --global user.name "Synthizer CI"
git config --global user.email "ahicks@ahicks.io"
git add -A
git commit --allow-empty -m "Docs deployed at $(date)"
git push
github_release:
needs: ["build_docs", "windows", "ubuntu", "osx"]
if: startsWith(github.ref, 'refs/tags') && !github.event_type != 'pull_request'
runs-on: ubuntu-20.04
steps:
- name: Download Docs
uses: actions/download-artifact@v2
with:
name: manual
path: ~/artifacts/manual
- name: Zip Docs
run: |
zip -r ~/artifacts/manual.zip ~/artifacts/manual
# get it out of the way so that the uploads don't freak out.
rm -rf ~/artifacts/manual
ls ~/artifacts
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
tag_name: ${{github.ref}}
- name: Upload Artifacts
uses: alexellis/upload-assets@0.2.2
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
asset_paths: '[ "/home/runner/artifacts/*" ]'