mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-23 11:44:19 +01:00
[CI] prevent pypi upload on pre-releases (#520)
* prevent pypi upload on pre-releases * only on release
This commit is contained in:
4
.github/workflows/docker.yaml
vendored
4
.github/workflows/docker.yaml
vendored
@@ -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
|
||||||
|
|||||||
4
.github/workflows/pypi.yaml
vendored
4
.github/workflows/pypi.yaml
vendored
@@ -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 }}
|
||||||
|
|||||||
Reference in New Issue
Block a user