2024-10-31 20:00:05 +00:00
|
|
|
name: Publish to PyPI and Gitea Package Server
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
publish-and-sync:
|
2024-10-31 20:46:14 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2024-10-31 21:01:11 +00:00
|
|
|
container:
|
|
|
|
image: ghcr.io/catthehacker/ubuntu:act-latest
|
2024-10-31 20:00:05 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout Code
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up Python
|
2024-10-31 20:16:31 +00:00
|
|
|
uses: actions/setup-python@v3
|
2024-10-31 20:00:05 +00:00
|
|
|
with:
|
2024-10-31 20:57:33 +00:00
|
|
|
python-version: '3.10.12'
|
2024-10-31 20:00:05 +00:00
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install setuptools wheel twine
|
|
|
|
|
|
|
|
- name: Build package
|
|
|
|
run: |
|
|
|
|
python setup.py sdist bdist_wheel
|
|
|
|
|
|
|
|
- name: Publish to PyPI
|
|
|
|
env:
|
2024-10-31 21:05:23 +00:00
|
|
|
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
|
|
|
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
2024-10-31 20:00:05 +00:00
|
|
|
run: |
|
|
|
|
twine upload dist/*
|
|
|
|
|
|
|
|
- name: Publish to Gitea
|
|
|
|
env:
|
2024-10-31 21:05:23 +00:00
|
|
|
TWINE_USERNAME: ${{ secrets.GT_PKG_USER }}
|
|
|
|
TWINE_PASSWORD: ${{ secrets.GT_PKG_KEY }}
|
2024-10-31 20:00:05 +00:00
|
|
|
run: |
|
|
|
|
twine upload --repository-url https://git.fjla.uk/api/packages/owlboard/pypi dist/*
|