-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (31 loc) · 1.06 KB
/
github-publish-actions.yaml
File metadata and controls
38 lines (31 loc) · 1.06 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
name: Publish to PyPI
on:
push:
# This example triggers on any branch named "release"
branches:
- release
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # Required for OIDC authentication
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: true # This ensures that all submodules are also checked out
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10' # Adjust your Python version as needed
- name: Upgrade pip and install build tools
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Publish package to PyPI via OIDC
uses: pypa/gh-action-pypi-publish@v1.5.0
# Do not specify the `pypi-token` input so that the action uses OIDC authentication.
# If you need to debug, you can set a token via secrets, but for OIDC leave it out.