This repository has been archived by the owner on Sep 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
261 lines (213 loc) · 8.01 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
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
name: release
on:
release:
types: [published]
jobs:
build:
name: ${{ matrix.name }}
strategy:
matrix:
name:
- Ubuntu 18.04 GCC+libcurl-gnutls
- Ubuntu 18.04 GCC+libcurl-gnutls +static
- Windows 2019 MSVC win32
- Windows 2019 MSVC win32 +static
- Windows 2019 MSVC win64
- Windows 2019 MSVC win64 +static
- macOS 10.15 Clang
- macOS 10.15 Clang +static
include:
- name: Ubuntu 18.04 GCC+libcurl-gnutls
os: ubuntu-18.04
artifact-name: x86_64-linux-gnu
- name: Ubuntu 18.04 GCC+libcurl-gnutls +static
os: ubuntu-18.04
cmake-args: -DBUILD_SHARED_LIBS=OFF
artifact-name: x86_64-linux-gnu+static
- name: Windows 2019 MSVC win32
os: windows-2019
cmake-args: -A Win32
artifact-name: i686-windows-msvc
- name: Windows 2019 MSVC win32 +static
os: windows-2019
cmake-args: -A Win32 -DBUILD_SHARED_LIBS=OFF
artifact-name: i686-windows-msvc+static
- name: Windows 2019 MSVC win64
os: windows-2019
cmake-args: -A x64
artifact-name: x86_64-windows-msvc
- name: Windows 2019 MSVC win64 +static
os: windows-2019
cmake-args: -A x64 -DBUILD_SHARED_LIBS=OFF
artifact-name: x86_64-windows-msvc+static
- name: macOS 10.15 Clang
os: macOS-latest
artifact-name: x86_64-apple-darwin
- name: macOS 10.15 Clang +static
os: macOS-latest
cmake-args: -DBUILD_SHARED_LIBS=OFF
artifact-name: x86_64-apple-darwin+static
runs-on: ${{ matrix.os }}
steps:
- name: Install packages (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install libcurl4-gnutls-dev
- name: Checkout
uses: actions/checkout@v2
- name: Generate project files
run: |
mkdir ${{ matrix.build-dir || '.not-used' }}
cd ${{ matrix.build-dir || '.' }}
cmake ${{ matrix.build-src-dir || '.' }} ${{ matrix.cmake-args }}
env:
CC: ${{ matrix.compiler }}
CFLAGS: ${{ matrix.cflags }}
LDFLAGS: ${{ matrix.ldflags }}
- name: Compile source code
run: |
cd ${{ matrix.build-src-dir || '.' }}
cmake --build . --config ${{ matrix.build-config || 'RelWithDebInfo' }}
- name: Prepare artifact
if: runner.os == 'Linux' || runner.os == 'macOS'
shell: bash
run: |
mkdir RelWithDebInfo
mv libmodio* RelWithDebInfo
- name: Upload artifact
uses: actions/upload-artifact@v1
with:
name: ${{ matrix.artifact-name }}
path: RelWithDebInfo
docs:
name: Generate docs.zip
runs-on: ubuntu-latest
steps:
- name: Install mdBook
uses: peaceiris/actions-mdbook@v1
- name: Checkout
uses: actions/checkout@v2
- name: Checkout wiki
uses: actions/checkout@v2
with:
repository: modio/SDK.wiki
path: wiki
- name: Build
run: |
mkdir -p book/src
cp wiki/*.md book/src/
rename.ul '::' '__' book/src/*
cd book
cat src/_Sidebar.md | ./linkfix.py summary > src/SUMMARY.md
mdbook build -d docs
zip -r ../docs.zip docs/*
- name: Upload
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_name: docs.zip
asset_path: docs.zip
asset_content_type: application/zip
sdk:
name: Generate mod.io-sdk.zip
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Linux
uses: actions/download-artifact@v1
with:
name: x86_64-linux-gnu
path: artifacts/x86_64-linux-gnu
- name: Download Linux +static
uses: actions/download-artifact@v1
with:
name: x86_64-linux-gnu+static
path: artifacts/x86_64-linux-gnu+static
- name: Download Win32
uses: actions/download-artifact@v1
with:
name: i686-windows-msvc
path: artifacts/i686-windows-msvc
- name: Download Win32 +static
uses: actions/download-artifact@v1
with:
name: i686-windows-msvc+static
path: artifacts/i686-windows-msvc+static
- name: Download Win64
uses: actions/download-artifact@v1
with:
name: x86_64-windows-msvc
path: artifacts/x86_64-windows-msvc
- name: Download Win64 +static
uses: actions/download-artifact@v1
with:
name: x86_64-windows-msvc+static
path: artifacts/x86_64-windows-msvc+static
- name: Download macOS
uses: actions/download-artifact@v1
with:
name: x86_64-apple-darwin
path: artifacts/x86_64-apple-darwin
- name: Download macOS +static
uses: actions/download-artifact@v1
with:
name: x86_64-apple-darwin+static
path: artifacts/x86_64-apple-darwin+static
- name: Build
id: build
run: |
tag=$(git describe --tags --abbrev=0)
package="mod.io-sdk-$tag"
# linux
mkdir -p "$package"/{lib,static}/linux/x64
mv artifacts/x86_64-linux-gnu/libmodio.so "$package/lib/linux/x64"
mv artifacts/x86_64-linux-gnu+static/libmodio.a "$package/static/linux/x64"
# win32 & win64
mkdir -p "$package"/{bin,lib,static}/msvc/{x86,x64}
mv artifacts/i686-windows-msvc/modio.dll "$package/bin/msvc/x86"
mv artifacts/i686-windows-msvc/modio.pdb "$package/bin/msvc/x86"
mv artifacts/i686-windows-msvc/modio.lib "$package/lib/msvc/x86"
mv artifacts/i686-windows-msvc+static/modio.lib "$package/static/msvc/x86"
mv artifacts/x86_64-windows-msvc/modio.dll "$package/bin/msvc/x64"
mv artifacts/x86_64-windows-msvc/modio.pdb "$package/bin/msvc/x64"
mv artifacts/x86_64-windows-msvc/modio.lib "$package/lib/msvc/x64"
mv artifacts/x86_64-windows-msvc+static/modio.lib "$package/static/msvc/x64"
# macOS
mkdir -p "$package"/{lib,static}/macOS/x64
mv artifacts/x86_64-apple-darwin/libmodio.dylib "$package/lib/macOS/x64"
mv artifacts/x86_64-apple-darwin+static/libmodio.a "$package/static/macOS/x64"
mv additional_dependencies "$package"
mv include "$package"
mv LICENSE "$package/License.txt"
cp .github/workflows/readme.txt "$package/Readme.txt"
zip -r "$package.zip" "$package"/*
echo "::set-output name=asset_name::$package.zip"
echo "::set-output name=asset_path::$package.zip"
- name: Checksum
run: |
checksum=$(shasum -ba 256 ${{ steps.build.outputs.asset_path }} | cut -d ' ' -f 1)
echo "Checksum for ${{ steps.build.outputs.asset_name }}: $checksum"
echo -n $checksum > ${{ steps.build.outputs.asset_path }}.sha256
- name: Upload
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_name: ${{ steps.build.outputs.asset_name }}
asset_path: ${{ steps.build.outputs.asset_path }}
asset_content_type: application/zip
- name: Upload checksum
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_name: ${{ steps.build.outputs.asset_name }}.sha256
asset_path: ${{ steps.build.outputs.asset_path }}.sha256
asset_content_type: text/plain