Skip to content

296 add deployment workflow #4

296 add deployment workflow

296 add deployment workflow #4

Workflow file for this run

name: build-and-upload
on:
push:
tags:
- "*"
# temporary for testing
pull_request:
jobs:
static-checks:
uses: ./.github/workflows/statick-checks.yml

Check failure on line 11 in .github/workflows/build-upload.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/build-upload.yml

Invalid workflow file

error parsing called workflow ".github/workflows/build-upload.yml" -> "./.github/workflows/statick-checks.yml" : failed to fetch workflow: workflow was not found.
integration-tests:
uses: ./.github/workflows/integration-tests.yml
build-upload:
needs: [static-checks, integration-tests]
name: Build and upload to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install build dependencies
run: pip install --no-cache-dir -U pip .['build']
- name: Compare tag and package version
run: |
TAG=${GITHUB_REF#refs/*/}
VERSION=$(python -c 'import importlib.metadata; print(importlib.metadata.version("pymatic"))')
if [ "$TAG" != "$VERSION" ]; then
echo "Tag value and package version are different: ${TAG} != ${VERSION}"
exit 1
fi
- name: Build package
run: rm -rf build/ dist/ && python -m build --sdist --wheel
- name: Upload to PyPI
run: twine upload dist/*
env:
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}