Skip to content

Commit

Permalink
Merge pull request #125 from dolfin-adjoint/dokken/pypi-publishing
Browse files Browse the repository at this point in the history
Add pyadjoint-ad publishing workflow
  • Loading branch information
jorgensd authored Feb 27, 2024
2 parents 029a154 + 1fe8d19 commit 4616f3f
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Upload release to pypi
on:
workflow_dispatch:
push:
tags: "v*"

jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/pyadjoint-ad
permissions:
id-token: write

steps:
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: python3 -m pip install build twine

- name: Build a binary wheel and a source tarball
run: python3 -m build --sdist --wheel --outdir dist/ .

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ dist/*
*.xml
*.msh

dist/
build/
11 changes: 11 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
[metadata]
name = dolfin-adjoint
description=High-level automatic differentiation library,
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/dolfin-adjoint/pyadjoint
author= Jørgen S. Dokken,
author_email= [email protected],
license = LGPL-3.0
license_files = LICENSE

[flake8]
exclude = .git,__pycache__,docs/,examples/,tests/,scripts/
max-line-length = 119
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
# 'all' includes all of the above
extras['all'] = list(chain(*extras.values()))

setup(name='pyadjoint',
setup(name='pyadjoint-ad',
version='2023.0.0',
description='High-level automatic differentiation library for FEniCS.',
description='High-level automatic differentiation library.',
author='Jørgen Dokken',
author_email='[email protected]',
packages=['firedrake_adjoint',
Expand Down

0 comments on commit 4616f3f

Please sign in to comment.