-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (42 loc) · 1.11 KB
/
cd.yml
File metadata and controls
49 lines (42 loc) · 1.11 KB
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
name: continuous-deployment
# deploy on creating a release tag vX.Y.Z
# will only be published to PyPi if the tests pass
on:
release:
types: [created]
workflow_dispatch:
jobs:
ci:
permissions:
contents: read
uses: ./.github/workflows/ci.yml
publish:
name: Publish to PyPi
permissions:
contents: read
needs: [ci]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install flit
run: |
pip install flit~=3.4
- name: Build and Publish to TestPyPi
if: github.event_name == 'workflow_dispatch'
run: |
flit publish
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }}
FLIT_INDEX_URL: https://test.pypi.org/legacy/
- name: Build and Publish to PyPi
if: github.event_name == 'release'
run: |
flit publish
env:
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets.PYPI_TOKEN }}