-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (36 loc) · 963 Bytes
/
cd.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
name: continuous-deployment
on:
release:
types: [created]
workflow_dispatch:
jobs:
ci:
uses: ./.github/workflows/ci.yml
publish:
name: Publish to PyPi
needs: [ci]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/[email protected]
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_KEY }}
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_KEY }}