Skip to content

Commit 98aa8e1

Browse files
committed
build: use root permissions to install systemwide python package
Signed-off-by: Daniel Wagner <[email protected]>
1 parent 05a804d commit 98aa8e1

1 file changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/release-python.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ on:
1111

1212
workflow_dispatch:
1313

14-
permissions:
15-
contents: read
16-
id-token: write
17-
1814
jobs:
1915
build_sdist:
2016
name: Build source distribution
@@ -38,12 +34,20 @@ jobs:
3834
upload_test_pypi:
3935
needs: [build_sdist]
4036
runs-on: ubuntu-latest
37+
environment:
38+
name: testpypi
39+
url: https://test.pypi.org/p/libnvme-test
40+
permissions:
41+
id-token: write # IMPORTANT: mandatory for trusted publishing
4142
steps:
4243
- name: Install Python (if missing)
43-
run: apt-get update && apt-get install -y python3 python3-pip
44+
run: |
45+
sudo apt-get update
46+
sudo apt-get install -y python3 python3-pip
4447
4548
- name: Update python dependencies
46-
run: python3 -m pip install -U packaging --break-system-packages
49+
run: |
50+
sudo python3 -m pip install packaging --break-system-packages
4751
4852
- uses: actions/download-artifact@v4
4953
with:
@@ -58,6 +62,11 @@ jobs:
5862
upload_pypi:
5963
needs: [build_sdist]
6064
runs-on: ubuntu-latest
65+
permissions:
66+
id-token: write # IMPORTANT: mandatory for trusted publishing
67+
environment:
68+
name: pypi
69+
url: https://pypi.org/p/libvnme-release # Replace <package-name> with your PyPI project name
6170
if: startsWith(github.ref, 'refs/tags/v') && github.repository == 'linux-nvme/libnvme'
6271
steps:
6372
- name: Install Python (if missing)

0 commit comments

Comments
 (0)