diff --git a/.github/workflows/build-distributions.yml b/.github/workflows/build-distributions.yml index f62c7f63f..2e18c8c74 100644 --- a/.github/workflows/build-distributions.yml +++ b/.github/workflows/build-distributions.yml @@ -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 @@ -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 }} @@ -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/* diff --git a/.github/workflows/build-hatch.yml b/.github/workflows/build-hatch.yml index bf36f3898..26d35f6c0 100644 --- a/.github/workflows/build-hatch.yml +++ b/.github/workflows/build-hatch.yml @@ -519,6 +519,8 @@ jobs: - name: Push Python artifacts to PyPI uses: pypa/gh-action-pypi-publish@v1.8.14 + with: + skip-existing: true distributions-release: name: Build release distributions @@ -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 @@ -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/*