From a86f25b2304daee74024c991ca2326ac2bf3d9b7 Mon Sep 17 00:00:00 2001 From: Pelagic Date: Mon, 13 May 2024 13:38:19 +0300 Subject: [PATCH] Added a publish action. --- .gitea/workflows/publish.yaml | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .gitea/workflows/publish.yaml diff --git a/.gitea/workflows/publish.yaml b/.gitea/workflows/publish.yaml new file mode 100644 index 0000000..1c1fbd5 --- /dev/null +++ b/.gitea/workflows/publish.yaml @@ -0,0 +1,38 @@ +name: StarFields Django Rest Framework Generics + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Python + # This is the version of the action for setting up Python, not the Python version. + uses: actions/setup-python@v5 + with: + # Semantic version range syntax or exact version of a Python version + python-version: '3.12' + # Optional - x64 or x86 architecture, defaults to x64 + architecture: 'x64' + + - name: Display Python version + run: python -c "import sys; print(sys.version)" + + # TODO testing + # check https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#packaging-workflow-data-as-artifacts + + - name: Build package + run: python -m build + + - name: Publish package to Gitea PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + packages-dir: dist/ + user: ${{ secrets.GITEA_PYPI_USERNAME }} + password: ${{ secrets.GITEA_PYPI_PASSWORD }} + repository-url: https://git.vickys-corner.xyz/api/packages/StarFields/pypi