diff --git a/.github/workflows/cd-pypi.yml b/.github/workflows/cd-pypi.yml index 6104026f..9bb0073c 100644 --- a/.github/workflows/cd-pypi.yml +++ b/.github/workflows/cd-pypi.yml @@ -1,11 +1,43 @@ name: cd +# on: +# push: +# tags: +# - '**' + +# jobs: +# pypi: +# uses: ecmwf-actions/reusable-workflows/.github/workflows/cd-pypi.yml@v2 +# secrets: inherit + + on: - push: - tags: - - '**' + push: {} + + release: + types: [created] jobs: - pypi: - uses: ecmwf-actions/reusable-workflows/.github/workflows/cd-pypi.yml@v2 - secrets: inherit + deploy: + if: ${{ github.event_name == 'release' }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: 3.x + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install build wheel twine + + - name: Build and publish + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} + run: | + python -m build + twine upload dist/*