-
Notifications
You must be signed in to change notification settings - Fork 56
57 lines (52 loc) · 1.44 KB
/
pypi-release.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
name: PyPI-Release
on:
workflow_dispatch:
push:
branches:
- main
- 'tag/v**'
jobs:
build_dist:
name: Build source distribution
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build SDist and wheel
run: pipx run build
- uses: actions/upload-artifact@v3
with:
path: dist/*
- name: Check metadata
run: pipx run twine check dist/*
publish:
runs-on: ubuntu-22.04
if: github.event_name == 'push'
needs: [ build_dist ]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'pip'
- name: Install build dependencies
run: pip install -U setuptools wheel build
- uses: actions/download-artifact@v3
with:
# unpacks default artifact into dist/
# if `name: artifact` is omitted, the action will create extra parent dir
name: artifact
path: dist
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}
- name: Install GitPython and cloudevents for pypi_packaging
run: pip install -U -r requirements/publish.txt
- name: Create Tag
run: python pypi_packaging.py