From a5da2f775ea3d13daf2ee89d131641daa9670020 Mon Sep 17 00:00:00 2001 From: Geoffrey Gunter <12984092+gmgunter@users.noreply.github.com> Date: Mon, 16 Sep 2024 09:56:17 -0700 Subject: [PATCH] Upload CI artifacts on "push" triggers only (#85) Uploaded CI artifacts are currently used for publishing to PyPI (or TestPyPI). The `publish-to-pypi` and `publish-to-testpypi` jobs are only triggered by "push" events -- otherwise the uploaded CI artifacts go unused. In order to avoid wasting resources, let's upload CI artifacts only on "push" events. --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce4532b..daefd22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,7 +94,8 @@ jobs: - run: | pip install check-wheel-contents check-wheel-contents ./wheelhouse/*.whl - - uses: actions/upload-artifact@v4 + - if: github.event_name == 'push' + uses: actions/upload-artifact@v4 with: name: ${{ env.artifact_prefix }}-wheels-${{ matrix.runner }}-${{ matrix.arch }} path: ./wheelhouse/*.whl @@ -107,7 +108,8 @@ jobs: with: { fetch-depth: 0, submodules: true } - run: pipx run build --sdist - run: pipx run twine check --strict dist/* - - uses: actions/upload-artifact@v4 + - if: github.event_name == 'push' + uses: actions/upload-artifact@v4 with: name: ${{ env.artifact_prefix }}-sdist path: dist/*.tar.gz