Skip to content

fix: normalize haskell libraries that have no version component #8

fix: normalize haskell libraries that have no version component

fix: normalize haskell libraries that have no version component #8

name: Publish Python Package
on:
workflow_dispatch:
inputs:
publish_target:
description: 'Publish target (testpypi, pypi, dry-run)'
required: true
default: 'dry-run'
type: choice
options:
- dry-run
- testpypi
- pypi
push:
branches:
- main
paths:
- 'python/**'
pull_request:
branches:
- main
paths:
- 'python/**'
jobs:
build-wheel:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine auditwheel
working-directory: python
- name: Build package
run: python -m build
working-directory: python
- name: Check distribution
run: twine check dist/*
working-directory: python
- name: Upload Python package dist artifacts
uses: actions/upload-artifact@v4
with:
name: python-package-dist
path: python/dist
pypi-publish:
name: Upload release to PyPI
runs-on: ubuntu-latest
needs: build-wheel
if: github.event.inputs.publish_target == 'pypi'
environment:
name: pypi
url: https://pypi.org/p/dapper-python
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download Python package dist artifacts
uses: actions/download-artifact@v4
with:
name: python-package-dist
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
testpypi-publish:
name: Upload release to TestPyPI
runs-on: ubuntu-latest
needs: build-wheel
if: github.event.inputs.publish_target == 'testpypi'
environment:
name: testpypi
url: https://test.pypi.org/p/dapper-python
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Download Python package dist artifacts
uses: actions/download-artifact@v4
with:
name: python-package-dist
path: dist
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1