[CI] prevent pypi upload on pre-releases (#520)

* prevent pypi upload on pre-releases

* only on release
This commit is contained in:
callebtc
2024-04-19 12:28:48 +02:00
committed by GitHub
parent 72ad903200
commit 7c8e93ff3a
2 changed files with 4 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ name: Docker Build
on: on:
release: release:
types: [published] types: [released]
jobs: jobs:
build-and-push: build-and-push:
@@ -42,7 +42,7 @@ jobs:
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . 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 }} tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:${{ steps.get_tag.outputs.tag }}
platforms: linux/amd64,linux/arm64 platforms: linux/amd64,linux/arm64
cache-from: type=local,src=/tmp/.buildx-cache cache-from: type=local,src=/tmp/.buildx-cache

View File

@@ -3,7 +3,7 @@ name: Pip package
on: on:
push: push:
release: release:
types: [published] types: [released]
jobs: jobs:
build-and-push: build-and-push:
@@ -30,6 +30,6 @@ jobs:
pip install --upgrade dist/*.whl pip install --upgrade dist/*.whl
- name: Upload to PyPI on release - name: Upload to PyPI on release
if: github.event_name == 'release' if: github.event_name == 'release' && github.event.action == 'released'
run: | run: |
poetry publish -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} poetry publish -u __token__ -p ${{ secrets.PYPI_API_TOKEN }}