From 6ba53c9d7beac1a5522fec5b5711959faedbb4d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jose=CC=81=20Arturo=20Garci=CC=81a?= Date: Wed, 22 Jul 2026 19:15:36 -0400 Subject: [PATCH] Add Gitea package publishing workflow --- .gitea/workflows/publish.yml | 42 ++++++++++++++++++++++++++++++++++++ doc/publishing.rst | 25 +++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 .gitea/workflows/publish.yml create mode 100644 doc/publishing.rst diff --git a/.gitea/workflows/publish.yml b/.gitea/workflows/publish.yml new file mode 100644 index 0000000..40041bd --- /dev/null +++ b/.gitea/workflows/publish.yml @@ -0,0 +1,42 @@ +name: Publish Package + +on: + push: + tags: + - "v*" + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install build tools + run: | + python -m pip install --upgrade pip + python -m pip install build twine + + - name: Build package + run: | + python -m build + + - name: Check package + run: | + python -m twine check dist/* + + - name: Publish to Gitea PyPI registry + env: + TWINE_USERNAME: ${{ secrets.GITEA_PACKAGE_USER }} + TWINE_PASSWORD: ${{ secrets.GITEA_PACKAGE_TOKEN }} + run: | + python -m twine upload \ + --repository-url https://gitea.joseagrc.com/api/packages/tryton-do/pypi \ + dist/* diff --git a/doc/publishing.rst b/doc/publishing.rst new file mode 100644 index 0000000..8bd7470 --- /dev/null +++ b/doc/publishing.rst @@ -0,0 +1,25 @@ +Publishing +========== + +Packages are published to the Gitea PyPI-compatible package registry when a +version tag is pushed. + +Required repository secrets: + +* ``GITEA_PACKAGE_USER`` +* ``GITEA_PACKAGE_TOKEN`` + +Publish a release: + +.. code-block:: console + + git tag v8.0.0 + git push origin v8.0.0 + +Install from Gitea: + +.. code-block:: console + + pip install \ + --index-url https://gitea.joseagrc.com/api/packages/tryton-do/pypi/simple \ + trytond_account_do