Skip to content

Commit

Permalink
Split build and publish for release (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat committed Sep 17, 2024
1 parent 30199ec commit c076da9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
File renamed without changes.
31 changes: 25 additions & 6 deletions .github/workflows/release.yml → .github/workflows/release.yaml
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/platformdirs
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -23,6 +21,27 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build package
run: uv build --python 3.13 --python-preference only-managed --sdist --wheel . --out-dir dist
- 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/platformdirs/${{ 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/gh-action-pypi-publish@v1.10.1
with:
Expand Down

0 comments on commit c076da9

Please sign in to comment.