| 1 |
name: Build and Publish Python Package |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
tags: |
| 6 |
- '[0-9].*' |
| 7 |
|
| 8 |
jobs: |
| 9 |
create_release: |
| 10 |
name: Create GitHub Release |
| 11 |
runs-on: ubuntu-latest |
| 12 |
steps: |
| 13 |
- name: Create release |
| 14 |
uses: actions/create-release@v1 |
| 15 |
env: |
| 16 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 17 |
with: |
| 18 |
tag_name: ${{ github.ref }} |
| 19 |
release_name: ${{ github.ref }} |
| 20 |
draft: false |
| 21 |
prerelease: true |
| 22 |
|
| 23 |
deploy: |
| 24 |
|
| 25 |
runs-on: ubuntu-latest |
| 26 |
environment: |
| 27 |
name: publish-to-pypi |
| 28 |
url: https://pypi.org/p/fontMath |
| 29 |
permissions: |
| 30 |
id-token: write |
| 31 |
|
| 32 |
steps: |
| 33 |
- uses: actions/[email protected] |
| 34 |
- name: Set up Python |
| 35 |
uses: actions/[email protected] |
| 36 |
with: |
| 37 |
python-version: '3.x' |
| 38 |
- name: Install dependencies |
| 39 |
run: | |
| 40 |
python -m pip install --upgrade pip |
| 41 |
pip install setuptools wheel twine |
| 42 |
- name: Build and publish |
| 43 |
run: | |
| 44 |
python setup.py sdist bdist_wheel |
| 45 |
twine upload dist/* |