Publish neatnet to PyPI / GitHub #5
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Publish neatnet to PyPI / GitHub | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
build-n-publish: | |
name: Build and publish neatnet to PyPI | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write # MANDATORY for trusted publishing to PyPI | |
contents: write # MANDATORY for the Github release action | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch all history for all branches and tags. | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Build source and wheel distributions | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install --upgrade build twine | |
python -m build | |
twine check --strict dist/* | |
- name: Create Release Notes | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
await github.request(`POST /repos/${{ github.repository }}/releases`, { | |
tag_name: "${{ github.ref }}", | |
generate_release_notes: true | |
}); | |
- name: Publish distribution to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |