From 7addc13dabd02927aee0e291c45960683d15f1bd Mon Sep 17 00:00:00 2001 From: michaelavs Date: Thu, 5 May 2022 10:43:36 -0600 Subject: [PATCH] Add pypy.yaml to PR --- .github/workflows/pypi.yaml | 54 +++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml index e69de29..ebf0943 100644 --- a/.github/workflows/pypi.yaml +++ b/.github/workflows/pypi.yaml @@ -0,0 +1,54 @@ +name: Upload wrf-python to PyPI +on: + release: + types: + - published +jobs: + test-build: + if: github.repository == 'NCAR/wrf-python' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install setuptools setuptools-scm wheel twine check-manifest + - name: Build tarball and wheels + run: | + python setup.py sdist bdist_wheel + python -m pip wheel . -w dist --no-deps + - name: Test the artifacts + run: | + python -m twine check dist/* + publish: + needs: test-build + if: startsWith(github.ref, 'refs/tags') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install setuptools setuptools-scm wheel twine check-manifest + - name: Build tarball and wheels + run: | + python setup.py sdist bdist_wheel + python -m pip wheel . -w dist --no-deps + - name: Test the artifacts + run: | + python -m twine check dist/* + - name: Publish package to PyPI + uses: pypa/gh-action-pypi-publish@v1.5.0 + with: + user: __token__ + password: ${{ secrets.PYPI_PASSWORD }} + skip_existing: true + verbose: true \ No newline at end of file