From 0e6be21ddb771486d185846ae2f494529852da28 Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Thu, 31 Oct 2024 20:00:05 +0000 Subject: [PATCH] Add publish action --- .gitea/workflow/publish.yaml | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .gitea/workflow/publish.yaml diff --git a/.gitea/workflow/publish.yaml b/.gitea/workflow/publish.yaml new file mode 100644 index 0000000..979574d --- /dev/null +++ b/.gitea/workflow/publish.yaml @@ -0,0 +1,42 @@ +name: Publish to PyPI and Gitea Package Server + +on: + push: + tags: + - 'v*' + +jobs: + publish-and-sync: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - 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: + TWINE_USER: ${{ secrets.PYPI_USERNAME }} + TWINE_PASS: ${{ secrets.PYPI_PASSWORD }} + run: | + twine upload dist/* + + - name: Publish to Gitea + env: + TWINE_USER: ${{ secrets.GT_PKG_USER }} + TWINE_PASS: ${{ secrets.GT_PKG_KEY }} + run: | + twine upload --repository-url https://git.fjla.uk/api/packages/owlboard/pypi dist/* \ No newline at end of file