Skip to content

Commit

Permalink
[force-pypi-upload]
Browse files Browse the repository at this point in the history
- allow for a keyword to force pypi upload
  • Loading branch information
gmaze committed Nov 22, 2023
1 parent bc6d4b4 commit 364ce5c
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions .github/workflows/pypi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:


jobs:

build-artifacts:
runs-on: ubuntu-latest
if: github.repository == 'euroargodev/VirtualFleet'
Expand Down Expand Up @@ -47,8 +48,24 @@ jobs:
name: releases
path: dist

detect-force-upload:
name: detect force upload
runs-on: ubuntu-latest
if: |
github.repository == 'euroargodev/VirtualFleet' && github.event_name == 'push'
outputs:
upload: ${{ steps.detect-force-upload.outputs.trigger-found }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- uses: xarray-contrib/ci-trigger@v1.2
id: detect-upload
with:
keyword: "[force-pypi-upload]"

test-built-dist:
needs: build-artifacts
needs: build-artifacts, detect-ci-skip
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v3
Expand All @@ -73,7 +90,7 @@ jobs:
python -m pip install dist/VirtualFleet*.whl
- name: Publish package to TestPyPI
if: github.event_name == 'push'
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
uses: pypa/gh-action-pypi-publish@v1.5.0
with:
user: __token__
Expand All @@ -84,8 +101,8 @@ jobs:
skip_existing: true

upload-to-pypi:
needs: test-built-dist
if: github.event_name == 'push'
needs: test-built-dist, detect-ci-skip
if: github.event_name == 'release' || needs.detect-force-upload.outputs.upload == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
Expand Down

0 comments on commit 364ce5c

Please sign in to comment.