Skip to content

Merge pull request #239 from microsoft/bugfix/write-parsable-multipar… #33

Merge pull request #239 from microsoft/bugfix/write-parsable-multipar…

Merge pull request #239 from microsoft/bugfix/write-parsable-multipar… #33

Workflow file for this run

name: Publish package to PyPI
on:
push:
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
permissions:
contents: write
jobs:
build:
uses: ./.github/workflows/build.yml
publish:
name: Publish distribution to PyPI
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
environment: pypi_prod
needs: [build]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install flit
run: |
pip install flit
- name: Publish the distibution to PyPI
run: flit publish
env:
FLIT_INDEX_URL: https://upload.pypi.org/legacy/
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets. PYPI_API_TOKEN }}
release:
name: Create release
runs-on: ubuntu-latest
needs: [publish]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v2
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create --notes '${{ steps.extract-release-notes.outputs.release_notes }}' --title ${{ github.ref_name }} ${{ github.ref_name }}