-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (43 loc) · 1.07 KB
/
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
name: Build and upload to PyPI
on:
pull_request:
branches:
- 'main'
release:
types:
- published
jobs:
build_wheels:
name: Build wheels and src
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: "0"
- name: Install
run: python -m pip install build pytest --user
- name: Build wheels
run: python -m build --sdist --wheel
- name: Test wheel
run: python -m pytest
- name: upload wheel and src
uses: actions/upload-artifact@v3
with:
path: dist/
upload_pypi:
needs: [build_wheels]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: mint API token
id: mint
uses: tschm/[email protected]
- uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish package distribution to PYPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ steps.mint.outputs.api-token }}