Skip to content

Commit 09af7c9

Browse files
authored
libsupermesh releases (#12)
* libsupermesh release workflow * Fix build workflow for new containers
1 parent f87cbfd commit 09af7c9

File tree

4 files changed

+122
-58
lines changed

4 files changed

+122
-58
lines changed

.github/workflows/build.yml

Lines changed: 39 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,30 @@
11
name: Install and test libsupermesh
22

33
on:
4-
# Push to master or PR
54
push:
65
branches:
76
- master
87
pull_request:
98

109
jobs:
1110
build:
12-
name: "Build libsupermesh with Ubuntu spatialindex"
13-
# The type of runner that the job will run on
11+
name: Build libsupermesh with Ubuntu spatialindex
1412
runs-on: [self-hosted, Linux]
15-
# The docker container to use.
1613
container:
1714
image: firedrakeproject/firedrake-env:latest
18-
1915
steps:
2016
- uses: actions/checkout@v4
2117

2218
- uses: mpi4py/setup-mpi@v1
2319
with:
2420
mpi: openmpi
2521

26-
- name: Install spatialindex
27-
shell: bash
22+
- name: Install build dependencies
2823
run: |
2924
sudo apt-get -y update
30-
sudo apt-get -y install libspatialindex-dev
25+
sudo apt-get -y install build-essential cmake libspatialindex-dev
3126
32-
- name: CMake
27+
- name: Install libsupermesh
3328
run: |
3429
cd build
3530
cmake .. \
@@ -40,90 +35,77 @@ jobs:
4035
-DCMAKE_C_COMPILER=mpicc \
4136
-DCMAKE_CXX_COMPILER=mpicxx \
4237
-DCMAKE_Fortran_COMPILER=mpif90
43-
44-
- name: Build
45-
run: |
46-
cd build
4738
make
4839
49-
- name: Test
50-
run: |
51-
cd build
52-
make test
40+
- name: Run tests
41+
run: make -C build test
5342

5443
build_rtree:
55-
name: "Build libsupermesh with Rtree spatialindex"
56-
# The type of runner that the job will run on
57-
runs-on: self-hosted
58-
# The docker container to use.
44+
name: Build libsupermesh with Rtree spatialindex
45+
runs-on: [self-hosted, Linux]
5946
container:
6047
image: firedrakeproject/firedrake-env:latest
6148

6249
steps:
63-
- uses: actions/checkout@v4
50+
- name: Install build dependencies
51+
run: |
52+
sudo apt-get -y update
53+
sudo apt-get -y install build-essential cmake libopenmpi-dev
6454
6555
- uses: actions/setup-python@v4
6656
with:
6757
python-version: '3.11'
6858

59+
- uses: actions/checkout@v4
60+
61+
- name: Create virtual environment
62+
run: python3 -m venv venv-libsupermesh
63+
6964
- name: Install Rtree
70-
shell: bash
7165
run: |
72-
cd ..
73-
python -m venv test
74-
source test/bin/activate
75-
pip install "rtree>=1.2"
66+
. venv-libsupermesh/bin/activate
67+
pip install 'rtree>=1.2'
7668
77-
- name: CMake
78-
shell: bash
69+
- name: Install libsupermesh
7970
run: |
80-
source ../test/bin/activate
81-
cd build
71+
. venv-libsupermesh/bin/activate
8272
unset pythonLocation
8373
unset Python_ROOT_DIR
8474
unset Python2_ROOT_DIR
8575
unset Python3_ROOT_DIR
76+
cd build
8677
cmake .. \
8778
-DBUILD_SHARED_LIBS=ON \
88-
-DMPI_C_COMPILER=$MPICH_DIR/mpicc \
89-
-DMPI_CXX_COMPILER=$MPICH_DIR/mpicxx \
90-
-DMPI_Fortran_COMPILER=$MPICH_DIR/mpif90 \
91-
-DCMAKE_C_COMPILER=$MPICH_DIR/mpicc \
92-
-DCMAKE_CXX_COMPILER=$MPICH_DIR/mpicxx \
93-
-DCMAKE_Fortran_COMPILER=$MPICH_DIR/mpif90 \
94-
-DMPIEXEC_EXECUTABLE=$MPICH_DIR/mpiexec
95-
96-
- name: Build
97-
run: |
98-
cd build
79+
-DMPI_C_COMPILER=/usr/bin/mpicc \
80+
-DMPI_CXX_COMPILER=/usr/bin/mpicxx \
81+
-DMPI_Fortran_COMPILER=/usr/bin/mpif90 \
82+
-DCMAKE_C_COMPILER=/usr/bin/mpicc \
83+
-DCMAKE_CXX_COMPILER=/usr/bin/mpicxx \
84+
-DCMAKE_Fortran_COMPILER=/usr/bin/mpif90 \
85+
-DMPIEXEC_EXECUTABLE=/usr/bin/mpiexec
9986
make
10087
101-
- name: Test
102-
run: |
103-
cd build
104-
make test
88+
- name: Run tests
89+
run: make -C build test
10590

10691
# NOTE: The pip-installed version of libsupermesh does not include any tests, so only check
10792
# that it builds.
10893
build_pip:
109-
name: "Build libsupermesh with pip"
110-
# The type of runner that the job will run on
111-
runs-on: self-hosted
112-
# The docker container to use.
94+
name: Build libsupermesh with pip
95+
runs-on: [self-hosted, Linux]
11396
container:
11497
image: firedrakeproject/firedrake-env:latest
115-
11698
steps:
99+
- name: Install build dependencies
100+
run: |
101+
sudo apt-get -y update
102+
sudo apt-get -y install build-essential cmake libopenmpi-dev
103+
117104
- uses: actions/checkout@v4
118105

119106
- uses: actions/setup-python@v4
120107
with:
121108
python-version: '3.11'
122109

123110
- name: Install libsupermesh
124-
shell: bash
125-
run: |
126-
python -m venv ../test_env
127-
source ../test_env/bin/activate
128-
export MPI_HOME=$MPICH_DIR
129-
pip install .
111+
run: python3 -m pip install --break-system-packages .

.github/workflows/release.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Publish release
2+
3+
# Whenever we publish a release we want to:
4+
# * Upload a new version to PyPI
5+
# * Upload the built files to the GitHub release
6+
#
7+
# The process for making a release is therefore to:
8+
# 1. Modify the version specified in the pyproject.toml
9+
# 2. Make a release using the GitHub web interface
10+
#
11+
# This workflow was shamelessly taken (and modified) from
12+
# https://github.com/NGSolve/ngsPETSc/blob/main/.github/workflows/release.yml and
13+
# https://github.com/ArjanCodes/examples/blob/main/2024/publish_pypi/release.yaml
14+
15+
on:
16+
release:
17+
types: [published]
18+
19+
env:
20+
PACKAGE_NAME: "libsupermesh"
21+
22+
jobs:
23+
build:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: "3.12"
32+
33+
- name: Build libsupermesh
34+
run: |
35+
pip install build
36+
python -m build --sdist --verbose .
37+
38+
- name: Upload artifacts
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: dist
42+
path: dist/
43+
44+
pypi-publish:
45+
name: Upload release to PyPI
46+
needs: build
47+
runs-on: ubuntu-latest
48+
environment:
49+
name: release
50+
permissions:
51+
id-token: write
52+
steps:
53+
- name: Download artifacts
54+
uses: actions/download-artifact@v4
55+
with:
56+
name: dist
57+
path: dist/
58+
59+
- name: Publish distribution to PyPI
60+
uses: pypa/gh-action-pypi-publish@release/v1
61+
62+
github-release:
63+
name: Upload artifacts to GitHub release
64+
needs: build
65+
runs-on: ubuntu-latest
66+
permissions:
67+
contents: write
68+
steps:
69+
- uses: actions/checkout@v4
70+
71+
- name: Download artifacts
72+
uses: actions/download-artifact@v4
73+
with:
74+
name: dist
75+
path: dist/
76+
77+
- name: Upload artifacts to GitHub release
78+
env:
79+
GH_TOKEN: ${{ github.token }}
80+
run: gh release upload ${{ github.event.release.tag_name }} dist/*

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist/

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ requires = ["scikit-build-core", "rtree>=1.2"]
44

55
[project]
66
name = "libsupermesh"
7-
version = "1.0.1"
7+
# <year.month.patch>
8+
version = "2025.3.0"
89
description = "A parallel supermeshing library"
910
readme = "README.md"
1011
authors = [

0 commit comments

Comments
 (0)