-
Notifications
You must be signed in to change notification settings - Fork 4
285 lines (274 loc) · 8.96 KB
/
create_release-and-upload.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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
name: create-release-upload
on:
push:
tags:
- 'v*'
jobs:
create_releases:
name: create-releases
runs-on: ubuntu-18.04
outputs:
release_url: ${{ steps.output_url.outputs.upload_url }}
steps:
- name: checkout
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
- First Change
- Second Change
draft: false
prerelease: true
continue-on-error: true
- name: Get release
if: steps.create_release.outcome == 'failure'
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: output url
id: output_url
run: |
echo "::set-output name=upload_url::${{steps.get_release.outputs.upload_url}}${{steps.create_release.outputs.upload_url}}"
upload-object-windows:
name: upload-object-win
needs: create_releases
runs-on: windows-2019
strategy:
fail-fast: false
matrix:
bin: [vs2019, vs2019-static, gcc, gcc-static]
include:
- bin: vs2019
shared: on
generator: Visual Studio 16 2019
- bin: vs2019-static
shared: off
generator: Visual Studio 16 2019
- bin: gcc
shared: on
generator: MSYS Makefiles
- bin: gcc-static
shared: off
generator: MSYS Makefiles
steps:
- name: checkout
uses: actions/checkout@v2
- name: output url
id: get_url
run: echo "::set-output name=upload_url::${{ needs.create_releases.outputs.release_url }}"
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
shell: bash
- name: dump version
env:
version: ${{ steps.get_version.outputs.VERSION }}
run: echo "version=${version}"
shell: bash
- name: create folder
run: mkdir dist
- name: cmake-build
run: |
cmake -S . -B build -G "${{ matrix.generator }}" -DCMAKE_BUILD_TYPE=Release -DENABLE_SHARED=${{ matrix.shared }} -DENABLE_CAPI=on -DENABLE_TESTS=off -DENABLE_JS_WRAPPER=off -DCMAKE_INSTALL_PREFIX="./dist"
cmake --build build --parallel 2 --config Release
timeout-minutes: 20
- name: cmake-install
run: |
cmake --install build
cd dist
del /F /Q cmake\wallycore-*
del /F /Q lib\wallycore.*
del /F /Q lib\libwallycore.*
del /F /Q lib\pkgconfig\wallycore.pc
shell: cmd
- name: create archive file
run: |
cd dist
Compress-Archive -Path ./* -DestinationPath ../cfd.zip
cd ..
echo "---- dump zip file ----"
dir .
- name: Upload Release Asset
id: upload-release-asset
# if: success()
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_url.outputs.upload_url }}
asset_path: ./cfd.zip
asset_name: cfd-${{ steps.get_version.outputs.VERSION }}-win-${{ matrix.bin }}-x86_64.zip
asset_content_type: application/zip
upload-object-ubuntu:
name: upload-object-ubuntu
needs: create_releases
runs-on: ubuntu-${{ matrix.os_ver }}.04
strategy:
fail-fast: false
matrix:
# os: [ubuntu-20.04, ubuntu-18.04]
os_ver: [20, 18]
bin: [gcc, gcc-static]
include:
- bin: gcc
shared: on
- bin: gcc-static
shared: off
steps:
- name: checkout
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: cmake-build
run: |
mkdir dist
mkdir build
cd build
cmake .. -DENABLE_SHARED=${{ matrix.shared }} -DENABLE_TESTS=off -DENABLE_JS_WRAPPER=off -DCMAKE_BUILD_TYPE=Release -DTARGET_RPATH="/usr/local/lib"
cd ..
cmake --build build --parallel 2 --config Release
cd build
sudo make install DESTDIR=../dist
cd ..
timeout-minutes: 20
- name: create archive file
run: |
cd dist
zip -r cfd.zip usr
echo "---- dump zip file ----"
ls -l
- name: output url
id: get_url
run: echo "::set-output name=upload_url::${{ needs.create_releases.outputs.release_url }}"
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_url.outputs.upload_url }}
asset_path: ./dist/cfd.zip
asset_name: cfd-${{ steps.get_version.outputs.VERSION }}-ubuntu${{ matrix.os_ver }}04-${{ matrix.bin }}-x86_64.zip
asset_content_type: application/zip
upload-object-alpine:
name: upload-object-alpine
needs: create_releases
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
alpine: ['3.10', '3.12', '3.13']
steps:
- name: checkout
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: list
run: ls -a $GITHUB_WORKSPACE
- name: docker setup 3.10
if: matrix.alpine == '3.10'
uses: docker://alpine:3.10
with:
entrypoint: /github/workspace/.github/workflows/docker/alpine_build_entrypoint.sh
- name: docker setup 3.12
if: matrix.alpine == '3.12'
uses: docker://alpine:3.12
with:
entrypoint: /github/workspace/.github/workflows/docker/alpine_build_entrypoint.sh
- name: docker setup 3.13
if: matrix.alpine == '3.13'
uses: docker://alpine:3.13
with:
entrypoint: /github/workspace/.github/workflows/docker/alpine_build_entrypoint.sh
- name: create archive file
run: |
echo "---- dump output data ----"
ls -l $GITHUB_WORKSPACE/dist/usr/local/*
mkdir -p /tmp/cfd
sudo chmod 777 /tmp/cfd
sudo chown runner /tmp/cfd
sudo cp -r $GITHUB_WORKSPACE/dist/usr /tmp/cfd
cd /tmp/cfd
sudo zip -r /tmp/cfd/cfd.zip usr
sudo chmod 777 /tmp/cfd/cfd.zip
sudo chown runner /tmp/cfd/cfd.zip
sudo cp -rp /tmp/cfd/cfd.zip $GITHUB_WORKSPACE/dist/cfd.zip
echo "---- dump zip file ----"
sudo ls -l /tmp/cfd
- name: output url
id: get_url
run: echo "::set-output name=upload_url::${{ needs.create_releases.outputs.release_url }}"
- name: Upload Release Asset
id: upload-release-asset
# if: success()
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_url.outputs.upload_url }}
asset_path: /tmp/cfd/cfd.zip
asset_name: cfd-${{ steps.get_version.outputs.VERSION }}-alpine-${{ matrix.alpine }}-x86_64.zip
asset_content_type: application/zip
upload-object-macos:
name: upload-object-macos
needs: create_releases
runs-on: macos-10.15
strategy:
fail-fast: false
matrix:
xcode: [10.3, 11.7, 12.4]
shared: [on, off]
include:
- shared: on
suffix:
- shared: off
suffix: -static
steps:
- name: checkout
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Select Xcode version
run: sudo xcode-select -s '/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer'
- name: Show Xcode version
run: xcodebuild -version
- name: cmake-build
run: |
mkdir dist
mkdir build
cd build
cmake .. -DENABLE_SHARED=${{ matrix.shared }} -DENABLE_TESTS=off -DENABLE_JS_WRAPPER=off -DCMAKE_BUILD_TYPE=Release -DTARGET_RPATH="/usr/local/lib;@executable_path;./build/Release"
cd ..
cmake --build build --parallel 2 --config Release
cd build
sudo make install DESTDIR=../dist
cd ..
timeout-minutes: 40
- name: create archive file
run: |
cd dist
zip -r cfd.zip usr
echo "---- dump zip file ----"
ls -l
- name: output url
id: get_url
run: echo "::set-output name=upload_url::${{ needs.create_releases.outputs.release_url }}"
- name: Upload Release Asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_url.outputs.upload_url }}
asset_path: ./dist/cfd.zip
asset_name: cfd-${{ steps.get_version.outputs.VERSION }}-osx-xcode${{ matrix.xcode }}${{ matrix.suffix }}-x86_64.zip
asset_content_type: application/zip