From 61809cf36f65d1d94ed994b1b6751ff60de1513e Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 27 Nov 2023 20:49:43 -0500 Subject: [PATCH] Add gitea workflow to test and upload package --- .gitea/workflows/upload-package.yaml | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .gitea/workflows/upload-package.yaml diff --git a/.gitea/workflows/upload-package.yaml b/.gitea/workflows/upload-package.yaml new file mode 100644 index 0000000..38b5eb7 --- /dev/null +++ b/.gitea/workflows/upload-package.yaml @@ -0,0 +1,29 @@ +name: Upload Package +on: + push: + branches: + - main + +jobs: + test and upload package: + runs-on: ubuntu-latest + container: catthehacker/ubuntu:act-latest + env: + # workaround for container tool cache path, see https://gitea.com/gitea/act_runner/issues/70 + RUNNER_TOOL_CACHE: /toolcache + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 + with: + python-version: 3.11 + cache: pip + - run: pip install -r requirements.txt -r test-requirements.txt build twine + # TODO: tests are currently broken + # - run: pytest --cov=openapi_client_udm + + - run: python3 -m build + - run: python3 -m twine upload dist/* + env: + TWINE_REPOSITORY_URL: "${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/pypi" + TWINE_USERNAME: "${{ secrets.PACKAGE_REPO_USERNAME }}" + TWINE_PASSWORD: "${{ secrets.PACKAGE_REPO_PASSWORD }}"