-
Notifications
You must be signed in to change notification settings - Fork 13
46 lines (37 loc) · 1.07 KB
/
ci.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
name: Build and upload to PyPI
# Build on every branch push, tag push, and pull request change:
on: [push, pull_request]
jobs:
build_wheel:
name: Build wheel
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup venv
run: |
python3 -m venv .venv
- name: Install build module
run: |
. .venv/bin/activate
python3 -m pip install -U build
- name: Build wheel and source
run: |
. .venv/bin/activate
python3 -m build --sdist --wheel --outdir dist/ .
- uses: actions/[email protected]
with:
path: dist/*
upload_pypi:
needs: [build_wheel]
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/[email protected]
with:
name: artifact
path: dist
- uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}