-
-
Notifications
You must be signed in to change notification settings - Fork 71
44 lines (41 loc) · 1.18 KB
/
publish-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
#
# Copyright (c) 2020-2024 Siddharth Chandrasekaran <[email protected]>
#
# SPDX-License-Identifier: Apache-2.0
#
name: Publish PyPI
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching Python-v*, i.e. v2.4.0
jobs:
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/<your-pypi-project-name>
permissions:
id-token: write # Trusted Publishing is setup for this workflow file
steps:
- name: Checkout sources
uses: actions/checkout@v2
with:
submodules: recursive
- name: Install pypa/build
run: |
python3 -m pip install build --user
- name: Build a binary wheel and a source tarball
run: |
pushd python
python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: python/dist/
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: python/dist/