-
Notifications
You must be signed in to change notification settings - Fork 4
45 lines (38 loc) · 1.16 KB
/
python-publish.yml
File metadata and controls
45 lines (38 loc) · 1.16 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
name: Publish Release
on:
release:
types: [published]
branches: [master]
workflow_dispatch:
jobs:
publish-py:
name: Upload release to PyPI
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/caterpillar-py
permissions:
id-token: write
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build Package
# This is a small hach since the 'caterpillar' project is already
# published on PyPi and we can't use that name.
run: |
python3 -m build pypi || true
sed -i 's/\.\.\/src/\.\/src/g' pypi/pyproject.toml
python3 -m build pypi
- name: Publish package to Prod PyPi
# if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags') && !github.event.release.prerelease
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: pypi/dist