From 7be5ebf082f409024fe7c1ea600f0f38b43d72ed Mon Sep 17 00:00:00 2001 From: Stuart Bishop Date: Mon, 29 Jan 2024 13:57:06 +1100 Subject: [PATCH] PyPI publication from github --- .github/workflows/publish.yml | 59 +++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..8af43a3 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,59 @@ +name: Publish +on: [push, workflow_dispatch] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip wheel flake8 + - name: Build + run: | + make build + - name: Unit Tests + run: | + cd build/dist/pytz/tests + python test_lazy.py -vv + python test_tzinfo.py -vv + - name: Documentation Tests + run: | + cd build/dist/pytz/tests + python test_docs.py -vv + - name: zdump Tests + run: | + python gen_tests.py + python test_zdump.py -vv + - name: Build distribution + run: | + make clean dist + - uses: actions/upload-artifact@v3 + with: + path: ./build/tarballs + + pypi-publish: + needs: ['build'] + environment: 'publish' + + name: upload release to PyPI + runs-on: ubuntu-latest + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v3 + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + packages_dir: artifact/ + + +