Skip to content

Commit 6bb4073

Browse files
committed
Publish package to PyPI
When a new tag is pushed.
1 parent 5be3cbe commit 6bb4073

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

.github/workflows/ci-build.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ on:
33
push:
44
branches:
55
- main
6+
tags:
7+
- 'v*'
68
pull_request:
79

10+
env:
11+
PYTHON_BUILD_VERSION: '3.14'
12+
813
jobs:
914
build:
1015
name: Build and Test
@@ -37,3 +42,35 @@ jobs:
3742

3843
- name: Build package
3944
run: uv build
45+
46+
- name: Upload artifacts
47+
if: matrix.python-version == env.PYTHON_BUILD_VERSION
48+
uses: actions/upload-artifact@v6
49+
with:
50+
name: python-package-distributions
51+
path: dist/
52+
53+
publish:
54+
name: Publish to PyPI
55+
needs: build
56+
runs-on: ubuntu-latest
57+
58+
if: startsWith(github.ref, 'refs/tags/')
59+
60+
permissions:
61+
id-token: write
62+
contents: read
63+
64+
environment:
65+
name: release
66+
url: https://pypi.org/p/python-pdftables-api
67+
68+
steps:
69+
- name: Download artifacts
70+
uses: actions/download-artifact@v7
71+
with:
72+
name: python-package-distributions
73+
path: dist/
74+
75+
- name: Publish distribution to PyPI
76+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0

0 commit comments

Comments
 (0)