Skip to content

CD-PyPi

CD-PyPi #9

Workflow file for this run

---
name: CD-PyPi
description: "Continuous Deployment workflow for PyPi publishing."
run-name: Build and publish ${{ github.ref_name }} by @${{ github.actor }}
on:
release:
types:
- published
permissions: {}
jobs:
pypi-publish:
name: upload release to PyPI
if: ${{ github.event_name == 'release' && (github.repository == 'reactive-firewall/multicast') && startsWith(github.ref, 'refs/tags/v') }}
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
# environment: pypi
permissions:
# IMPORTANT: this permission is mandatory for Trusted Publishing
id-token: write
statuses: write
contents: read
actions: read
defaults:
run:
shell: bash
env:
LANG: "en_US.UTF-8"
outputs:
build_status: ${{ steps.build.outcome }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: "${{ vars.PYTHON_DEFAULT }}"
- name: Pre-Clean
id: clean
run: make -j1 -f Makefile purge 2>/dev/null || true
- name: Build
id: build
run: make -j1 -f Makefile build
- name: Publish package distributions to PyPI
if: ${{ success() }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
packages-dir: dist/