-
Notifications
You must be signed in to change notification settings - Fork 51
68 lines (57 loc) · 1.88 KB
/
publish_to_pypi.yaml
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: Publish dpsim package to PyPi
on:
push:
branches:
- master
tags:
- '*'
jobs:
build-and-publish-sdist:
name: Build dpsim sdist and publish to PyPi
runs-on: ubuntu-latest
container: sogno/dpsim:dev
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build dpsim source dist
shell: bash
run: python3 -m build --sdist --outdir dist/
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1.8
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1.8
with:
password: ${{ secrets.PYPI_API_TOKEN }}
build-and-publish-wheels:
name: Build dpsim wheels and publish to PyPi
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
# - name: Build manylinux docker image # Remove this step as soon as the image is published on docker hub
# shell: bash
# run: docker build . --file packaging/Docker/Dockerfile.manylinux -t sogno/dpsim:manylinux
- name: Build dpsim wheels for all supported python versions
uses: pypa/[email protected]
with:
output-dir: dist
- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1.8
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1.8
with:
password: ${{ secrets.PYPI_API_TOKEN }}