-
Notifications
You must be signed in to change notification settings - Fork 117
720 lines (652 loc) · 25 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
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
name: MODFLOW 6 release
on:
# workflow_call event lets this workflow be called either
# from this repo or the nightly build repo for dev builds
workflow_call:
inputs:
approve:
description: 'Approve the release, modifying disclaimer language to indicate the distribution has been reviewed. If false, disclaimers & version strings indicate preliminary/provisional status.'
required: false
type: boolean
default: false
branch:
description: 'Branch to release from.'
required: true
type: string
compiler_toolchain:
description: 'Compiler toolchain to use. For supported options see https://github.com/MODFLOW-USGS/modflow6/blob/develop/DEVELOPER.md#compiler-compatibility.'
required: false
type: string
default: 'intel-classic'
compiler_version:
description: 'Compiler version to use. For supported options see https://github.com/MODFLOW-USGS/modflow6/blob/develop/DEVELOPER.md#compiler-compatibility.'
required: false
type: string
default: '2021.7'
developmode:
description: 'Build binaries in develop mode. If false, IDEVELOPMODE is set to 0.'
required: false
type: boolean
default: true
full:
description: 'Build a full distribution containing sources, examples, and all documentation. If false, the distribution contains only binaries, mf6io, release notes, and code.json.'
required: false
type: boolean
default: false
linux_version:
description: 'Linux runner image to build binaries on.'
required: false
type: string
default: 'ubuntu-22.04'
run_tests:
description: Run tests after building binaries.'
required: false
type: boolean
default: true
version:
description: 'Version number to use for release.'
required: true
type: string
models:
description: 'Models to include in the release documentation'
required: false
type: string
outputs:
version:
description: 'Version number used for release'
value: ${{ jobs.build.outputs.version }}
distname:
description: 'Distribution name used for release'
value: ${{ jobs.build.outputs.distname }}
env:
PIXI_BETA_WARNING_OFF: true
jobs:
build:
name: Build binaries (${{ matrix.os }}, extended=${{ matrix.extended }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ${{ inputs.linux_version }}
compiler: ${{ inputs.compiler_toolchain }}
version: ${{ inputs.compiler_version }}
optimization: 2
extended: false
- os: macos-13
compiler: ${{ inputs.compiler_toolchain }}
version: ${{ inputs.compiler_version }}
optimization: 2
extended: false
- os: macos-14
compiler: gcc
version: 13
optimization: 1
extended: false
- os: windows-2022
compiler: ${{ inputs.compiler_toolchain }}
version: ${{ inputs.compiler_version }}
optimization: 2
extended: false
- os: windows-2022
compiler: intel-classic
version: "2021.7"
optimization: 2
extended: true
defaults:
run:
shell: bash -l {0}
outputs:
version: ${{ steps.set_version.outputs.version }}
distname: ${{ steps.set_version.outputs.distname }}
steps:
- name: Checkout modflow6
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/modflow6
path: modflow6
ref: ${{ inputs.branch }}
- name: Setup pixi
uses: prefix-dev/setup-pixi@v0.8.1
with:
pixi-version: v0.24.2
manifest-path: "modflow6/pixi.toml"
- name: Custom pixi install
working-directory: modflow6
run: pixi run install
- name: Install additional netcdf testing packages
working-directory: modflow6
run: pixi run pip install xugrid xarray netcdf4
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: modflow6/environment.yml
cache-downloads: true
cache-environment: true
init-shell: >-
bash
powershell
- name: Setup ${{ matrix.compiler }} ${{ matrix.version }}
if: (!(runner.os == 'Windows' && matrix.extended))
id: setup-fortran
uses: fortran-lang/setup-fortran@v1
with:
compiler: ${{ matrix.compiler }}
version: ${{ matrix.version }}
- name: Set version number
id: set_version
run: |
# distribution name format is 'mf<major.minor.patch[label]>'
distname="mf${{ inputs.version }}"
# set step outputs and environment variables
echo "version=${{ inputs.version }}" >> "$GITHUB_OUTPUT"
echo "VERSION=${{ inputs.version }}" >> "$GITHUB_ENV"
echo "distname=$distname" >> "$GITHUB_OUTPUT"
echo "DISTNAME=$distname" >> "$GITHUB_ENV"
- name: Update version
id: update_version
working-directory: modflow6/distribution
run: |
ver="${{ steps.set_version.outputs.version }}"
cmd="python update_version.py -v $ver"
if [[ "${{ inputs.approve }}" == "true" ]]; then
cmd="$cmd --approve"
fi
if [[ "${{ inputs.developmode }}" == "false" ]]; then
cmd="$cmd --releasemode"
fi
eval "$cmd"
- name: Get OS tag
id: ostag
run: |
ostag=$(python -c "from modflow_devtools.ostags import get_ostag; print(get_ostag())")
if [[ "${{ matrix.extended }}" == "true" ]]; then
ostag="${ostag}ext"
fi
echo "ostag=$ostag" >> $GITHUB_OUTPUT
# for statically linked gfortran ARM mac build
- name: Hide dylibs (macOS)
if: matrix.os == 'macos-14'
run: |
version="${{ matrix.version }}"
libpath="/opt/homebrew/opt/gcc@$version/lib/gcc/$version"
mv $libpath/libgfortran.5.dylib $libpath/libgfortran.5.dylib.bak
mv $libpath/libquadmath.0.dylib $libpath/libquadmath.0.dylib.bak
- name: Set LDFLAGS (macOS)
if: runner.os == 'macOS'
run: |
os_ver=$(sw_vers -productVersion | cut -d'.' -f1)
if (( "$os_ver" > 12 )); then
ldflags="$LDFLAGS -Wl,-ld_classic"
echo "LDFLAGS=$ldflags" >> $GITHUB_ENV
fi
- name: Build binaries
if: (!(runner.os == 'Windows' && matrix.extended))
working-directory: modflow6
run: |
meson setup builddir --prefix=$(pwd) --libdir=bin -Doptimization=${{ matrix.optimization }}
meson install -C builddir
meson test --verbose --no-rebuild -C builddir
- name: Check architecture (macOS)
working-directory: modflow6/bin
if: runner.os == 'macOS'
run: |
otool -L mf6
lipo -info mf6
- name: Build binaries (Windows)
if: runner.os == 'Windows' && matrix.extended && !inputs.run_tests
uses: ./modflow6/.github/actions/build-extended-win
- name: Build and test binaries (Windows)
if: runner.os == 'Windows' && matrix.extended && inputs.run_tests && inputs.developmode
uses: ./modflow6/.github/actions/test-extended-win
- name: Build and test binaries (Windows)
if: runner.os == 'Windows' && matrix.extended && inputs.run_tests && !inputs.developmode
uses: ./modflow6/.github/actions/test-extended-win
env:
MARKERS: not developmode
- name: Copy deps to bin dir
if: runner.os == 'Windows' && matrix.extended
working-directory: modflow6/bin
shell: cmd
run: |
:: copy dependencies
copy "C:\Windows\System32\ucrtbase.dll" .
copy "C:\Windows\System32\msvcrt.dll" .
copy "C:\Windows\System32\msvcp_win.dll" .
copy "C:\Windows\SYSTEM32\MSVCP140.dll" .
copy "C:\Windows\SYSTEM32\VCRUNTIME140.dll" .
copy "C:\Windows\SYSTEM32\VCRUNTIME140_1.dll" .
copy "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin\libifcoremd.dll" .
copy "C:\Program Files (x86)\Intel\oneAPI\compiler\latest\bin\libmmd.dll" .
copy "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin\mkl_sequential.2.dll" .
copy "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin\mkl_core.2.dll" .
copy "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin\mkl_def.2.dll" .
copy "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin\mkl_avx2.2.dll" .
copy "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin\mkl_avx512.2.dll" .
copy "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\bin\mkl_mc3.2.dll" .
copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\impi.dll" .
copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\opt\mpi\libfabric\bin\libfabric.dll" .
copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\mpiexec.exe" .
copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\hydra_bstrap_proxy.exe" .
copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\hydra_pmi_proxy.exe" .
copy "C:\Program Files (x86)\Intel\oneAPI\mpi\latest\bin\hydra_service.exe" .
copy "%GITHUB_WORKSPACE%\petsc\arch-mswin-c-opt\lib\libpetsc.dll" .
copy "%GITHUB_WORKSPACE%\netcdf\netCDF4.9.2-NC4-64\bin\hdf5.dll" .
copy "%GITHUB_WORKSPACE%\netcdf\netCDF4.9.2-NC4-64\bin\hdf5_hl.dll" .
copy "%GITHUB_WORKSPACE%\netcdf\netCDF4.9.2-NC4-64\bin\libcurl.dll" .
copy "%GITHUB_WORKSPACE%\netcdf\netCDF4.9.2-NC4-64\bin\netcdf.dll" .
copy "%GITHUB_WORKSPACE%\netcdf\netCDF4.9.2-NC4-64\bin\zlib1.dll" .
copy "%GITHUB_WORKSPACE%\netcdf\netcdf-fortran-4.6.1\build\fortran\netcdff.dll" .
:: remove rebuilt and downloaded dirs
if exist rebuilt rd /s /q rebuilt
if exist rebuilt rd /s /q downloaded
- name: Upload binaries
uses: actions/upload-artifact@v3
with:
name: bin-${{ steps.ostag.outputs.ostag }}
path: modflow6/bin
- name: Checkout modflow6-testmodels
if: inputs.run_tests == true && runner.os != 'Windows'
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/modflow6-testmodels
path: modflow6-testmodels
- name: Checkout modflow6-examples
if: inputs.run_tests == true && runner.os != 'Windows'
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/modflow6-examples
path: modflow6-examples
- name: Update flopy
if: inputs.run_tests == true && runner.os != 'Windows'
working-directory: modflow6/autotest
run: python update_flopy.py
- name: Get executables
if: inputs.run_tests == true && runner.os != 'Windows'
working-directory: modflow6/autotest
env:
GITHUB_TOKEN: ${{ github.token }}
run: pytest -v --durations 0 get_exes.py
- name: Test modflow6
if: inputs.run_tests == true && runner.os != 'Windows'
working-directory: modflow6/autotest
env:
REPOS_PATH: ${{ github.workspace }}
run: |
markers="not large"
if [[ "${{ inputs.developmode }}" == "false" ]]; then
markers="$markers and not developmode"
fi
filters=""
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
# comparison fails on macos-14 with optimization=1
filters="not test028_sfr_rewet"
fi
pytest -v -n auto --durations 0 -m "$markers" -k "$filters"
- name: Upload failed test output
if: failure()
uses: actions/upload-artifact@v4
with:
name: failed-${{ matrix.os }}-${{ inputs.compiler_toolchain }}-${{ inputs.compiler_version }}
path: modflow6/autotest/.failed
# steps below run only on Linux to test distribution procedures, e.g.
# compiling binaries, building documentation
- name: Checkout usgslatex
if: ${{ runner.os == 'Linux' && inputs.run_tests == true }}
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/usgslatex
path: usgslatex
- name: Install TeX Live
if: ${{ runner.os == 'Linux' && inputs.run_tests == true }}
run: |
sudo apt-get update
sudo apt install texlive-science \
texlive-latex-extra \
texlive-font-utils \
texlive-fonts-recommended \
texlive-fonts-extra
- name: Install USGS LaTeX style files and Univers font
if: ${{ runner.os == 'Linux' && inputs.run_tests == true }}
working-directory: usgslatex/usgsLaTeX
run: sudo ./install.sh --all-users
- name: Test distribution scripts
if: ${{ inputs.run_tests == true }}
working-directory: modflow6/distribution
env:
GITHUB_TOKEN: ${{ github.token }}
run: pytest -v --durations 0
docs:
name: Build docs
needs: build
runs-on: ubuntu-22.04
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout modflow6
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/modflow6
path: modflow6
ref: ${{ inputs.branch }}
- name: Checkout modflow6-examples
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/modflow6-examples
path: modflow6-examples
- name: Checkout usgslatex
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/usgslatex
path: usgslatex
- name: Install TeX Live
run: |
sudo apt-get update
sudo apt install texlive-science \
texlive-latex-extra \
texlive-font-utils \
texlive-fonts-recommended \
texlive-fonts-extra
- name: Install USGS LaTeX style files and Univers font
working-directory: usgslatex/usgsLaTeX
run: sudo ./install.sh --all-users
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: modflow6/environment.yml
cache-downloads: true
cache-environment: true
- name: Setup ${{ inputs.compiler_toolchain }} ${{ inputs.compiler_version }}
uses: fortran-lang/setup-fortran@v1
with:
compiler: ${{ inputs.compiler_toolchain }}
version: ${{ inputs.compiler_version }}
- name: Update version
id: update_version
working-directory: modflow6/distribution
run: |
ver="${{ needs.build.outputs.version }}"
cmd="python update_version.py -v $ver"
if [[ "${{ inputs.approve }}" == "true" ]]; then
cmd="$cmd --approve"
fi
if [[ "${{ inputs.developmode }}" == "false" ]]; then
cmd="$cmd --releasemode"
fi
eval "$cmd"
- name: Update FloPy classes
working-directory: modflow6/autotest
run: python update_flopy.py
- name: Get OS tag
id: ostag
run: |
ostag=$(python -c "from modflow_devtools.ostags import get_ostag; print(get_ostag())")
echo "ostag=$ostag" >> $GITHUB_OUTPUT
- name: Download pre-built binaries
uses: actions/download-artifact@v3
with:
name: bin-${{ steps.ostag.outputs.ostag }}
path: bin
# execute permissions may not have survived artifact upload/download
- name: Set executable permissions
working-directory: modflow6-examples/etc
run: |
chmod +x "${{ github.workspace }}/bin/mf6"
chmod +x "${{ github.workspace }}/bin/mf5to6"
chmod +x "${{ github.workspace }}/bin/zbud6"
- name: Install dependencies for building models
if: inputs.full == true
working-directory: modflow6-examples/etc
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
pip install -r requirements.pip.txt
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
get-modflow "${{ github.workspace }}/bin" --subset mf2005,triangle,gridgen
- name: Build example models
if: inputs.full == true
working-directory: modflow6-examples/autotest
run: |
models="${{ inputs.models }}"
pytest -v -n auto test_scripts.py --init -k "${models//,/ or }"
- name: Collect deprecations
working-directory: modflow6/doc/mf6io/mf6ivar
run: |
python deprecations.py
cat md/deprecations.md
- name: Upload deprecations
uses: actions/upload-artifact@v3
with:
name: deprecations
path: modflow6/doc/mf6io/mf6ivar/md/deprecations.md
- name: Build MF6IO files from DFNs
working-directory: modflow6/doc/mf6io/mf6ivar
run: python mf6ivar.py
- name: Build documentation
env:
# this step is lazy about building the mf6 examples PDF document, first
# trying to download a prebuilt PDF from MODFLOW-USGS/modflow6-examples,
# so it needs a GITHUB_TOKEN.
GITHUB_TOKEN: ${{ github.token }}
run: |
mkdir -p "${{ needs.build.outputs.distname }}/doc"
cmd="python modflow6/distribution/build_docs.py -b bin -o doc"
models="${{ inputs.models }}"
if [ -n "$models" ]; then
cmd="$cmd -m ${models//,/ -m }"
fi
if [[ "${{ inputs.full }}" == "true" ]]; then
cmd="$cmd --full"
fi
eval "$cmd"
mv "doc/ReleaseNotes.pdf" "doc/release.pdf"
- name: Upload documentation artifact
uses: actions/upload-artifact@v3
with:
name: doc
path: doc
dist:
name: Build distribution (${{ matrix.os }})
needs:
- build
- docs
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
- os: macos-13
- os: macos-14
- os: windows-2022
extended: false
- os: windows-2022
extended: true
defaults:
run:
shell: bash -l {0}
steps:
- name: Checkout modflow6
uses: actions/checkout@v4
with:
repository: ${{ github.repository_owner }}/modflow6
path: modflow6
ref: ${{ inputs.branch }}
- name: Checkout modflow6-examples
uses: actions/checkout@v4
with:
repository: MODFLOW-USGS/modflow6-examples
path: modflow6-examples
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: modflow6/environment.yml
cache-downloads: true
cache-environment: true
init-shell: >-
bash
powershell
- name: Setup ${{ inputs.compiler_toolchain }} ${{ inputs.compiler_version }}
uses: fortran-lang/setup-fortran@v1
with:
compiler: ${{ inputs.compiler_toolchain }}
version: ${{ inputs.compiler_version }}
- name: Update version
id: update_version
working-directory: modflow6/distribution
run: |
ver="${{ needs.build.outputs.version }}"
cmd="python update_version.py -v $ver"
if [[ "${{ inputs.approve }}" == "true" ]]; then
cmd="$cmd --approve"
fi
if [[ "${{ inputs.developmode }}" == "false" ]]; then
cmd="$cmd --releasemode"
fi
eval "$cmd"
- name: Get OS tag
id: ostag
run: |
ostag=$(python -c "from modflow_devtools.ostags import get_ostag; print(get_ostag())")
if [[ "${{ matrix.extended }}" == "true" ]]; then
ostag="${ostag}ext"
fi
echo "ostag=$ostag" >> $GITHUB_OUTPUT
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: ${{ needs.build.outputs.distname }}_${{ steps.ostag.outputs.ostag }}
- name: Select artifacts
working-directory: ${{ needs.build.outputs.distname }}_${{ steps.ostag.outputs.ostag }}
run: |
echo "selecting ${{ steps.ostag.outputs.ostag }} artifacts"
# remove dists for other systems
rm -rf ${{ needs.build.outputs.distname }}_*
# remove release notes
rm -rf release_notes
# rename dist bin directory
mv bin-${{ steps.ostag.outputs.ostag }} bin
# remove binaries for other systems
rm -rf bin-*
echo "dist directory contains:"
ls
- name: Build distribution
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
# build distribution
distname="${{ needs.build.outputs.distname }}_${{ steps.ostag.outputs.ostag }}"
cmd="python modflow6/distribution/build_dist.py -o $distname"
models="${{ inputs.models }}"
if [ -n "$models" ]; then
cmd="$cmd -m ${models//,/ -m }"
fi
if [[ "${{ inputs.full }}" == "true" ]]; then
cmd="$cmd --full"
fi
eval "$cmd"
# rename PDF documents
if [[ "${{ inputs.full }}" == "true" ]]; then
mv "$distname/doc/converter_mf5to6.pdf" "$distname/doc/mf5to6.pdf"
fi
- name: Zip distribution
if: runner.os != 'Windows'
run: |
distname="${{ needs.build.outputs.distname }}_${{ steps.ostag.outputs.ostag }}"
if [[ "${{ inputs.full }}" == "true" ]]; then
zip -r $distname.zip \
$distname/bin \
$distname/src \
$distname/srcbmi \
$distname/doc \
$distname/examples \
$distname/make \
$distname/msvs \
$distname/utils \
$distname/code.json \
$distname/meson.build \
$distname/meson.options \
-x '*.DS_Store' \
-x '*libmf6.lib' \
-x '*idmloader*' \
-x '*obj_temp*' \
-x '*mod_temp*'
else
zip -r $distname.zip \
$distname/bin/* \
$distname/doc/mf6io.pdf \
$distname/doc/release.pdf \
$distname/code.json \
-x '*.DS_Store' \
-x '*libmf6.lib' \
-x '*idmloader*' \
-x '*obj_temp*' \
-x '*mod_temp*'
fi
- name: Zip distribution (Windows)
if: runner.os == 'Windows'
run: |
distname="${{ needs.build.outputs.distname }}_${{ steps.ostag.outputs.ostag }}"
if [[ "${{ inputs.full }}" == "true" ]]; then
7z a -tzip $distname.zip \
$distname/bin \
$distname/src \
$distname/srcbmi \
$distname/doc \
$distname/examples \
$distname/make \
$distname/msvs \
$distname/utils \
$distname/code.json \
$distname/meson.build \
$distname/meson.options \
-xr!libmf6.lib \
-xr!idmloader \
-xr!obj_temp \
-xr!mod_temp
else
7z a -tzip $distname.zip \
$distname/bin/* \
$distname/doc/mf6io.pdf \
$distname/doc/release.pdf \
$distname/code.json \
-xr!libmf6.lib \
-xr!idmloader \
-xr!obj_temp \
-xr!mod_temp
fi
- name: Upload distribution
uses: actions/upload-artifact@v3
with:
name: "${{ needs.build.outputs.distname }}_${{ steps.ostag.outputs.ostag }}"
path: "${{ needs.build.outputs.distname }}_${{ steps.ostag.outputs.ostag }}.zip"
- name: Upload release notes
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: release_notes
path: "${{ needs.build.outputs.distname }}_${{ steps.ostag.outputs.ostag }}/doc/release.pdf"
- name: Check distribution
run: |
# unzip and validate the archive
distname="${{ needs.build.outputs.distname }}_${{ steps.ostag.outputs.ostag }}"
distfile="$distname.zip"
checkdir="check"
mkdir $checkdir
if [[ "$RUNNER_OS" == "Windows" ]]; then
7z x $distfile -o$checkdir
else
unzip $distfile -d $checkdir
fi
cmd="pytest -v -s modflow6/distribution/check_dist.py --path $checkdir/$distname"
if [[ "${{ inputs.approve }}" == "true" ]]; then
cmd="$cmd --approved"
fi
if [[ "${{ inputs.developmode }}" == "false" ]]; then
cmd="$cmd --releasemode"
fi
if [[ "${{ inputs.full }}" == "true" ]]; then
cmd="$cmd --full"
fi
eval "$cmd"