-
-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix broad build privileges @ GHA release workflow (#3281)
- Loading branch information
Showing
1 changed file
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,12 @@ on: | |
push: | ||
tags: ["*"] | ||
|
||
env: | ||
dists-artifact-name: python-package-distributions | ||
|
||
jobs: | ||
release: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: release | ||
url: https://pypi.org/p/tox | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Setup python to build package | ||
uses: actions/setup-python@v5 | ||
|
@@ -22,6 +20,27 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
- name: Build package | ||
run: pyproject-build -s -w . -o dist | ||
run: pyproject-build | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.dists-artifact-name }} | ||
path: dist/* | ||
|
||
release: | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: release | ||
url: https://pypi.org/project/tox/${{ github.ref_name }} | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ env.dists-artifact-name }} | ||
path: dist/ | ||
- name: Publish to PyPI | ||
uses: pypa/[email protected] |