Skip to content

v1.14.0

v1.14.0 #102

Workflow file for this run

name: production
on:
push:
branches: [ production, "v[0-9]+.[0-9]+.post" ]
release:
types: [ published , edited ]
jobs:
build-n-publish-to-pypi:
runs-on: ubuntu-20.04
concurrency: build-n-publish-to-pypi
if: github.repository == 'CogStack/MedCAT'
steps:
- name: Checkout production
uses: actions/checkout@v4
with:
ref: ${{ github.event.release.target_commitish }}
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Run UATs
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
all_files=$(git ls-files | grep '^tests/.*\.py$' | grep -v '/__init__\.py$' | sed 's/\.py$//' | sed 's/\//./g')
num_files=$(echo "$all_files" | wc -l)
midpoint=$((num_files / 2))
first_half_nl=$(echo "$all_files" | head -n $midpoint)
second_half_nl=$(echo "$all_files" | tail -n +$(($midpoint + 1)))
timeout 25m python -m unittest ${first_half_nl[@]}
timeout 25m python -m unittest ${second_half_nl[@]}
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish production distribution to PyPI
if: startsWith(github.ref, 'refs/tags') && ! github.event.release.prerelease
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}