Merge pull request #419 from juaml/dependabot/github_actions/actions-… #5
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: Build and publish | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
jobs: | |
build-and-publish: | |
name: Build and publish | |
runs-on: ubuntu-latest | |
permissions: | |
# Needed for PyPI publishing | |
id-token: write | |
# Needed for GitHub releases | |
contents: write | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: true | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.x" | |
- name: Install build | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install build | |
- name: Build package | |
run: | |
python -m build | |
- name: Publish package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
- name: Make release on GitHub | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
dist/*.tar.gz | |
dist/*.whl | |
generate_release_notes: true | |
make_latest: true |