Skip to content

Commit

Permalink
Fix distribution releases
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek committed May 14, 2024
1 parent e3b0856 commit 05cc303
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 27 deletions.
30 changes: 28 additions & 2 deletions .github/workflows/build-distributions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
pip install hatch==${{ inputs.version }} && break || sleep 5
done
distributions-linux:
linux:
name: Distribution ${{ matrix.job.target }}
needs: ensure-installable
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:
name: distribution-${{ matrix.job.target }}
path: hatch-dist-${{ matrix.job.target }}.tar.gz

distributions-windows-macos:
windows-macos:
name: Distribution ${{ matrix.job.target }}
needs: ensure-installable
runs-on: ${{ matrix.job.os }}
Expand Down Expand Up @@ -168,3 +168,29 @@ jobs:
with:
name: distribution-${{ matrix.job.target }}
path: hatch-dist-${{ matrix.job.target }}.tar.gz

publish:
name: Publish distributions
if: inputs.version
needs:
- linux
- windows-macos
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write

steps:
- name: Download distributions
uses: actions/download-artifact@v4
with:
name: distribution-*
path: distributions
merge-multiple: true

- name: Add assets to current release
uses: softprops/action-gh-release@v2
with:
files: |-
distributions/*
28 changes: 3 additions & 25 deletions .github/workflows/build-hatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,8 @@ jobs:
- name: Push Python artifacts to PyPI
uses: pypa/[email protected]
with:
skip-existing: true

distributions-release:
name: Build release distributions
Expand All @@ -529,6 +531,7 @@ jobs:
uses: ./.github/workflows/build-distributions.yml
with:
version: ${{ needs.binaries.outputs.version }}
secrets: inherit

distributions-dev:
name: Build development distributions
Expand All @@ -537,28 +540,3 @@ jobs:
# This actually does not need the binary jobs but we want to prioritize
# resources for the test jobs therefore this forces these later on
needs: binaries

publish-distributions:
name: Publish distribution artifacts
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
needs:
- distributions-release
runs-on: ubuntu-latest

permissions:
contents: write
id-token: write

steps:
- name: Download distributions
uses: actions/download-artifact@v4
with:
name: distribution-*
path: distributions
merge-multiple: true

- name: Add assets to current release
uses: softprops/action-gh-release@v2
with:
files: |-
distributions/*

0 comments on commit 05cc303

Please sign in to comment.