-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (32 loc) · 1.03 KB
/
publish.yml
File metadata and controls
35 lines (32 loc) · 1.03 KB
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
name: Publish to PyPI
on:
release:
types: [published]
jobs:
test:
uses: sscovil/python-dev-cli/.github/workflows/test.yml@main
publish:
if: github.repository == 'sscovil/python-dev-cli'
needs: [test]
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/sscovil/python-dev-cli
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Build package
run: |
python -m pip install --upgrade pip
python -m pip install ".[publish]"
python -m build --sdist --wheel .
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true # Skip upload if package with same version already exists
verbose: true # Print a lot of debugging information, for troubleshooting