-
Notifications
You must be signed in to change notification settings - Fork 160
76 lines (64 loc) · 2.06 KB
/
pypi-publish.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# A workflow to publish releases to PyPi and TestPyPi.
name: pypi-publish
on:
release:
types: [published]
workflow_dispatch:
inputs:
test_sdist:
description: 'Test the sdist before uploading'
type: boolean
default: true
upload_to_test_pypi:
description: 'Upload to Test PyPi'
type: boolean
default: true
upload_to_pypi:
description: 'Upload to PyPi'
type: boolean
default: false
permissions: read-all
jobs:
pypi-publish:
name: Upload to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/gdm-concordia
permissions:
id-token: write
timeout-minutes: 90
steps:
- name: Checkout Concordia
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Set up Python
uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236
with:
python-version: '3.11'
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install build
- name: Build source distribution
run: python -m build --sdist --outdir dist/
- name: Install from source distribution
if: github.event_name == 'release' || inputs.test_sdist
run: |
pip install setuptools
pip -vvv install dist/*.tar.gz
- name: Test installation
if: github.event_name == 'release' || inputs.test_sdist
run: |
pip install pytest-xdist
pytest -n auto -rax --pyargs concordia
- name: Publish to TestPyPI
if: github.event_name == 'release' || inputs.upload_to_test_pypi
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
with:
repository-url: https://test.pypi.org/legacy/
verbose: true
- name: Publish to PyPI
if: github.event_name == 'release' || inputs.upload_to_pypi
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf
with:
verbose: true