Skip to content

Commit

Permalink
PyPI publication from github
Browse files Browse the repository at this point in the history
  • Loading branch information
stub42 committed Jan 29, 2024
1 parent ee2e37b commit 7be5ebf
Showing 1 changed file with 59 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -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/



0 comments on commit 7be5ebf

Please sign in to comment.