Skip to content

Commit 186c36d

Browse files
committed
CI: Add build/publish jobs
1 parent e11a778 commit 186c36d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

.github/workflows/unittests.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ defaults:
2424
shell: bash -el {0}
2525

2626
jobs:
27+
build-package:
28+
name: Build & inspect package
29+
runs-on: ubuntu-latest
30+
permissions:
31+
attestations: write
32+
id-token: write
33+
34+
steps:
35+
- uses: actions/checkout@v4
36+
with:
37+
fetch-depth: 0
38+
- uses: hynek/build-and-inspect-python-package@v2
39+
2740
test:
2841
if: "!contains(github.event.head_commit.message, '[skip ci]' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'nipreps/sdcflows'))"
2942
runs-on: ubuntu-latest
@@ -199,3 +212,23 @@ jobs:
199212
file: cov.xml
200213
token: ${{ secrets.CODECOV_TOKEN }}
201214
if: ${{ always() }}
215+
216+
publish:
217+
name: Publish released package to pypi.org
218+
environment: release-pypi
219+
if: github.event.action == 'published'
220+
runs-on: ubuntu-latest
221+
needs: [build-package, test]
222+
permissions:
223+
attestations: write
224+
id-token: write
225+
226+
steps:
227+
- name: Download packages built by build-and-inspect-python-package
228+
uses: actions/download-artifact@v4
229+
with:
230+
name: Packages
231+
path: dist
232+
233+
- name: Upload package to PyPI
234+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)