-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (35 loc) · 1.04 KB
/
publish.yml
File metadata and controls
43 lines (35 loc) · 1.04 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
# Publish to PyPI using trusted publishing (OIDC).
#
# Setup steps for PyPI trusted publishing:
# 1. Go to https://pypi.org/manage/account/publishing/
# 2. Add a new pending publisher:
# - PyPI project name: cloudlayerio
# - Owner: cloudlayerio
# - Repository: cloudlayerio-python
# - Workflow name: publish.yml
# - Environment name: pypi
# 3. Create the "pypi" environment in GitHub repo settings:
# - Settings > Environments > New environment > "pypi"
# - Add protection rule: require reviewers (optional)
name: Publish to PyPI
on:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install build tools
run: pip install build
- name: Build package
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1