diff options
author | Gard Spreemann <gspr@nonempty.org> | 2021-08-14 20:33:19 +0200 |
---|---|---|
committer | Gard Spreemann <gspr@nonempty.org> | 2021-08-14 20:33:19 +0200 |
commit | 4e608966f4cd5ea995189f8a23e00e4154ddf2a9 (patch) | |
tree | 6ee9bae4145ff00c595f3635db027c8549a84f4d /.github/workflows/check-and-publish.yml | |
parent | b70a5361202307c26bac18d15453b5193a22f11c (diff) | |
parent | f3b94a9bc40f8d56b0d1ac8cc8bc84765509ef05 (diff) |
Merge tag '0.5.1' into debian/sid
Diffstat (limited to '.github/workflows/check-and-publish.yml')
-rw-r--r-- | .github/workflows/check-and-publish.yml | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/.github/workflows/check-and-publish.yml b/.github/workflows/check-and-publish.yml new file mode 100644 index 0000000..10831bf --- /dev/null +++ b/.github/workflows/check-and-publish.yml @@ -0,0 +1,87 @@ +name: Check and publish + +on: + push: + branches: [ master ] + + pull_request: + branches: [ master ] + + release: + types: [created] + + +jobs: + checks: + strategy: + fail-fast: false + matrix: + platform: [windows-latest, ubuntu-latest, macos-latest] + python-version: ["2.7", "3.6", "3.7", "3.8", "3.9"] + + name: Python ${{ matrix.python-version }} on ${{ matrix.platform }} + runs-on: ${{ matrix.platform }} + + timeout-minutes: 20 + + steps: + - uses: actions/checkout@v2 + + - uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Tokens + shell: python + env: + CDSAPIRC: ${{ secrets.CDSAPIRC }} + + run: | + from __future__ import print_function + import os + for n in ('CDSAPIRC',): + m = os.path.expanduser("~/." + n.lower()) + if os.environ[n]: + with open(m, "w") as f: + print(os.environ[n], file=f) + + - name: Tests + run: | + python setup.py develop + pip install pytest + pytest + + deploy: + + if: ${{ github.event_name == 'release' }} + + name: Upload to Pypi + needs: checks + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} + run: | + python setup.py sdist + twine upload dist/* + + - name: Notify climetlab + uses: mvasigh/dispatch-action@main + with: + token: ${{ secrets.NOTIFY_ECMWFLIBS }} + repo: climetlab + owner: ecmwf + event_type: cdsapi-updated |