Skip to content

2.7.0

2.7.0 #111

Workflow file for this run

name: Release - pip package
on:
push:
branches: [ 'release/*' ]
tags: ['v*']
pull_request:
branches: [ 'release/*' ]
release:
types: [published]
jobs:
# long running tests and check of image generation
full_test:
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r tests/requirements-test.txt
- name: Run all test with pytest
run: |
pytest -k "slow"
- name: Check images generation for documentation
run: |
cd docs/images_generation && ./run.sh
# test if package generation works and optional package upload to pypi (only on release)
make_and_upload_package:
runs-on: ubuntu-latest
needs: [full_test]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Make wheel package and validate it
run: |
pip install wheel twine
# first call to version method would generate VERSION file
PYTHONPATH=. python pymchelper/run.py --version
python setup.py bdist_wheel
twine check dist/*.whl
# makes source package
python setup.py sdist
- name: publish package to pypi
uses: pypa/gh-action-pypi-publish@v1.8.14
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
with:
# Password for your PyPI user or an access token
password: ${{ secrets.TWINE_PASSWORD }}
# The target directory for distribution
packages_dir: dist/
# Show verbose output.
verbose: true
# sphinx documentation generation and optional upload to github pages (on release)
docs:
runs-on: ubuntu-latest
needs: [make_and_upload_package]
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0 # fetch all history, as by default only last 1 commit is fetched
- name: Build and Commit
uses: sphinx-notes/pages@3.0
with:
checkout: false
python_version: '3.10'