CrossDown/.gitea/workflows/pypi.yaml

45 lines
1.1 KiB
YAML
Raw Normal View History

2024-11-01 19:18:29 +08:00
on:
push:
branches:
- main
jobs:
build-push:
2024-11-01 19:24:47 +08:00
runs-on: ubuntu-latest
2024-11-01 19:18:29 +08:00
steps:
- name: Checkout code
2024-11-01 19:24:47 +08:00
uses: actions/checkout@v3
2024-11-01 19:18:29 +08:00
- name: Set up Python 3.11
2024-11-01 19:24:47 +08:00
uses: actions/setup-python@v3
2024-11-01 19:18:29 +08:00
with:
python-version: '3.11'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
- name: Build the package
run: |
python3.11 setup.py sdist bdist_wheel
- name: Upload artifacts
2024-11-01 19:24:47 +08:00
uses: actions/upload-artifact@v3
2024-11-01 19:18:29 +08:00
with:
name: python-dist
path: |
dist/*.tar.gz
dist/*.whl
- name: Set up twine
run: pip install twine
- name: Publish to PyPI
env:
TWINE_USERNAME: '__token__'
TWINE_PASSWORD: 'pypi-AgEIcHlwaS5vcmcCJDYxNjk2MzExLTg2NjMtNDUwNi1hMTQ0LTM2NDkxY2U1NjExYwACKlszLCIwNmJkMmFkZS1hYjkxLTQ0MWMtOWM1ZC02MmE0OTc3NTc5Y2EiXQAABiD_N8XZktPwthdp9dRpkpm7dIEh3eVbSr-X6H_OS8OzDw'
run: |
twine upload dist/*