Skip to content

Commit f4e257c

Browse files
authored
Fix broad build privileges @ GHA release workflow (#3281)
1 parent 77564a1 commit f4e257c

File tree

1 file changed

+26
-7
lines changed

1 file changed

+26
-7
lines changed

.github/workflows/release.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,12 @@ on:
33
push:
44
tags: ["*"]
55

6+
env:
7+
dists-artifact-name: python-package-distributions
8+
69
jobs:
7-
release:
10+
build:
811
runs-on: ubuntu-latest
9-
environment:
10-
name: release
11-
url: https://pypi.org/p/tox
12-
permissions:
13-
id-token: write
1412
steps:
1513
- name: Setup python to build package
1614
uses: actions/setup-python@v5
@@ -22,6 +20,27 @@ jobs:
2220
with:
2321
fetch-depth: 0
2422
- name: Build package
25-
run: pyproject-build -s -w . -o dist
23+
run: pyproject-build
24+
- name: Store the distribution packages
25+
uses: actions/upload-artifact@v4
26+
with:
27+
name: ${{ env.dists-artifact-name }}
28+
path: dist/*
29+
30+
release:
31+
needs:
32+
- build
33+
runs-on: ubuntu-latest
34+
environment:
35+
name: release
36+
url: https://pypi.org/project/tox/${{ github.ref_name }}
37+
permissions:
38+
id-token: write
39+
steps:
40+
- name: Download all the dists
41+
uses: actions/download-artifact@v4
42+
with:
43+
name: ${{ env.dists-artifact-name }}
44+
path: dist/
2645
- name: Publish to PyPI
2746
uses: pypa/[email protected]

0 commit comments

Comments
 (0)