Skip to content

Commit e565670

Browse files
committed
Add release to pypi
1 parent d87f460 commit e565670

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

.github/workflows/python-app.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,24 @@ jobs:
124124
- name: Build the distribution
125125
run: |
126126
python -m build
127+
128+
- name: Upload to PyPI
129+
run: |
130+
twine upload dist/* --verbose
131+
env:
132+
TWINE_USERNAME: __token__
133+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
134+
135+
- name: Verify PyPI installation
136+
run: |
137+
# Create a temporary environment to test installation
138+
python -m venv prod_test_env
139+
source prod_test_env/bin/activate
140+
# Get the package name from the built distribution
141+
PACKAGE_NAME=$(ls dist/*.tar.gz | head -n 1 | sed 's/dist\///' | sed 's/-[0-9].*$//')
142+
# Wait for PyPI to index the package
143+
sleep 60
144+
# Install from PyPI
145+
pip install $PACKAGE_NAME
146+
# Basic import test
147+
python -c "import flixOpt; print('PyPI installation successful!')"

0 commit comments

Comments
 (0)