1+ # Main CI Workflow
12name : CI
23
34on :
@@ -21,7 +22,7 @@ concurrency:
2122
2223jobs :
2324 core :
24- uses : OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
25+ uses : OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
2526 with :
2627 submodules : false
2728 coverage : codecov
@@ -37,15 +38,15 @@ jobs:
3738 - uses : actions/checkout@v4
3839 - uses : actions/setup-python@v5
3940 with :
40- python-version : ' 3.10 '
41+ python-version : ' 3.12 '
4142 - run : python -m pip install -U --user build
4243 - run : python -m build . --sdist
4344 - run : python -m pip install -U --user twine
4445 - run : python -m twine check dist/*
4546
4647 test :
4748 needs : [core, sdist_verify]
48- uses : OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
49+ uses : OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
4950 with :
5051 submodules : false
5152 coverage : codecov
6061
6162 docs :
6263 needs : [core]
63- uses : OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
64+ uses : OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
6465 with :
65- default_python : ' 3.10 '
66+ default_python : ' 3.12 '
6667 submodules : false
6768 pytest : false
6869 toxdeps : tox-pypi-filter
8485 github.event_name == 'pull_request' &&
8586 contains(github.event.pull_request.labels.*.name, 'Run cron CI')
8687 )
87- uses : OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@main
88+ uses : OpenAstronomy/github-actions-workflows/.github/workflows/tox.yml@v1
8889 with :
89- default_python : ' 3.10 '
90+ default_python : ' 3.12 '
9091 submodules : false
9192 coverage : codecov
9293 toxdeps : tox-pypi-filter
@@ -95,23 +96,28 @@ jobs:
9596 secrets :
9697 CODECOV_TOKEN : ${{ secrets.CODECOV_TOKEN }}
9798
98- publish_pure :
99- if : |
100- github.event_name != 'pull_request' && (
101- github.ref_name != 'main' ||
102- github.event_name == 'workflow_dispatch' )
103- needs : [test, docs]
104- uses : OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
105- with :
106- python-version : ' 3.10'
107- test_extras : ' tests'
108- test_command : ' pytest -p no:warnings --doctest-rst --pyargs ndcube'
109- submodules : false
110- secrets :
111- pypi_token : ${{ secrets.pypi_token }}
99+ publish :
100+ # Build wheels on PRs only when labelled. Releases will only be published if tagged ^v.*
101+ # see https://github-actions-workflows.openastronomy.org/en/latest/publish.html#upload-to-pypi
102+ if : |
103+ github.event_name != 'pull_request' ||
104+ (
105+ github.event_name == 'pull_request' &&
106+ contains(github.event.pull_request.labels.*.name, 'Run publish')
107+ )
108+ needs : [test, docs]
109+ uses : OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
110+ with :
111+ python-version : ' 3.12'
112+ test_extras : ' all,tests'
113+ test_command : ' pytest -p no:warnings --doctest-rst --pyargs ndcube'
114+ submodules : false
115+ secrets :
116+ pypi_token : ${{ secrets.pypi_token }}
117+
112118 notify :
113119 if : always() && github.event_name == 'workflow_dispatch'
114- needs : [publish_pure , cron]
120+ needs : [publish , cron]
115121 runs-on : ubuntu-latest
116122 steps :
117123 - uses : Cadair/matrix-notify-action@main
0 commit comments