Skip to content

Publish 🐍📦 to PyPI #2

Publish 🐍📦 to PyPI

Publish 🐍📦 to PyPI #2

Workflow file for this run

name: Publish 🐍📦 to PyPI
on:
workflow_dispatch:
release:
types:
- published
jobs:
build:
name: Build distribution 📦
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: Prepare Environment
run: pip install hatch
- name: Build package
run: hatch build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
with:
name: uca-package-distributions
path: dist/
publish-to-pypi:
name: >-
Publish Python 🐍 distribution 📦 to PyPI
needs:
- build
runs-on: ubuntu-latest
environment:
name: release
url: https://pypi.org/p/cloudzero-uca-tools
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
# retrieve your distribution packages
- name: Download all the dists
uses: actions/download-artifact@v3
with:
name: uca-package-distributions
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1