-
Notifications
You must be signed in to change notification settings - Fork 9
48 lines (43 loc) · 1.14 KB
/
Copy pathpublish.yml
File metadata and controls
48 lines (43 loc) · 1.14 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
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Publish to PyPI
# Builds the package and publishes it to PyPI when a GitHub Release is published.
# Uses PyPI Trusted Publishing (OIDC), so no API token or secret is needed once
# the trusted publisher is configured on PyPI. See RELEASING.md.
on:
release:
types: [published]
permissions:
contents: read
jobs:
build:
name: Build distributions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Build and check
run: |
python -m pip install --upgrade build twine
python -m build
twine check dist/*
- uses: actions/upload-artifact@v7
with:
name: dist
path: dist/
publish:
name: Publish to PyPI
needs: build
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/sentineldeck/
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v8
with:
name: dist
path: dist/
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1