Merge pull request #233 from maxmind/dependabot/github_actions/astral… #197
This file contains hidden or 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 upload to PyPI | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
permissions: {} | |
jobs: | |
build: | |
name: Build source distribution | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
persist-credentials: false | |
- name: Install the latest version of uv | |
uses: astral-sh/setup-uv@e92bafb6253dcd438e0484186d7669ea7a8ca1cc # 6.4.3 | |
- name: Build | |
run: uv build | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: | | |
dist/*.tar.gz | |
dist/*.whl | |
upload_pypi: | |
needs: build | |
runs-on: ubuntu-latest | |
environment: release | |
permissions: | |
id-token: write | |
if: github.event_name == 'release' && github.event.action == 'published' | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: artifact | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # 1.12.4 |