From c076da9e8ca199826bb5a9ba42b21632ac617869 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= Date: Tue, 17 Sep 2024 11:58:36 -0700 Subject: [PATCH] Split build and publish for release (#306) --- .github/workflows/{check.yml => check.yaml} | 0 .../workflows/{release.yml => release.yaml} | 31 +++++++++++++++---- 2 files changed, 25 insertions(+), 6 deletions(-) rename .github/workflows/{check.yml => check.yaml} (100%) rename .github/workflows/{release.yml => release.yaml} (57%) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yaml similarity index 100% rename from .github/workflows/check.yml rename to .github/workflows/check.yaml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yaml similarity index 57% rename from .github/workflows/release.yml rename to .github/workflows/release.yaml index 298e189..c17788c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yaml @@ -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: @@ -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: