Skip to content

Commit

Permalink
Fix broad build privileges @ GHA release workflow (#3281)
Browse files Browse the repository at this point in the history
  • Loading branch information
webknjaz authored May 15, 2024
1 parent 77564a1 commit f4e257c
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]

0 comments on commit f4e257c

Please sign in to comment.