Skip to content

Commit 148f66d

Browse files
google-labs-jules[bot]danielckvCopilotCopilot
authored
Add PyPI publishing workflow (#5)
* Add PyPI publishing workflow * Update .github/workflows/publish.yml Co-authored-by: Copilot <[email protected]> * Update .github/workflows/publish.yml Co-authored-by: Copilot <[email protected]> * Update .github/workflows/publish.yml Co-authored-by: Copilot <[email protected]> * Add test validation before PyPI publishing (#7) * Initial plan * Add test step before publishing to PyPI Co-authored-by: danielckv <[email protected]> * Improve test step with better flags and explicit dev dependencies Co-authored-by: danielckv <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: danielckv <[email protected]> * Add test step to PyPI publishing workflow (#6) * Initial plan * Add test step before publishing to PyPI Co-authored-by: danielckv <[email protected]> * Install package with dependencies for proper testing Co-authored-by: danielckv <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: danielckv <[email protected]> Co-authored-by: Daniel Chernenkov <[email protected]> * Add test step to PyPI publishing workflow (#8) * Initial plan * Add test step before PyPI publishing Co-authored-by: danielckv <[email protected]> * Improve test step with explicit dev dependencies and verbose output Co-authored-by: danielckv <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: danielckv <[email protected]> Co-authored-by: Daniel Chernenkov <[email protected]> * Add test execution to PyPI publish workflow (#9) * Initial plan * Add test step to publish workflow before building and publishing Co-authored-by: danielckv <[email protected]> * Improve test step with explicit dev dependencies and verbose output Co-authored-by: danielckv <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: danielckv <[email protected]> Co-authored-by: Daniel Chernenkov <[email protected]> --------- Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com> Co-authored-by: Daniel Chernenkov <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: danielckv <[email protected]>
1 parent 1cdb876 commit 148f66d

File tree

2 files changed

+444
-0
lines changed

2 files changed

+444
-0
lines changed

.github/workflows/publish.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
publish:
11+
name: Build and Publish
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
id-token: write
16+
steps:
17+
- name: Check out the repository
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.11'
24+
25+
- name: Install Poetry
26+
uses: snok/install-poetry@v1
27+
with:
28+
virtualenvs-create: true
29+
virtualenvs-in-project: true
30+
installer-parallel: true
31+
32+
- name: Install dependencies
33+
run: poetry install --no-interaction --with dev
34+
35+
- name: Run tests
36+
run: poetry run pytest --verbose
37+
38+
- name: Build and publish
39+
env:
40+
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
41+
run: |
42+
if [ -z "$PYPI_TOKEN" ]; then
43+
echo "Error: PYPI_API_TOKEN secret is not set"
44+
exit 1
45+
fi
46+
poetry config pypi-token.pypi $PYPI_TOKEN
47+
poetry publish --build

0 commit comments

Comments
 (0)