-
Notifications
You must be signed in to change notification settings - Fork 1
40 lines (31 loc) · 1.07 KB
/
publish.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
name: Publish to PyPI
on:
release:
types:
- published
jobs:
pypi-publish:
name: Build with Hatch and upload to PyPI
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write # Required for OIDC authentication
contents: read # Required to access repository contents
steps:
- name: Check out the repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Hatch
run: pip install hatch
- name: Build package with Hatch
run: hatch build
#- name: Test package
# run: hatch run test
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# https://docs.pypi.org/trusted-publishers/adding-a-publisher/
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
# https://docs.github.com/en/actions/managing-workflow-runs-and-deployments/managing-deployments/managing-environments-for-deployment#creating-an-environment