Skip to content

Commit

Permalink
Update pypi-release.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
gmaze committed Nov 22, 2023
1 parent 0f29c1f commit d943e42
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions .github/workflows/pypi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,24 +48,8 @@ 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/[email protected]
id: detect-upload
with:
keyword: "[force-pypi-upload]"

test-built-dist:
needs: [build-artifacts, detect-force-upload]
needs: build-artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v3
Expand All @@ -84,13 +68,13 @@ jobs:
ls -ltrh dist
- name: Verify the built dist/wheel is valid
if: github.event_name == 'push'
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
run: |
python -m pip install --upgrade pip
python -m pip install dist/VirtualFleet*.whl
- name: Publish package to TestPyPI
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
if: github.event_name == 'push'
uses: pypa/[email protected]
with:
user: __token__
Expand All @@ -101,8 +85,8 @@ jobs:
skip_existing: true

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

0 comments on commit d943e42

Please sign in to comment.