From 4cc1b3318caf8307d86d00dd458fc87988966f8a Mon Sep 17 00:00:00 2001 From: EddyCMWF Date: Fri, 25 Aug 2023 11:19:28 +0100 Subject: [PATCH] copy dist action from earthkit-data --- .github/workflows/on-release.yml | 53 ++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 19 deletions(-) diff --git a/.github/workflows/on-release.yml b/.github/workflows/on-release.yml index 9faa7a0..0724db3 100644 --- a/.github/workflows/on-release.yml +++ b/.github/workflows/on-release.yml @@ -65,22 +65,37 @@ jobs: runs-on: ubuntu-latest needs: [combine-environments] steps: - - uses: actions/checkout@v3 - - name: Install packages - run: | - $CONDA/bin/python -m pip install build twine - - name: Build distributions - run: | - $CONDA/bin/python -m build - - name: Check wheels - run: | - cd dist || exit - $CONDA/bin/python -m pip install earthkit_climate*.whl || exit - $CONDA/bin/python -m twine check * || exit - $CONDA/bin/python -c "from earthkit import climate" - - name: Publish a Python distribution to PyPI - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} + - uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.sha || github.ref }} + - name: Build distributions + run: | + $CONDA/bin/python -m pip install build + $CONDA/bin/python -m build + - name: Publish a Python distribution to PyPI + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + user: __token__ + password: ${{ secrets.PYPI_API_TOKEN }} + # steps: + # - uses: actions/checkout@v3 + # - name: Install packages + # run: | + # $CONDA/bin/python -m pip install build twine + # - name: Build distributions + # run: | + # $CONDA/bin/python -m build + # - name: Check wheels + # run: | + # cd dist || exit + # $CONDA/bin/python -m pip install earthkit_climate*.whl || exit + # $CONDA/bin/python -m twine check * || exit + # $CONDA/bin/python -c "from earthkit import climate" + # - name: Publish a Python distribution to PyPI + # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') + # uses: pypa/gh-action-pypi-publish@release/v1 + # with: + # user: __token__ + # password: ${{ secrets.PYPI_API_TOKEN }} +