version 0.2.5 release #217
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will upload a Python Package using Twine when a release is created | |
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | |
name: build | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches: | |
release: | |
types: [created] | |
jobs: | |
# quality: | |
# name: Code QA | |
# runs-on: ubuntu-latest | |
# steps: | |
# - uses: actions/checkout@v2 | |
# - run: pip install black flake8 isort | |
# - run: isort --version | |
# - run: black --version | |
# - run: flake8 --version | |
# - run: black --check . | |
# - run: isort --check . | |
# - run: flake8 . | |
checks: | |
strategy: | |
fail-fast: false | |
matrix: | |
# platform: ["ubuntu-latest"] | |
# python-version: ["3.9"] | |
platform: ["ubuntu-latest", "macos-latest", "windows-latest"] | |
python-version: ["3.9", "3.10", "3.11"] | |
exclude: | |
# excludes python 3.11 on windows | |
- platform: "windows-latest" | |
python-version: "3.11" | |
name: Python ${{ matrix.python-version }} on ${{ matrix.platform }} | |
runs-on: ${{ matrix.platform }} | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Updating pip | |
run: | | |
python -m pip install --upgrade pip | |
pip debug --verbose | |
- run: pip install climetlab | |
- name: Installing climetlab-eumetnet-postprocessing-benchmark | |
run: | | |
pwd | |
ls | |
ls * | |
ls */* | |
pip install . | |
- name: Install tests tools | |
run: | | |
pip install pytest | |
pip freeze | |
pip install nbformat nbconvert ipykernel matplotlib # dependencies for test/test_notebooks.py | |
- name: Run tests | |
run: | | |
cd tests | |
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: Check version | |
run: | | |
release=${GITHUB_REF##*/} | |
echo release | |
echo "$release" | |
version=$(python setup.py --version) | |
echo version | |
echo "$version" | |
test "$release" == "$version" | |
- name: Build pip package | |
run: | | |
python setup.py sdist --verbose | |
- name: Publish on the TEST test.pypi.org | |
env: | |
# see the uploaded pip package at https://test.pypi.org/search/?q=climetlab-{{ cookiecutter.plugin_name|lower|replace("_", "-") }} | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_API_TOKEN }} | |
run: | | |
twine upload --repository testpypi --verbose dist/* | |
# Uncomment to publish and make it available through pip | |
# (PYPI_API_TOKEN must be in the github secret for this space/repos) | |
- name: Publish on pypi.org | |
env: | |
TWINE_USERNAME: __token__ | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
run: | | |
twine upload dist/* --verbose |