-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (40 loc) · 1.12 KB
/
release-pypi.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
41
42
43
44
# Publishing derived from https://docs.pypi.org/trusted-publishers/
# Building derived from https://github.com/Farama-Foundation/Gymnasium/blob/main/.github/workflows/build-publish.yml
on:
release:
types:
- published
name: release
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: python -m pip install --upgrade pip setuptools build
- name: Build sdist and wheels
run: python -m build
- name: Store wheels
uses: actions/upload-artifact@v3
with:
path: dist
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs:
- build
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- name: Download dists
uses: actions/download-artifact@v3
with:
name: artifact
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1