Skip to content

Commit 5d162fc

Browse files
committed
Add pypi workflow
1 parent 76c8461 commit 5d162fc

1 file changed

Lines changed: 44 additions & 0 deletions

File tree

.github/workflows/pypi.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Release
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
dist:
7+
runs-on: ubuntu-latest
8+
container: ghcr.io/fenics/dolfinx/dolfinx:nightly
9+
env:
10+
DEB_PYTHON_INSTALL_LAYOUT: deb_system
11+
12+
steps:
13+
- uses: actions/checkout@v5
14+
15+
- name: Install build dependencies
16+
run: |
17+
python3 -m pip install --upgrade build twine
18+
python3 -m pip install -r build-requirements.txt
19+
20+
- name: Build SDist and wheel
21+
run: python3 -m build --no-isolation --sdist
22+
23+
- uses: actions/upload-artifact@v4
24+
with:
25+
path: dist/*
26+
27+
- name: Check metadata
28+
run: python3 -m twine check dist/*
29+
30+
publish:
31+
needs: [dist]
32+
runs-on: ubuntu-latest
33+
if: startsWith(github.ref, 'refs/tags')
34+
environment: pypi
35+
permissions:
36+
id-token: write
37+
38+
steps:
39+
- uses: actions/download-artifact@v5
40+
with:
41+
name: artifact
42+
path: dist
43+
44+
- uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)