From 529f9d22cab14419e2d7c6d58ffdefa8349cb37a Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 5 Dec 2024 13:54:41 -0500 Subject: [PATCH] Add gitea workflow to run offline tests and publish package --- .gitea/workflows/test-and-publish.yml | 39 +++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .gitea/workflows/test-and-publish.yml diff --git a/.gitea/workflows/test-and-publish.yml b/.gitea/workflows/test-and-publish.yml new file mode 100644 index 0000000..879ebf8 --- /dev/null +++ b/.gitea/workflows/test-and-publish.yml @@ -0,0 +1,39 @@ +name: Run Unit Tests +on: + push: + release: + +jobs: + # test-package: + # strategy: + # matrix: + # python-version: + # - "3.11" + # - "3.12" + # - "3.13" + # runs-on: ubuntu-latest + # container: ghcr.io/astral-sh/uv:0.5-python${{ matrix.python-version }}-alpine + # steps: + # - uses: taiki-e/checkout-action@v1 + # - name: Install the project + # run: uv sync --all-extras --dev + # - name: Run tests + # run: uv run pytest + + publish: + if: startsWith(github.ref, 'refs/tags/v') + # needs: test-package + runs-on: ubuntu-latest + container: + image: ghcr.io/astral-sh/uv:0.5-python3.13-alpine + network: host + steps: + - uses: taiki-e/checkout-action@v1 + - name: Build package + run: uv build + - name: Publish to Gitea + run: uv publish + env: + UV_PUBLISH_URL: "${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/pypi" + UV_PUBLISH_USERNAME: "${{ secrets.PACKAGE_REPO_USERNAME }}" + UV_PUBLISH_PASSWORD: "${{ secrets.PACKAGE_REPO_PASSWORD }}"