Skip to content

Merge pull request #168 from microsoft/python #53

Merge pull request #168 from microsoft/python

Merge pull request #168 from microsoft/python #53

Workflow file for this run

name: prompty Python build and publish
on:
push:
paths:
- 'runtime/prompty/**'
tags:
- 'python/*'
workflow_dispatch:
env:
AZURE_OPENAI_ENDPOINT: https://fake
AZURE_OPENAI_KEY: 12342323433
jobs:
prompty-tests:
name: run unit tests on supported python versions
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
os: [ubuntu-latest, macOS-latest, windows-latest]
permissions:
# This permission is needed for private repositories.
contents: read
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v4
with:
python-version: ${{ matrix.python-version }}
- name: install dependencies
working-directory: ./runtime/prompty
run: pdm install
- name: test package
working-directory: ./runtime/prompty
run: pdm run pytest
- name: mypy check
working-directory: ./runtime/prompty
run: pdm run mypy . --check-untyped-defs
pypi-publish:
name: upload release to PyPI
runs-on: ubuntu-latest
needs: prompty-tests
permissions:
# This permission is needed for private repositories.
contents: read
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4
- uses: pdm-project/setup-pdm@v4
with:
python-version: 3.9
- name: install dependencies
working-directory: ./runtime/prompty
run: pdm install
- name: Publish package distributions to PyPI
working-directory: ./runtime/prompty
run: pdm publish