Skip to content

Commit ea52a08

Browse files
vepadulanodpiparo
authored andcommitted
[build] Add workflow steps for PyPI publishing
(cherry picked from commit c719f23)
1 parent 6ef3379 commit ea52a08

1 file changed

Lines changed: 27 additions & 4 deletions

File tree

.github/workflows/python_wheel_build.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ name: 'ROOT Python wheels'
33
on:
44
workflow_dispatch:
55
inputs:
6-
branch:
7-
description: 'The branch for which the Python wheel has to be generated'
6+
ref:
7+
description: 'The git ref to build the wheel from (branch, tag, or commit SHA).'
88
type: string
99
required: true
10-
default: "master"
10+
default: ''
1111
schedule:
1212
- cron: '01 1 * * *'
1313
pull_request:
@@ -32,6 +32,8 @@ jobs:
3232
name: ${{ matrix.target }}
3333
steps:
3434
- uses: actions/checkout@v6
35+
with:
36+
ref: ${{ github.event.inputs.ref }}
3537
- uses: ./.github/workflows/cibuildwheel-impl
3638
with:
3739
build-tag: ${{ matrix.target }}
@@ -46,7 +48,8 @@ jobs:
4648
name: test-wheel-cp${{ matrix.python-version }}
4749
steps:
4850
- uses: actions/checkout@v6
49-
51+
with:
52+
ref: ${{ github.event.inputs.ref }}
5053
- name: Download produced wheels
5154
uses: actions/download-artifact@v4
5255
with:
@@ -121,3 +124,23 @@ jobs:
121124
kinit -p ${{ secrets.KRB5USER }}@${{ secrets.KRB5REALM }} -kt ${KT_FILE_NAME}
122125
echo +++ Running the copy
123126
xrdcp --parallel ${NFILES} -rf wheelhouse/* ${EOS_ENDPOINT}/${EOS_PATH}/
127+
128+
publish-to-pypi:
129+
if: github.event_name == 'workflow_dispatch'
130+
needs: build-wheels
131+
runs-on: ubuntu-latest
132+
name: >-
133+
Publish Python distribution to PyPI
134+
environment:
135+
name: pypi
136+
url: https://pypi.org/p/root
137+
permissions:
138+
id-token: write
139+
steps:
140+
- name: Download produced wheels
141+
uses: actions/download-artifact@v4
142+
with:
143+
merge-multiple: true
144+
path: dist/
145+
- name: Publish distribution to PyPI
146+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)