Skip to content

Fixing the vendor package (#142) #26

Fixing the vendor package (#142)

Fixing the vendor package (#142) #26

Workflow file for this run

# This workflows 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: Upload Python Package
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
environment: CD
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip poetry==1.2.2
poetry config virtualenvs.create false
poetry install
- name: Linting
run: |
poetry run pre-commit run --all-files
- name: Run tests
env:
environment: main
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
TENANT_ID: 755f6e58-74f0-4a07-a599-f7479b9669ab
COGNITE_PROJECT: oceandata-dev
CDF_CLUSTER: westeurope-1
run: |
poetry run pytest tests/ -v --cov-report xml:coverage.xml --cov
poetry run coverage xml
- uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
- name: Build docs
working-directory: docs
run: make html
- name: Build package
run: poetry build
- name: Release to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: twine upload --verbose dist/* || echo 'Version exists'