From 738a359b9a4855764627d5338d90508e585acc19 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:25:32 +0200 Subject: [PATCH 1/2] prevent pypi upload on pre-releases --- .github/workflows/pypi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index 15b8c57c..f2726285 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -30,6 +30,6 @@ jobs: pip install --upgrade dist/*.whl - name: Upload to PyPI on release - if: github.event_name == 'release' + if: github.event_name == 'release' && github.event.action == 'released' run: | poetry publish -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} From 77fcf5f25edc668c8ce82e1e998a244d4a37d8f3 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:28:25 +0200 Subject: [PATCH 2/2] only on release --- .github/workflows/docker.yaml | 4 ++-- .github/workflows/pypi.yaml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 265ebba0..3869d657 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -2,7 +2,7 @@ name: Docker Build on: release: - types: [published] + types: [released] jobs: build-and-push: @@ -42,7 +42,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . - push: ${{ github.event_name == 'release' }} + push: ${{ github.event_name == 'release' && github.event.action == 'released' }} tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ steps.get_tag.outputs.tag }} platforms: linux/amd64,linux/arm64 cache-from: type=local,src=/tmp/.buildx-cache diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index f2726285..58775c3f 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -3,7 +3,7 @@ name: Pip package on: push: release: - types: [published] + types: [released] jobs: build-and-push: