-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (44 loc) · 1.28 KB
/
deploy.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
name: Deploy to PyPI
on:
push:
branches: [ master ]
workflow_dispatch:
inputs:
publish_testpypi:
type: boolean
required: true
description: 'Publish to Test PyPI'
publish_pypi:
type: boolean
required: true
description: 'Publish to PyPI (Production)'
jobs:
build_and_publish:
runs-on: ubuntu-latest
name: Build and publish distribution
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Poetry
run: pip install poetry
- name: Build wheel and sdist
run: poetry build
- name: Publish to Test PyPI
if: ${{ github.event.inputs.publish_testpypi == 'true' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish to PyPI
if: ${{ github.event.inputs.publish_pypi == 'true' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist
password: ${{ secrets.PYPI_API_TOKEN }}