Skip to content

Commit 6900b33

Browse files
authored
ci(release): update fetch vs build configuration (#60)
add more programs to fetch from github releases to releases.json. rely on pymake to build a more limited subset.
1 parent aeb0bf8 commit 6900b33

3 files changed

Lines changed: 135 additions & 54 deletions

File tree

.github/workflows/integration.yml

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
os: [ ubuntu-22.04, macos-14, windows-2022 ]
14+
os: [ ubuntu-22.04, macos-14, macos-15-intel, windows-2022 ]
1515
defaults:
1616
run:
1717
shell: bash -l {0}
1818
steps:
1919

2020
- name: Checkout repo
21-
uses: actions/checkout@v4
21+
uses: actions/checkout@v5
2222
with:
2323
path: executables
2424

2525
- name: Checkout modflow6
26-
uses: actions/checkout@v4
26+
uses: actions/checkout@v5
2727
with:
2828
repository: MODFLOW-ORG/modflow6
2929
path: modflow6
@@ -38,28 +38,32 @@ jobs:
3838
working-directory: modflow6
3939
run: pixi run install
4040

41-
- name: Setup ${{ contains(fromJSON('["macos-14"]'), matrix.os) && 'gcc' || 'intel-classic' }} ${{ contains(fromJSON('["macos-14"]'), matrix.os) && env.GCC_V || env.INTEL_V }}
41+
- name: Setup ${{ contains(fromJSON('["macOS"]'), runner.os) && 'gcc' || 'intel-classic' }} ${{ contains(fromJSON('["macOS"]'), runner.os) && env.GCC_V || env.INTEL_V }}
4242
uses: fortran-lang/setup-fortran@v1
4343
with:
44-
compiler: ${{ contains(fromJSON('["macos-14"]'), matrix.os) && 'gcc' || 'intel-classic' }}
45-
version: ${{ contains(fromJSON('["macos-14"]'), matrix.os) && env.GCC_V || env.INTEL_V }}
44+
compiler: ${{ contains(fromJSON('["macOS"]'), runner.os) && 'gcc' || 'intel-classic' }}
45+
version: ${{ contains(fromJSON('["macOS"]'), runner.os) && env.GCC_V || env.INTEL_V }}
4646

4747
- name: Setup Xcode CLT (macOS)
4848
uses: maxim-lobanov/setup-xcode@v1
4949
if: runner.os == 'macOS'
5050
with:
51-
xcode-version: ${{ contains(fromJSON('["macos-13"]'), matrix.os) && '14.3.1' || 'latest' }}
51+
xcode-version: 'latest'
5252

53-
- name: Set LDFLAGS (ARM macOS)
53+
- name: Set LDFLAGS (macOS)
54+
if: runner.os == 'macOS'
5455
run: |
5556
ldflags="$LDFLAGS -Wl,-ld_classic"
5657
echo "LDFLAGS=$ldflags" >> $GITHUB_ENV
5758
58-
- name: Hide dylibs (ARM macOS)
59-
if: matrix.os == 'macos-14'
59+
- name: Hide dylibs (macOS)
60+
if: runner.os == 'macOS'
6061
run: |
61-
libpath="/opt/homebrew/opt/gcc@${{ env.GCC_V }}/lib/gcc/${{ env.GCC_V }}"
62-
mv $libpath/libgfortran.5.dylib $libpath/libgfortran.5.dylib.bak
62+
version=${{ env.GCC_V }}
63+
brew_prefix="$(brew --prefix)"
64+
libpath="$brew_prefix/opt/gcc@$version/lib/gcc/$version"
65+
mv $libpath/libgcc_s.1.1.dylib $libpath/libgcc_s.1.1.dylib.bak
66+
mv $libpath/libgfortran.5.dylib $libpath/libgfortran.5.dylib.bak
6367
mv $libpath/libquadmath.0.dylib $libpath/libquadmath.0.dylib.bak
6468
mv $libpath/libstdc++.6.dylib $libpath/libstdc++.6.dylib.bak
6569
@@ -79,20 +83,27 @@ jobs:
7983
ostag=$(pixi run --manifest-path modflow6/pixi.toml python -c "from modflow_devtools.ostags import get_ostag; print(get_ostag())")
8084
echo "ostag=$ostag" >> $GITHUB_OUTPUT
8185
86+
- name: Fetch pre-built programs
87+
working-directory: executables
88+
run: |
89+
ostag="${{ steps.ostag.outputs.ostag }}"
90+
mkdir $ostag
91+
pixi run --manifest-path ../modflow6/pixi.toml python scripts/fetch_releases.py --manifest releases.json --ostag $ostag --outdir $ostag --zip $ostag.zip
92+
8293
- name: Build programs
8394
uses: nick-fields/retry@v3
8495
with:
8596
shell: bash
8697
timeout_minutes: 40
8798
command: |
8899
ostag="${{ steps.ostag.outputs.ostag }}"
89-
mkdir $ostag
90-
pixi run --manifest-path modflow6/pixi.toml make-program : --appdir $ostag --exclude gridgen --zip $ostag.zip --verbose
91-
pixi run --manifest-path modflow6/pixi.toml make-program mf2005,mflgr,mfnwt,mfusg --appdir $ostag --double --keep --zip $ostag.zip --verbose
100+
fetched=$(pixi run --manifest-path modflow6/pixi.toml python executables/scripts/fetch_releases.py --manifest executables/releases.json --list)
101+
pixi run --manifest-path modflow6/pixi.toml make-program : --appdir executables/$ostag --exclude "$fetched" --zip executables/$ostag.zip --verbose
102+
pixi run --manifest-path modflow6/pixi.toml make-program mf2005,mflgr,mfnwt,mfusg --appdir executables/$ostag --double --keep --zip executables/$ostag.zip --verbose
92103
if [[ "${{ matrix.os }}" == "macos-14" ]]; then
93-
pixi run --manifest-path modflow6/pixi.toml make-program mf6 --appdir $ostag --keep --zip $ostag.zip --verbose --fflags='-O1'
104+
pixi run --manifest-path modflow6/pixi.toml make-program mf6 --appdir executables/$ostag --keep --zip executables/$ostag.zip --verbose --fflags='-O1'
94105
fi
95-
pixi run --manifest-path modflow6/pixi.toml make-code-json --appdir $ostag --zip $ostag.zip --verbose
106+
pixi run --manifest-path modflow6/pixi.toml make-code-json --appdir executables/$ostag --zip executables/$ostag.zip --verbose
96107
97108
- name: Move programs
98109
run: |
@@ -101,7 +112,7 @@ jobs:
101112
102113
# move programs where mf6 autotests expect them
103114
mkdir modflow6/bin/downloaded
104-
cp $ostag/* modflow6/bin/downloaded
115+
cp executables/$ostag/* modflow6/bin/downloaded
105116
106117
# move mf6 binaries to top-level bindir in mf6 repo
107118
if [[ "$RUNNER_OS" == "Windows" ]]; then
@@ -114,9 +125,9 @@ jobs:
114125
eext=""
115126
oext=".dylib"
116127
fi
117-
cp "$ostag/mf6$eext" modflow6/bin
118-
cp "$ostag/libmf6$oext" modflow6/bin
119-
cp "$ostag/zbud6$eext" modflow6/bin
128+
cp "executables/$ostag/mf6$eext" modflow6/bin
129+
cp "executables/$ostag/libmf6$oext" modflow6/bin
130+
cp "executables/$ostag/zbud6$eext" modflow6/bin
120131
121132
# set execute permissions
122133
if [[ "$RUNNER_OS" != "Windows" ]]; then
@@ -127,28 +138,28 @@ jobs:
127138
- name: Show programs
128139
run: |
129140
ostag="${{ steps.ostag.outputs.ostag }}"
130-
ls $ostag
141+
ls executables/$ostag
131142
132-
- name: Check linked libs (ARM macOS)
133-
if: matrix.os == 'macos-14'
143+
- name: Check linked libs (macOS)
144+
if: runner.os == 'macOS'
134145
run: |
135146
ostag="${{ steps.ostag.outputs.ostag }}"
136-
find $ostag -perm +111 -type f | xargs -I{} sh -c "otool -L {}"
147+
find executables/$ostag -perm +111 -type f | xargs -I{} sh -c "otool -L {}"
137148
138149
- name: Upload programs
139150
uses: actions/upload-artifact@v4
140151
with:
141152
name: ${{ steps.ostag.outputs.ostag }}
142-
path: ${{ steps.ostag.outputs.ostag }}.zip
153+
path: executables/${{ steps.ostag.outputs.ostag }}.zip
143154

144155
- name: Upload metadata
145156
if: runner.os == 'Linux'
146157
uses: actions/upload-artifact@v4
147158
with:
148159
name: ${{ steps.ostag.outputs.ostag }}
149160
path: |
150-
./code.json
151-
./code.md
161+
executables/code.json
162+
executables/code.md
152163
153164
- name: Update flopy
154165
working-directory: modflow6

.github/workflows/release.yml

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- master
99
workflow_dispatch:
1010
env:
11-
DIST: dist
11+
DIST: executables
1212
GCC_V: 12
1313
INTEL_V: 2021.7
1414
jobs:
@@ -18,7 +18,7 @@ jobs:
1818
strategy:
1919
fail-fast: false
2020
matrix:
21-
os: [ubuntu-22.04, macos-14, windows-2022]
21+
os: [ubuntu-22.04, macos-14, macos-15-intel, windows-2022]
2222
defaults:
2323
run:
2424
shell: bash
@@ -33,29 +33,31 @@ jobs:
3333
repository: MODFLOW-ORG/modflow6
3434
path: modflow6
3535

36-
- name: Setup ${{ contains(fromJSON('["macos-14"]'), matrix.os) && 'gcc' || 'intel-classic' }} ${{ contains(fromJSON('["macos-14"]'), matrix.os) && env.GCC_V || env.INTEL_V }}
36+
- name: Setup ${{ contains(fromJSON('["macOS"]'), runner.os) && 'gcc' || 'intel-classic' }} ${{ contains(fromJSON('["macOS"]'), runner.os) && env.GCC_V || env.INTEL_V }}
3737
uses: fortran-lang/setup-fortran@v1
3838
with:
39-
compiler: ${{ contains(fromJSON('["macos-14"]'), matrix.os) && 'gcc' || 'intel-classic' }}
40-
version: ${{ contains(fromJSON('["macos-14"]'), matrix.os) && env.GCC_V || env.INTEL_V }}
39+
compiler: ${{ contains(fromJSON('["macOS"]'), runner.os) && 'gcc' || 'intel-classic' }}
40+
version: ${{ contains(fromJSON('["macOS"]'), runner.os) && env.GCC_V || env.INTEL_V }}
4141

4242
- name: Setup Xcode CLT (macOS)
4343
uses: maxim-lobanov/setup-xcode@v1
4444
if: runner.os == 'macOS'
4545
with:
46-
xcode-version: ${{ contains(fromJSON('["macos-13"]'), matrix.os) && '14.3.1' || 'latest' }}
46+
xcode-version: 'latest'
4747

48-
- name: Set LDFLAGS (ARM macOS)
49-
if: matrix.os == 'macos-14'
48+
- name: Set LDFLAGS (macOS)
49+
if: runner.os == 'macOS'
5050
run: |
5151
ldflags="$LDFLAGS -Wl,-ld_classic"
5252
echo "LDFLAGS=$ldflags" >> $GITHUB_ENV
5353
54-
- name: Hide dylibs (ARM macOS)
55-
if: matrix.os == 'macos-14'
54+
- name: Hide dylibs (macOS)
55+
if: runner.os == 'macOS'
5656
run: |
57-
version="12"
58-
libpath="/opt/homebrew/opt/gcc@$version/lib/gcc/$version"
57+
version=${{ env.GCC_V }}
58+
brew_prefix="$(brew --prefix)"
59+
libpath="$brew_prefix/opt/gcc@$version/lib/gcc/$version"
60+
mv $libpath/libgcc_s.1.1.dylib $libpath/libgcc_s.1.1.dylib.bak
5961
mv $libpath/libgfortran.5.dylib $libpath/libgfortran.5.dylib.bak
6062
mv $libpath/libquadmath.0.dylib $libpath/libquadmath.0.dylib.bak
6163
mv $libpath/libstdc++.6.dylib $libpath/libstdc++.6.dylib.bak
@@ -95,7 +97,7 @@ jobs:
9597
run: |
9698
ostag="${{ steps.ostag.outputs.ostag }}"
9799
mkdir $ostag
98-
python3 scripts/fetch_releases.py --manifest releases.json --ostag $ostag --outdir $ostag --zip $ostag.zip
100+
pixi run --manifest-path modflow6/pixi.toml python scripts/fetch_releases.py --manifest releases.json --ostag $ostag --outdir $ostag --zip $ostag.zip
99101
100102
- name: Build programs
101103
uses: nick-fields/retry@v3
@@ -104,17 +106,17 @@ jobs:
104106
timeout_minutes: 40
105107
command: |
106108
ostag="${{ steps.ostag.outputs.ostag }}"
107-
fetched=$(python3 scripts/fetch_releases.py --manifest releases.json --list)
109+
fetched=$(pixi run --manifest-path modflow6/pixi.toml python scripts/fetch_releases.py --manifest releases.json --list)
108110
pixi run --manifest-path modflow6/pixi.toml make-program : --appdir $ostag --exclude "$fetched" --zip $ostag.zip --verbose
109-
pixi run --manifest-path modflow6/pixi.toml make-program mf2005,mflgr,mfnwt,mfusg --appdir $ostag --double --keep --zip $ostag.zip --verbose
111+
pixi run --manifest-path modflow6/pixi.toml make-program mf2005,mfusg --appdir $ostag --double --keep --zip $ostag.zip --verbose
110112
pixi run --manifest-path modflow6/pixi.toml make-code-json --appdir $ostag --zip $ostag.zip --verbose
111113
112114
- name: Show programs
113115
run: |
114116
ostag="${{ steps.ostag.outputs.ostag }}"
115117
ls $ostag
116118
117-
- name: Check linked libs (ARM macOS)
119+
- name: Check linked libs (macOS)
118120
if: runner.os == 'macOS'
119121
run: |
120122
ostag="${{ steps.ostag.outputs.ostag }}"
@@ -123,7 +125,7 @@ jobs:
123125
- name: Upload distribution archive
124126
uses: actions/upload-artifact@v4
125127
with:
126-
name: ${{ env.DIST }}-${{ matrix.os }}
128+
name: ${{ env.DIST }}-${{ steps.ostag.outputs.ostag }}
127129
path: ./*.zip
128130

129131
- name: Upload distribution metadata
@@ -185,7 +187,7 @@ jobs:
185187
path: ${{ env.DIST }}
186188

187189
- name: List distribution files
188-
run: ls -l ${{ steps.ostag.outputs.ostag }}
190+
run: ls -l ${{ env.DIST }}
189191

190192
- name: Create release body header
191193
shell: python

releases.json

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
[
22
{
33
"repo": "MODFLOW-ORG/modflow6",
4-
"tag": "6.6.3",
4+
"tag": "6.7.0",
55
"assets": {
6-
"linux": "mf6.6.3_linux.zip",
7-
"mac": "mf6.6.3_mac.zip",
8-
"macarm": "mf6.6.3_macarm.zip",
9-
"win64": "mf6.6.3_win64.zip"
6+
"linux": "mf6.7.0_linux.zip",
7+
"mac": "mf6.7.0_mac.zip",
8+
"macarm": "mf6.7.0_macarm.zip",
9+
"win64": "mf6.7.0_win64.zip"
1010
},
1111
"programs": {
1212
"mf6": "mf6",
1313
"zbud6": "zbud6",
14+
"mf5to6": "mf5to6",
1415
"libmf6": "libmf6"
1516
}
1617
},
@@ -67,16 +68,83 @@
6768
}
6869
},
6970
{
70-
"repo": "MODFLOW-ORG/mfusgt",
71-
"tag": "v2.6.0",
71+
"repo": "MODFLOW-ORG/mfnwt",
72+
"tag": "v1.3.0",
7273
"assets": {
7374
"linux": "linux.zip",
7475
"mac": "mac.zip",
7576
"macarm": "macarm.zip",
7677
"win64": "win64.zip"
7778
},
7879
"programs": {
79-
"mfusg_gsi": "mfusgt"
80+
"mfnwt": "mfnwt",
81+
"mfnwtdbl": "mfnwtdbl"
82+
}
83+
},
84+
{
85+
"repo": "MODFLOW-ORG/swtv4",
86+
"tag": "v4.00.05",
87+
"assets": {
88+
"linux": "linux.zip",
89+
"mac": "mac.zip",
90+
"macarm": "macarm.zip",
91+
"win64": "win64.zip"
92+
},
93+
"programs": {
94+
"swtv4": "swtv4"
95+
}
96+
},
97+
{
98+
"repo": "MODFLOW-ORG/modpath6",
99+
"tag": "v6.0.1",
100+
"assets": {
101+
"linux": "linux.zip",
102+
"mac": "mac.zip",
103+
"macarm": "macarm.zip",
104+
"win64": "win64.zip"
105+
},
106+
"programs": {
107+
"mp6": "mp6"
108+
}
109+
},
110+
{
111+
"repo": "MODFLOW-ORG/vs2dt",
112+
"tag": "v3.3",
113+
"assets": {
114+
"linux": "linux.zip",
115+
"mac": "mac.zip",
116+
"macarm": "macarm.zip",
117+
"win64": "win64.zip"
118+
},
119+
"programs": {
120+
"vs2dt": "vs2dt"
121+
}
122+
},
123+
{
124+
"repo": "MODFLOW-ORG/mflgr",
125+
"tag": "v2.0.0",
126+
"assets": {
127+
"linux": "linux.zip",
128+
"mac": "mac.zip",
129+
"macarm": "macarm.zip",
130+
"win64": "win64.zip"
131+
},
132+
"programs": {
133+
"mflgr": "mflgr",
134+
"mflgrdbl": "mflgrdbl"
135+
}
136+
},
137+
{
138+
"repo": "MODFLOW-ORG/mf2000",
139+
"tag": "v1.19.01",
140+
"assets": {
141+
"linux": "linux.zip",
142+
"mac": "mac.zip",
143+
"macarm": "macarm.zip",
144+
"win64": "win64.zip"
145+
},
146+
"programs": {
147+
"mf2000": "mf2000"
80148
}
81149
}
82150
]

0 commit comments

Comments
 (0)