1818 runs-on : ubuntu-latest
1919 strategy :
2020 matrix :
21- python-version : [3.8, 3. 9, "3.10", 3.11, 3.12]
21+ python-version : [3.9, "3.10", 3.11, 3.12, 3.13 ]
2222
2323 steps :
2424 - uses : actions/checkout@v4
3131 with :
3232 python-version : ${{ matrix.python-version }}
3333
34- - uses : actions/cache@v4
35- id : depcache
36- with :
37- path : deps
38- key : requirements-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
39-
40- - name : Download dependencies
41- if : steps.depcache.outputs.cache-hit != 'true'
42- run : |
43- pip download --dest=deps -r requirements.txt
44-
4534 - name : Install dependencies
4635 run : |
47- pip install -U --no-index --find-links=deps deps/*
36+ pip install -r requirements.txt
4837
4938 - name : Run tests
5039 run : |
@@ -74,19 +63,19 @@ jobs:
7463 bash <(curl -s https://codecov.io/bash)
7564
7665 - name : Install distribution dependencies
77- run : pip install --upgrade twine setuptools wheel
78- if : matrix.python-version == 3.10
66+ run : pip install build
67+ if : matrix.python-version == 3.12
7968
8069 - name : Create distribution package
81- run : python setup.py sdist bdist_wheel
82- if : matrix.python-version == 3.10
70+ run : python -m build
71+ if : matrix.python-version == 3.12
8372
8473 - name : Upload distribution package
8574 uses : actions/upload-artifact@master
8675 with :
87- name : dist-package-${{ matrix.python-version }}
76+ name : dist
8877 path : dist
89- if : matrix.python-version == 3.10
78+ if : matrix.python-version == 3.12
9079
9180 publish :
9281 runs-on : ubuntu-latest
@@ -96,17 +85,28 @@ jobs:
9685 - name : Download a distribution artifact
9786 uses : actions/download-artifact@v4
9887 with :
99- name : dist-package-3.10
88+ name : dist
10089 path : dist
101- - name : Publish distribution 📦 to Test PyPI
102- uses : pypa/gh-action-pypi-publish@master
90+
91+ - name : Use Python 3.12
92+ uses : actions/setup-python@v1
10393 with :
104- skip_existing : true
105- user : __token__
106- password : ${{ secrets.test_pypi_password }}
107- repository_url : https://test.pypi.org/legacy/
94+ python-version : ' 3.12'
95+
96+ - name : Install dependencies
97+ run : |
98+ pip install twine
99+
100+ - name : Publish distribution 📦 to Test PyPI
101+ run : |
102+ twine upload -r testpypi dist/*
103+ env :
104+ TWINE_USERNAME : __token__
105+ TWINE_PASSWORD : ${{ secrets.test_pypi_password }}
106+
108107 - name : Publish distribution 📦 to PyPI
109- uses : pypa/gh-action-pypi-publish@master
110- with :
111- user : __token__
112- password : ${{ secrets.pypi_password }}
108+ run : |
109+ twine upload -r pypi dist/*
110+ env :
111+ TWINE_USERNAME : __token__
112+ TWINE_PASSWORD : ${{ secrets.pypi_password }}
0 commit comments