Set up continuous deployment for PyPI releases (#2342)

This commit is contained in:
Adam J. Stewart 2024-10-10 17:46:56 +02:00 коммит произвёл GitHub
Родитель b8d4da7e7a
Коммит c5c7fcc06a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
1 изменённых файлов: 45 добавлений и 0 удалений

45
.github/workflows/deploy.yaml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,45 @@
name: deploy
on:
release:
types:
- published
jobs:
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Clone repo
uses: actions/checkout@v4.2.1
- name: Set up python
uses: actions/setup-python@v5.2.0
with:
python-version: '3.12'
- name: Install pip dependencies
run: pip install build
- name: List pip dependencies
run: pip list
- name: Build project
run: python3 -m build
- name: Upload artifacts
uses: actions/upload-artifact@v4.4.3
with:
name: pypi-dist
path: dist/
pypi:
name: pypi
needs:
- build
environment:
name: pypi
url: https://pypi.org/p/torchgeo
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4.1.8
with:
name: pypi-dist
path: dist/
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.10.3