Skip to content

Publish to PyPI

Publish to PyPI #1807

Workflow file for this run

name: Publish to PyPI
on:
schedule:
- cron: "0 13 * * *"
pull_request:
push:
branches:
- main
release:
types:
- published
defaults:
run:
shell: bash
jobs:
packages:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/folium/
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# Should be enough for setuptools-scm
fetch-depth: 100
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: "3.x"
- name: Get tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Install build tools
run: |
python -m pip install --upgrade pip wheel build twine
- name: Build binary wheel and sdist
run: python -m build --sdist --wheel . --outdir dist
- name: CheckFiles
run: |
ls dist
- name: Test wheels
run: |
cd dist && python -m pip install folium*.whl
python -m twine check *
- name: Publish a Python distribution to PyPI
if: success() && github.event_name == 'release'
uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # v1.14.1