add documentation target (#44) #52
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: 2023 The dune-iga developers [email protected] | |
# SPDX-License-Identifier: LGPL-3.0-or-later | |
name: Publish Python distributions to PyPI | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'docs/**' | |
- '.github/workflows/ghpages.yml' | |
- '.github/workflows/createDockerContainer.yml' | |
- '**.md' | |
release: | |
types: [published ] | |
jobs: | |
build-n-publish: | |
runs-on: ubuntu-latest | |
container: | |
image: ikarusproject/ikarus-dev:latest | |
options: --memory-swap="20g" --memory="20g" --cpus="2" --user root | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install twine and scikit-build | |
run: | | |
/dune/dune-common/build-cmake/run-in-dune-env pip install twine scikit-build | |
git config --global --add safe.directory /__w/dune-iga/dune-iga | |
- name: Bump dev version | |
if: ${{ github.event_name == 'push' }} | |
run: /dune/dune-common/build-cmake/run-in-dune-env python .github/workflows/scripts/release.py dev | |
- name: Create release version | |
if: ${{ github.event_name == 'release' }} | |
run: /dune/dune-common/build-cmake/run-in-dune-env python .github/workflows/scripts/release.py ${{ github.event.release.tag_name }} | |
- name: Create tarball | |
run: | | |
/dune/dune-common/build-cmake/run-in-dune-env python setup.py sdist | |
- name: Publish distribution to Test PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.TESTPYPI_TOKEN }} | |
repository-url: https://test.pypi.org/legacy/ | |
- name: Publish distribution 📦 to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_TOKEN }} |