-
Notifications
You must be signed in to change notification settings - Fork 4
269 lines (241 loc) · 10.3 KB
/
nightly-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
262
263
264
265
266
267
268
269
name: Nightly Release
on:
workflow_dispatch:
inputs:
perform-nightly:
description: Prepare nightly tag and release
type: boolean
default: true
perform-linux:
description: Build Linux release
type: boolean
default: true
perform-windows:
description: Build Windows release
type: boolean
default: true
perform-nrt:
description: Run NRT on Windows
type: boolean
default: true
perform-dispatch:
description: Tell dynaflow-launcher the nightly release is ready
type: boolean
default: true
repository_dispatch:
types: [nightly-linux, nightly-windows]
# schedule:
# - cron: "0 4 * * 2-6" # 6 hours later after Dynawo nightly-release.yml
env:
DYNAWO_VERSION: 1.7.0
DYNAWO_TAG: nightly
jobs:
nightly:
if: github.event_name != 'workflow_dispatch' || inputs.perform-nightly
name: Prepare nightly tag and release
runs-on: ubuntu-latest
steps:
- name: Fetch release script
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/dynawo
sparse-checkout: .github/release.js
sparse-checkout-cone-mode: false
- name: Create nightly tag and release if necessary
uses: actions/github-script@v7
env:
body: |
DynawoAlgorithms's nightly release. Compiled on *release* settings.
**Don't use it for production**
draft: false
prerelease: true
release_name: Nightly
tag_name: ${{ env.DYNAWO_TAG }}
target_commitish: heads/master
with:
retries: 3
script: |
const release = require('.github/release.js')
await release({github, context, core, glob})
fedora:
if: always() && !cancelled() && !failure() && (github.event.action == 'nightly-linux' || (github.event_name == 'workflow_dispatch' && inputs.perform-linux) || !endsWith(github.event_name, '_dispatch'))
name: Linux Fedora (Release, GCC, cxx11) (${{ matrix.use-mpi.text }})
runs-on: ubuntu-latest
strategy:
matrix:
use-mpi:
- { value: YES, text: 'with MPI' }
- { value: NO, text: 'without MPI' }
needs: nightly
env:
DYNAWO_RESULTS_SHOW: "false"
DYNAWO_BUILD_TYPE: Release
DYNAWO_FORCE_CXX11_ABI: "true"
DYNAWO_USE_MPI: ${{ matrix.use-mpi.value }}
DYNAWO_NB_PROCESSORS_USED: 2
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch Dynawo's nightly release
run: curl -LOs https://github.com/${{ github.repository_owner }}/dynawo/releases/download/nightly/Dynawo_headers_v$DYNAWO_VERSION.zip
- name: Unzip Dynawo
run: unzip -qq "Dynawo_headers_v${DYNAWO_VERSION}.zip"
- name: Build, Build documentation, Prepare files for distribution
uses: addnab/docker-run-action@v3
with:
image: dynawo/dynawo-distribution-cxx11:latest
options: -v ${{ github.workspace }}:/dynawo-algorithms -e DYNAWO_RESULTS_SHOW -e DYNAWO_BUILD_TYPE -e DYNAWO_FORCE_CXX11_ABI -e DYNAWO_NB_PROCESSORS_USED -e DYNAWO_USE_MPI
shell: bash
run: |
cd /dynawo-algorithms
export DYNAWO_HOME=$(pwd)/dynawo
export DYNAWO_ALGORITHMS_HOME=$(pwd)
util/envDynawoAlgorithms.sh build
util/envDynawoAlgorithms.sh build-doc
util/envDynawoAlgorithms.sh distrib
util/envDynawoAlgorithms.sh distrib-headers
- name: INFO. Files created in distributions folder
run: du -hs distributions/*
- name: Fetch release script
if: ${{ matrix.use-mpi.value == 'YES' }}
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/dynawo
sparse-checkout: .github/release.js
sparse-checkout-cone-mode: false
path: dynawo
- name: Upload assets for release
if: ${{ matrix.use-mpi.value == 'YES' }}
uses: actions/github-script@v7
env:
tag_name: ${{ env.DYNAWO_TAG }}
draft: false
prerelease: true
files: |
distributions/*.zip
documentation/dynawoAlgorithmsDocumentation/DynawoAlgorithmsDocumentation.pdf
with:
retries: 3
script: |
const release = require('./dynawo/.github/release.js')
await release({github, context, core, glob})
# The secrets.DISPATCH_TOKEN should contain a fine-grained PAT with access to dynawo/dynaflow-launcher with Repository permissions 'Contents: Read and write'
- name: Tell dynaflow-launcher the nightly release is ready
if: matrix.use-mpi.value == 'YES' && (github.event_name != 'workflow_dispatch' || inputs.perform-dispatch)
uses: actions/github-script@v7
with:
github-token: ${{ secrets.DISPATCH_TOKEN }}
script: |
await github.rest.repos.createDispatchEvent({ owner: context.repo.owner, repo: "dynaflow-launcher", event_type: "nightly-linux" });
windows:
if: always() && !cancelled() && !failure() && (github.event.action == 'nightly-windows' || (github.event_name == 'workflow_dispatch' && inputs.perform-windows) || !endsWith(github.event_name, '_dispatch'))
name: Windows 2019 (Release, VS2019) (${{ matrix.use-mpi.text }})
runs-on: windows-2019
strategy:
matrix:
use-mpi:
- { value: YES, text: 'with MPI' }
- { value: NO, text: 'without MPI' }
needs: nightly
env:
DYNAWO_USE_MPI: ${{ matrix.use-mpi.value }}
steps:
- name: No LF to CRLF conversion
shell: cmd
run: git config --global core.autocrlf input
- name: Checkout sources
uses: actions/checkout@v4
- name: Download MS-MPI
if: ${{ matrix.use-mpi.value == 'YES' }}
shell: bash
run: |
curl -Os https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisdk.msi
curl -Os https://download.microsoft.com/download/a/5/2/a5207ca5-1203-491a-8fb8-906fd68ae623/msmpisetup.exe
- name: Install MS-MPI
if: ${{ matrix.use-mpi.value == 'YES' }}
shell: cmd
run: |
msmpisdk.msi /passive
msmpisetup.exe /unattend
- name: Fetch Dynawo's nightly release
shell: bash
run: curl -LOs https://github.com/${{ github.repository_owner }}/dynawo/releases/download/nightly/Dynawo_Windows_v$DYNAWO_VERSION.zip
- name: Unzip Dynawo
shell: cmd
run: 7z x Dynawo_Windows_v%DYNAWO_VERSION%.zip -o..\deploy
- name: Dynawo version
shell: cmd
run: ..\deploy\dynawo\dynawo version
# use a minimal PATH to avoid too long command lines and conflict with Strawberry pkg-config !
- name: Build and install
shell: cmd
env:
PATH: C:\Windows\system32;C:\Program Files\Git\cmd;C:\hostedtoolcache\windows\Python\3.7.9\x64
run: |
if "${{ matrix.use-mpi.value }}" == "YES" (
set "MSMPI_INC=C:\Program Files (x86)\Microsoft SDKs\MPI\Include\"
set "MSMPI_LIB32=C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x86\"
set "MSMPI_LIB64=C:\Program Files (x86)\Microsoft SDKs\MPI\Lib\x64\"
)
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
call util\windows\dynawo-algorithms verbose build || exit /b 1
- name: Dynawo-algorithms version
shell: cmd
env:
PATH: C:\Windows\system32;C:\Program Files\Git\cmd;C:\hostedtoolcache\windows\Python\3.7.9\x64
run: call ..\da-i\dynawo-algorithms verbose version || exit /b 1
- name: Run NRT
if: matrix.use-mpi.value == 'YES' && (github.event_name != 'workflow_dispatch' || inputs.perform-nrt)
shell: cmd
env:
MSMPI_BENCHMARKS: C:\Program Files\Microsoft MPI\Benchmarks\
MSMPI_BIN: C:\Program Files\Microsoft MPI\Bin\
PATH: C:\Windows\system32;C:\Program Files\Git\cmd;C:\hostedtoolcache\windows\Python\3.7.9\x64;C:\hostedtoolcache\windows\Python\3.7.9\x64\Scripts
run: |
pip install lxml psutil
set PATH=%MSMPI_BIN%;%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
call util\windows\dynawo-algorithms verbose nrt || exit /b 1
- name: Create distribution
shell: cmd
env:
PATH: C:\Windows\system32;C:\Program Files\Git\cmd;C:\hostedtoolcache\windows\Python\3.7.9\x64
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
call util\windows\dynawo-algorithms verbose distrib-headers distrib || exit /b 1
- name: INFO. Files created in distrib folder
shell: bash
run: |
du -hs distrib/*
if [ "${{ matrix.use-mpi.value }}" == "YES" ]; then
for file in distrib/DynawoAlgorithms_*.zip ; do mv $file ${file//headers_Release/Windows} ; done
else
for file in distrib/DynawoAlgorithms_*.zip ; do mv $file ${file//headers_Release/Windows_without_mpi} ; done
fi
- name: Fetch release script
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/dynawo
sparse-checkout: .github/release.js
sparse-checkout-cone-mode: false
path: dynawo
- name: Upload distribution
uses: actions/github-script@v7
env:
tag_name: ${{ env.DYNAWO_TAG }}
draft: false
prerelease: true
files: |
distrib/DynawoAlgorithms_*.zip
with:
retries: 3
script: |
const release = require('./dynawo/.github/release.js')
await release({github, context, core, glob})
- name: Tell dynaflow-launcher the nightly release is ready
if: matrix.use-mpi.value == 'YES' && (github.event_name != 'workflow_dispatch' || inputs.perform-dispatch)
uses: actions/github-script@v7
with:
github-token: ${{ secrets.DISPATCH_TOKEN }}
script: |
await github.rest.repos.createDispatchEvent({ owner: context.repo.owner, repo: "dynaflow-launcher", event_type: "nightly-windows" });