11name : Test and deploy on tag
22
33on : push
4-
4+ permissions :
5+ contents : write
6+ id-token : write # IMPORTANT for OIDC
57jobs :
68 test :
7-
89 runs-on : ubuntu-latest
910 strategy :
1011 fail-fast : false
1112 matrix :
1213 python-version : ['3.9', '3.10', '3.11', '3.12', '3.13']
1314 steps :
14- - uses : actions/checkout@v4
15+ - name : Checkout code
16+ uses : actions/checkout@v5
17+ with :
18+ fetch-depth : 0 # Required for setuptools-scm
1519 - name : Set up Python ${{ matrix.python-version }}
16- uses : actions/setup-python@v5
20+ uses : actions/setup-python@v6
1721 with :
1822 python-version : ${{ matrix.python-version }}
1923 - name : Install dependencies
2327 - name : Run test
2428 run : tox -e py
2529 - name : Upload coverage to Codecov
26- if : matrix.python-version == 3.13
30+ if : matrix.python-version == ' 3.13'
2731 uses : codecov/codecov-action@v5
2832 with :
2933 token : ${{ secrets.CODECOV_TOKEN }}
@@ -32,28 +36,38 @@ jobs:
3236 flags : unittests
3337 verbose : true
3438 - name : Static checks
35- if : matrix.python-version == 3.13
39+ if : matrix.python-version == ' 3.13'
3640 run : tox -e check
3741
3842 deploy :
39-
4043 if : github.event_name == 'push' && contains(github.ref, 'refs/tags/')
4144 needs : test
4245 runs-on : ubuntu-latest
46+ environment :
47+ name : release
48+ url : https://pypi.org/p/mlx.jira_juggler
4349 steps :
44- - uses : actions/checkout@v4
50+ - name : Checkout code
51+ uses : actions/checkout@v5
52+ with :
53+ fetch-depth : 0 # Required for setuptools-scm
54+
4555 - name : Set up Python
46- uses : actions/setup-python@v5
56+ uses : actions/setup-python@v6
4757 with :
4858 python-version : ' 3.13'
59+
4960 - name : Install dependencies
5061 run : |
51- python -m pip install --upgrade pip
52- pip install setuptools wheel twine
53- - name : Build and publish
62+ python -m pip install --upgrade build twine wheel setuptools-scm
63+ - name : Build package
64+ run : python -m build --wheel
65+
66+ - name : Check package
67+ run : twine check dist/*
68+
69+ - name : Publish to PyPI
5470 env :
55- TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
56- TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
57- run : |
58- python -m build --wheel
59- twine upload dist/*
71+ TWINE_USERNAME : __token__
72+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
73+ run : twine upload dist/*
0 commit comments