-
Notifications
You must be signed in to change notification settings - Fork 5
644 lines (550 loc) · 24.5 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
name: release
concurrency: release
env:
PYTHON_VERSION_BUMP: "3.12"
PYTHON_VERSION_BUILD_EXES: "3.12"
PYTHON_VERSION_RELEASE: "3.12"
PYTHON_VERSION_BUILD_DOCS: "3.12"
PYTHON_VERSION_UPDATE_WEB: "3.12"
POETRY_VERSION: "1.4"
on:
pull_request_target:
branches: [main, develop]
types: [closed]
jobs:
bump-version:
if:
| # skip if: trying to re-run; PR is closed without merging; '[skip release]' is in the PR title; or if merging any branch other than pre_release_branch into release_branch
(
github.run_attempt == '1'
&& github.event.pull_request.merged
&& ! contains(github.event.pull_request.title, '[skip release]')
&& (
github.event.pull_request.base.ref == 'develop' || (
github.event.pull_request.base.ref == 'main'
&& github.event.pull_request.head.ref == 'develop'
)
)
)
runs-on: ubuntu-latest
outputs:
new_tag_name: ${{ steps.get_new_tag.outputs.new_tag_name }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # get all history and tags
ref: ${{ github.event.pull_request.base.ref }}
token: ${{ secrets.HPCFLOW_ACTIONS_TOKEN }}
- run: |
git config user.name hpcflow-actions
git config user.email hpcflow-actions@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION_BUMP }}
- name: Get git-chglog executable
run: |
wget https://github.com/git-chglog/git-chglog/releases/download/v0.15.0/git-chglog_0.15.0_linux_amd64.tar.gz
tar --extract --file git-chglog_0.15.0_linux_amd64.tar.gz git-chglog
- name: Install commitizen
run: pip install commitizen
- name: Manipulate tags (stable release)
if: github.event.pull_request.base.ref == 'main'
run:
| # delete all pre-release tags, set current version to the latest stable release,
CUR_PRE_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "CUR_PRE_TAG is: $CUR_PRE_TAG"
echo "cur_pre_tag=$CUR_PRE_TAG" >> $GITHUB_ENV
git tag -l | awk '/^(v[0-9]+\.[0-9]+\.[0-9]+(a|b|rc).*)$/ {print $1}' | xargs git tag -d
- name: Get current tag
run: |
CUR_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "CUR_TAG is: $CUR_TAG"
echo "cur_tag=$CUR_TAG" >> $GITHUB_ENV
- name: Commitizen bump (pre-release) # Bump version strings (pre-release) and add a new tag; commit
if: github.event.pull_request.base.ref == 'develop'
run: cz bump --prerelease alpha
- name: Commitizen bump # First update version number to latest stable release, then bump to new stable release, add a new tag and commit
if: github.event.pull_request.base.ref == 'main'
run: |
python3 -c "
from commitizen.bump import update_version_in_files
update_version_in_files(
current_version='${{ env.cur_pre_tag }}'.lstrip('v'),
new_version='${{ env.cur_tag }}'.lstrip('v'),
files=['pyproject.toml', 'hpcflow/_version.py'],
)"
cz bump
- name: Get new tag
id: get_new_tag
run: |
NEW_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "NEW_TAG is: $NEW_TAG"
echo "new_tag=$NEW_TAG" >> $GITHUB_ENV
echo "new_tag_name=$NEW_TAG" >> $GITHUB_OUTPUT
- name: Generate CHANGELOG (stable release)
if: github.event.pull_request.base.ref == 'main'
run: |
./git-chglog --output CHANGELOG.md
git add CHANGELOG.md
- name: Generate CHANGELOG-dev (pre-release)
if: github.event.pull_request.base.ref == 'develop'
run: |
./git-chglog --output CHANGELOG-dev.md
git add CHANGELOG-dev.md
- name: Push new CHANGELOG
run: |
git tag -d ${{ env.new_tag }}
git commit --amend --no-edit
git tag ${{ env.new_tag }}
git push && git push origin ${{ env.new_tag }}
- name: Rebase into develop branch if exists (stable release)
if: github.event.pull_request.base.ref == 'main'
run: |
exists_in_remote=$(git ls-remote --heads origin refs/heads/develop)
echo "exists_in_remote: $exists_in_remote"
if [[ -n $exists_in_remote ]]; then
export SKIP=end-of-file-fixer
git checkout develop
git pull
git rebase main
git push -u origin develop
else
echo "No develop branch to merge into."
fi
- name: Generate incremental CHANGELOG for GitHub release body (stable release)
if: github.event.pull_request.base.ref == 'main'
run: |
./git-chglog --template .chglog/RELEASE.tpl.md --output CHANGELOG_increment.md ${{ env.cur_tag }}..
cat CHANGELOG_increment.md
- name: Generate incremental CHANGELOG for GitHub release body (pre-release)
if: github.event.pull_request.base.ref == 'develop'
run: |
./git-chglog --template .chglog/RELEASE.tpl.md --output CHANGELOG_increment.md ${{ env.new_tag }}
cat CHANGELOG_increment.md
- uses: actions/upload-artifact@v4
with:
name: CHANGELOG_increment
path: CHANGELOG_increment.md
build-executables:
needs: bump-version
strategy:
fail-fast: false
matrix:
os: [windows-2019, macos-13]
include:
- os: windows-2019
executable_ext: .exe
executable_os: win
- os: macos-13
executable_ext: ""
executable_os: macOS
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }} # otherwise we get the ref when the workflow started (missing above commit)
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION_BUILD_EXES }}
- name: Cache the virtualenv
uses: actions/cache@v4
with:
path: ./.venv
key: venv-build-${{ matrix.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install poetry
run: python -m pip install poetry==${{ env.POETRY_VERSION }}
- name: Configure poetry
run: |
poetry config virtualenvs.in-project true
poetry config installer.modern-installation false
- name: Install dependencies
run: poetry install --without dev
- name: Build with pyinstaller (non-Windows, file)
if: "!contains(matrix.os, 'windows')"
working-directory: pyinstaller
run: ./make.sh hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }} INFO 'onefile'
- name: Build with pyinstaller (non-Windows, folder)
if: "!contains(matrix.os, 'windows')"
working-directory: pyinstaller
run: ./make.sh hpcflow-${{ needs.bump-version.outputs.new_tag_name}}-${{ matrix.executable_os }}-dir INFO 'onedir'
- name: Build with pyinstaller (Windows, file)
if: contains(matrix.os, 'windows')
working-directory: pyinstaller
run: ./make.ps1 -ExeName 'hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}' -LogLevel INFO -BuildType 'onefile'
- name: Build with pyinstaller (Windows, folder)
if: contains(matrix.os, 'windows')
working-directory: pyinstaller
run: ./make.ps1 -ExeName 'hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}-dir' -LogLevel INFO -BuildType 'onedir'
- name: Version check (windows, file)
if: contains(matrix.os, 'windows')
run: |
$tag = "${{ needs.bump-version.outputs.new_tag_name }}"
$tagNoV = $tag.trim('v')
$hpcflow_vers = pyinstaller/dist/onefile/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}${{ matrix.executable_ext }} --version
$hpcflow_vers_expected = "hpcFlow, version $tagNoV"
echo $hpcflow_vers
echo "$hpcflow_vers_expected"
if ($hpcflow_vers -ne $hpcflow_vers_expected) {
exit 1
}
- name: Version check (windows, folder)
if: contains(matrix.os, 'windows')
run: |
$tag = "${{ needs.bump-version.outputs.new_tag_name }}"
$tagNoV = $tag.trim('v')
$hpcflow_vers = pyinstaller/dist/onedir/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}-dir/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}-dir${{ matrix.executable_ext }} --version
$hpcflow_vers_expected = "hpcFlow, version $tagNoV"
echo $hpcflow_vers
echo "$hpcflow_vers_expected"
if ($hpcflow_vers -ne $hpcflow_vers_expected) {
exit 1
}
- name: Version check (non-windows, file)
if: "!contains(matrix.os, 'windows')"
run: |
tag=${{ needs.bump-version.outputs.new_tag_name }}
tagNoV=${tag:1}
hpcflow_vers=$(pyinstaller/dist/onefile/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}${{ matrix.executable_ext }} --version)
hpcflow_vers_expected="hpcFlow, version $tagNoV"
echo $hpcflow_vers
echo $hpcflow_vers_expected
[ "$hpcflow_vers" = "$hpcflow_vers_expected" ]
- name: Version check (non-windows, folder)
if: "!contains(matrix.os, 'windows')"
run: |
tag=${{ needs.bump-version.outputs.new_tag_name }}
tagNoV=${tag:1}
hpcflow_vers=$(pyinstaller/dist/onedir/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}-dir/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}-dir${{ matrix.executable_ext }} --version)
hpcflow_vers_expected="hpcFlow, version $tagNoV"
echo $hpcflow_vers
echo $hpcflow_vers_expected
[ "$hpcflow_vers" = "$hpcflow_vers_expected" ]
- name: Run test suite on the frozen app (folder)
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pyinstaller/dist/onedir/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}-dir/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}-dir${{ matrix.executable_ext }} test
- name: Compress folder (windows, folder)
if: contains(matrix.os, 'windows')
working-directory: pyinstaller
run: ./compress.ps1 -ExeName 'hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}-dir' -BuildType 'onedir'
- name: Compress folder (non-windows, folder)
if: "!contains(matrix.os, 'windows')"
working-directory: pyinstaller
run: ./compress.sh hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}-dir 'onedir'
- name: Upload executable artifact (file)
uses: actions/upload-artifact@v4
with:
name: hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}${{ matrix.executable_ext }}
path: pyinstaller/dist/onefile/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}${{ matrix.executable_ext }}
- name: Upload executable artifact (compressed folder)
uses: actions/upload-artifact@v4
with:
name: hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}-dir.zip
path: pyinstaller/dist/onedir/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-${{ matrix.executable_os }}-dir.zip
build-executables-linux:
runs-on: ubuntu-latest
needs: bump-version
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }} # otherwise we get the ref when the workflow started (missing above commit)
- name: Cache the virtualenv
uses: actions/cache@v4
with:
path: ./.venv
key: venv-build-CentOS-${{ hashFiles('**/poetry.lock') }}
- name: Build executables within Docker
uses: addnab/docker-run-action@v3
with:
image: ghcr.io/hpcflow/centos7-poetry:latest
options: -v ${{ github.workspace }}:/home --env GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
run: |
# set up poetry
cd /home
poetry config virtualenvs.in-project true
poetry config installer.modern-installation false
poetry install --without dev
# build with pyinstaller for CentOS (file)
cd pyinstaller
./make.sh hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux INFO onefile
cd ..
# version check (file)
tag=${{ needs.bump-version.outputs.new_tag_name }}
tagNoV=${tag:1}
hpcflow_vers=$(pyinstaller/dist/onefile/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux --version)
hpcflow_vers_expected="hpcFlow, version $tagNoV"
echo $hpcflow_vers
echo $hpcflow_vers_expected
[ "$hpcflow_vers" = "$hpcflow_vers_expected" ]
# run test suite on the frozen app (file)
pyinstaller/dist/onefile/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux test
# build with pyinstaller for CentOS (folder)
cd pyinstaller
./make.sh hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux-dir INFO onedir
cd ..
# version check (folder)
tag=${{ needs.bump-version.outputs.new_tag_name }}
tagNoV=${tag:1}
hpcflow_vers=$(pyinstaller/dist/onedir/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux-dir/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux-dir --version)
hpcflow_vers_expected="hpcFlow, version $tagNoV"
echo $hpcflow_vers
echo $hpcflow_vers_expected
[ "$hpcflow_vers" = "$hpcflow_vers_expected" ]
# run test suite on the frozen app (folder)
pyinstaller/dist/onedir/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux-dir/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux-dir test
# Compress folder (folder)
cd pyinstaller
./compress.sh hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux-dir 'onedir'
cd ..
- run: tree .
- name: Upload executable artifact (file)
uses: actions/upload-artifact@v4
with:
name: hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux
path: pyinstaller/dist/onefile/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux
- name: Upload executable artifact (compressed folder)
uses: actions/upload-artifact@v4
with:
name: hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux-dir.zip
path: pyinstaller/dist/onedir/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux-dir.zip
make-workflow-benchmark:
needs: bump-version
strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.12"
os:
- ubuntu-latest
- macos-13
- windows-latest
num_elements:
- 1
- 100
- 10000
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install and configure poetry
run: |
python -m pip install poetry==${{ env.POETRY_VERSION }}
poetry config virtualenvs.in-project true
poetry config installer.modern-installation false
- name: Cache the virtualenv
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ runner.os }}-test-${{ matrix.python-version }}-venv-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
poetry install --without dev,pyinstaller
- name: Run app make workflow command
run: |
poetry run hpcflow --timeit-file benchmark_make_workflow_${{ matrix.num_elements }}_elements-${{ runner.os }}-py-${{ matrix.python-version }}.txt make ./hpcflow/tests/data/benchmark_N_elements.yaml --var N ${{ matrix.num_elements }}
- uses: actions/upload-artifact@v4
with:
name: benchmark_make_workflow_${{ matrix.num_elements }}_elements-${{ runner.os }}-py-${{ matrix.python-version }}.txt
path: benchmark_make_workflow_${{ matrix.num_elements }}_elements-${{ runner.os }}-py-${{ matrix.python-version }}.txt
make-workflow-benchmark-upload:
needs: make-workflow-benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
- run: |
mkdir benchmarks
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: benchmarks
- name: zip benchmark results
run: |
zip -r ./benchmarks.zip benchmarks
- uses: actions/upload-artifact@v4
with:
name: benchmarks.zip
path: benchmarks.zip
release-github-PyPI:
needs:
- bump-version
- build-executables
- build-executables-linux
- make-workflow-benchmark-upload
runs-on: ubuntu-latest
outputs:
binary_download_links: ${{ steps.get_binary_download_links.outputs.binary_download_links }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }} # otherwise we get the ref when the workflow started (missing above commit)
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION_RELEASE }}
- name: Cache the virtualenv
uses: actions/cache@v4
with:
path: ./.venv
key: venv-release-${{ hashFiles('**/poetry.lock') }}
- name: Install poetry
run: python -m pip install poetry==${{ env.POETRY_VERSION }}
- name: Configure poetry
run: |
poetry config virtualenvs.in-project true
poetry config installer.modern-installation false
- name: Install dependencies
run: poetry install --without dev,pyinstaller
- name: Build (for PyPI)
run: |
poetry build
- run: mkdir release-artifacts
- uses: actions/download-artifact@v4
with:
path: release-artifacts
- uses: actions/download-artifact@v3 # for CentOS (docker) build-exes
with:
path: release-artifacts
- name: Display structure of downloaded files
run: ls -R
- name: Release
id: release
uses: softprops/action-gh-release@v2
with:
body_path: release-artifacts/CHANGELOG_increment/CHANGELOG_increment.md
tag_name: ${{ needs.bump-version.outputs.new_tag_name }}
files: |
**/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-win.exe
**/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-macOS
**/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux
**/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-win-dir.zip
**/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-macOS-dir.zip
**/hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-linux-dir.zip
**/benchmarks.zip
prerelease: ${{ github.event.pull_request.base.ref == 'develop' }}
- name: Release info
id: get_binary_download_links
run: |
binaryYaml=$(python3 -c "
from pathlib import Path
out_yaml = ''
for i in ['win.exe', 'macOS', 'linux', 'win-dir.zip', 'macOS-dir.zip', 'linux-dir.zip']:
exe_name = 'hpcflow-${{ needs.bump-version.outputs.new_tag_name }}-' + i
url = 'https://github.com/hpcflow/hpcflow-new/releases/download/${{ needs.bump-version.outputs.new_tag_name }}/' + exe_name
out_yaml += exe_name + ': ' + url + '\n'
print(out_yaml)
")
# Save multiline output
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "binary_download_links<<$EOF" >> $GITHUB_OUTPUT
echo "$binaryYaml" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
- name: Publish (to https://upload.pypi.org/legacy/)
run: |
poetry config repositories.pypi https://upload.pypi.org/legacy/
poetry config pypi-token.pypi ${{ secrets.PYPI }}
poetry publish --repository pypi
build-documentation:
needs: release-github-PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # get all history and tags
ref: ${{ github.event.pull_request.base.ref }} # otherwise we get the ref when the workflow started (missing above commit)
token: ${{ secrets.HPCFLOW_ACTIONS_TOKEN }}
- run: |
git config user.name hpcflow-actions
git config user.email hpcflow-actions@users.noreply.github.com
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION_BUILD_DOCS }}
- name: Write binary links YAML file and push
run: |
echo -e "${{ needs.release-github-PyPI.outputs.binary_download_links }}" > docs/source/released_binaries.yml
git add .
git commit -m "build: update binary download links file [skip ci]"
git push
- name: Rebase into develop branch if exists (stable release)
if: github.event.pull_request.base.ref == 'main'
run: |
exists_in_remote=$(git ls-remote --heads origin refs/heads/develop)
echo "exists_in_remote: $exists_in_remote"
if [[ -n $exists_in_remote ]]; then
export SKIP=end-of-file-fixer
git checkout develop
git pull
git rebase main
git push -u origin develop
else
echo "No develop branch to merge into."
fi
- name: Cache the virtualenv
uses: actions/cache@v4
with:
path: ./.venv
key: venv-release-${{ matrix.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Install poetry
run: python -m pip install poetry==${{ env.POETRY_VERSION }}
- name: Configure poetry
run: |
poetry config virtualenvs.in-project true
poetry config installer.modern-installation false
- name: Install dependencies
run: poetry install --without test,pyinstaller
- name: Build documentation with Sphinx
run: |
cd docs
poetry run make clean
poetry run make html
- name: Upload documentation artifact
uses: actions/upload-artifact@v4
with:
name: docs_html
path: docs/build/html
update-website:
needs: [bump-version, release-github-PyPI, build-documentation]
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION_UPDATE_WEB }}
- uses: actions/checkout@v4
with:
repository: hpcflow/hpcflow.github.io
token: ${{ secrets.HPCFLOW_ACTIONS_TOKEN }}
- run: |
git config user.name hpcflow-actions
git config user.email hpcflow-actions@users.noreply.github.com
- name: Download documentation artifact
uses: actions/download-artifact@v4
with:
name: docs_html
path: docs/${{ needs.bump-version.outputs.new_tag_name }}
- name: Update stable docs symlink
if: github.event.pull_request.base.ref == 'main'
run: |
ln -sfn ${{ needs.bump-version.outputs.new_tag_name }} docs/stable
- name: Update pre-release docs symlink
if: github.event.pull_request.base.ref == 'develop'
run: |
ln -sfn ${{ needs.bump-version.outputs.new_tag_name }} docs/dev
- run: |
tree
- name: Update doc version switcher
run: |
curl https://raw.githubusercontent.com/hpcflow/hpcflow-new/${{ github.ref_name }}/docs/make_vers_switcher.py --output docs/make_vers_switcher.py
python docs/make_vers_switcher.py docs
- name: Push changes
run: |
git add .
git commit -m "update content"
git push