-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (44 loc) · 1.72 KB
/
releasePythonPackage.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
# 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 }}