trigger:
- main

pool:
  vmImage: ubuntu-latest
strategy:
  matrix:
    Python310:
      python.version: '3.10'

steps:
- task: UsePythonVersion@0
  inputs:
    versionSpec: '$(python.version)'
  displayName: 'Use Python $(python.version)'

- script: |
    python -m pip install --upgrade pip==23.0.1
    pip install wheel==0.38.4 --upgrade
    pip install setuptools==66 --upgrade
    pip install build==0.10.0
    pip install twine
    pip install keyring
    pip install artifacts-keyring
  displayName: 'Install build dependencies'

- script: |
    python -m build
  displayName: 'Build PrimAITE sdist and wheel'

- task: TwineAuthenticate@1
  displayName: 'Twine Authenticate'
  inputs:
    artifactFeed: PrimAITE/PrimAITE

- script: |
    python -m twine upload --verbose -r PrimAITE --config-file  $(PYPIRC_PATH) dist/*.whl
  displayName: 'Artifact Upload'
