Skip to content

Commit 3150bdf

Browse files
authored
Merge pull request #1110 from bids-standard/test-pypi-uploads
chore(ci): Upload attested package to (test) PyPI
2 parents 36468b3 + d06176a commit 3150bdf

File tree

2 files changed

+44
-52
lines changed

2 files changed

+44
-52
lines changed

.github/workflows/test.yml renamed to .github/workflows/build-test-deploy.yml

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
name: Python tests
2-
31
# This file tests the claimed support range of PyBIDS including
42
#
53
# * Operating systems: Linux, OSX
@@ -9,6 +7,9 @@ on:
97
branches:
108
- master
119
- maint/*
10+
- test-pypi-uploads
11+
tags:
12+
- '*'
1213
pull_request: {}
1314
schedule:
1415
# 8am EST / 9am EDT Mondays
@@ -112,3 +113,44 @@ jobs:
112113
with:
113114
files: cov.xml
114115
token: ${{ secrets.CODECOV_TOKEN }}
116+
117+
test-publish:
118+
name: Push package to test.pypi.org
119+
if: github.event_name == 'push'
120+
runs-on: ubuntu-latest
121+
needs: [build]
122+
permissions:
123+
attestations: write
124+
id-token: write
125+
126+
steps:
127+
- name: Download packages built by build-and-inspect-python-package
128+
uses: actions/download-artifact@v4
129+
with:
130+
name: Packages
131+
path: dist
132+
133+
- name: Upload package to PyPI
134+
uses: pypa/gh-action-pypi-publish@release/v1
135+
with:
136+
repository-url: https://test.pypi.org/legacy/
137+
skip-existing: true
138+
139+
publish:
140+
name: Publish released package to pypi.org
141+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
142+
runs-on: ubuntu-latest
143+
needs: [test, test-publish]
144+
permissions:
145+
attestations: write
146+
id-token: write
147+
148+
steps:
149+
- name: Download packages built by build-and-inspect-python-package
150+
uses: actions/download-artifact@v4
151+
with:
152+
name: Packages
153+
path: dist
154+
155+
- name: Upload package to PyPI
156+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/package.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)