11name : Tests
22on :
33 push :
4- branches : [main]
4+ branches :
5+ - main
6+ tags :
7+ - " *"
58 pull_request :
6- branches : [main]
7- release :
8- types :
9- - published
9+ branches :
10+ - main
11+ workflow_dispatch :
12+ inputs :
13+ prerelease :
14+ description : " Run a pre-release, testing the build"
15+ required : false
16+ type : boolean
17+ default : false
18+
1019jobs :
1120 tests :
1221 name : " py${{ matrix.python-version }} / ${{ matrix.os }}"
1322 runs-on : ${{ matrix.os }}
1423 strategy :
1524 fail-fast : false
1625 matrix :
17- python-version : ["3.8", "3. 9", "3.10", "3.11"]
26+ python-version : ["3.9", "3.10", "3.11"]
1827 os : [ubuntu-latest]
1928 include :
2029 - python-version : " 3.10"
@@ -38,49 +47,27 @@ jobs:
3847 - name : Run tests
3948 run : python -m pytest -v tests
4049
41- coverage :
42- name : " Run tests with coverage"
43- runs-on : ubuntu-latest
44- steps :
45- - name : Clone the repo
46- uses : actions/checkout@v4
47- with :
48- fetch-depth : 0
49- submodules : recursive
50- - name : Set up Python
51- uses : actions/setup-python@v5
52- with :
53- python-version : 3.9
54- - name : Install dependencies
55- run : |
56- python -m pip install -U pip pytest-cov
57- python -m pip install -e .
58- - name : Run tests
59- run : python -m pytest --cov george -v tests
60- - name : Coveralls
61- uses : AndreMiras/coveralls-python-action@v20201129
62-
6350 build_wheels :
64- name : Build wheels on ${{ matrix.os }}
6551 runs-on : ${{ matrix.os }}
6652 strategy :
6753 matrix :
68- os : [ubuntu-latest, windows-latest, macos-latest]
54+ os :
55+ - " ubuntu-22.04"
56+ - " macos-12"
57+ - " macos-14"
58+ - " windows-latest"
6959 steps :
7060 - uses : actions/checkout@v4
7161 with :
7262 submodules : true
7363 fetch-depth : 0
7464 - uses : pypa/cibuildwheel@v2.19.1
75- env :
76- CIBW_SKIP : " *-win32 *_i686"
77- CIBW_MANYLINUX_X86_64_IMAGE : manylinux2014
7865 - uses : actions/upload-artifact@v4
7966 with :
67+ name : binary-${{ matrix.os }}
8068 path : ./wheelhouse/*.whl
8169
8270 build_sdist :
83- name : Build source distribution
8471 runs-on : ubuntu-latest
8572 steps :
8673 - uses : actions/checkout@v4
@@ -90,28 +77,32 @@ jobs:
9077 - uses : actions/setup-python@v5
9178 name : Install Python
9279 with :
93- python-version : " 3.9 "
94- - name : Build sdist
80+ python-version : " 3.10 "
81+ - name : Install dependencies
9582 run : |
9683 python -m pip install -U pip
97- python -m pip install -U build
98- python -m build --sdist .
84+ python -m pip install -U build twine
85+ - name : Build sdist
86+ run : python -m build --sdist .
87+ - name : Check the sdist
88+ run : python -m twine check dist/*.tar.gz
9989 - uses : actions/upload-artifact@v4
10090 with :
91+ name : sdist
10192 path : dist/*.tar.gz
10293
10394 upload_pypi :
104- needs : [tests, build_wheels, build_sdist]
95+ environment :
96+ name : pypi
97+ url : https://pypi.org/p/george
98+ permissions :
99+ id-token : write
100+ needs : [build_wheels, build_sdist]
105101 runs-on : ubuntu-latest
106- if : github.event_name == 'release ' && github.event.action == 'published'
102+ if : github.event_name == 'push ' && startsWith( github.ref, 'refs/tags/')
107103 steps :
108104 - uses : actions/download-artifact@v4
109105 with :
110- name : artifact
111106 path : dist
112-
107+ merge-multiple : true
113108 - uses : pypa/gh-action-pypi-publish@v1.9.0
114- with :
115- user : __token__
116- password : ${{ secrets.pypi_password }}
117- # To test: repository_url: https://test.pypi.org/legacy/
0 commit comments