Skip to content

👷(pypi) add workflow to publish package #2

👷(pypi) add workflow to publish package

👷(pypi) add workflow to publish package #2

Workflow file for this run

name: Build and Publish to PyPI

Check failure on line 1 in .github/workflows/publish.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/publish.yml

Invalid workflow file

Invalid type for `job.environment`
on:
push:
# tags:
# - 'v*' # Trigger on version tags like v1.0.0
jobs:
build-and-publish:
name: Build and publish to PyPI
runs-on: ubuntu-latest
environment:
#name: pypi
url: https://pypi.org/p/django-lasuite
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Get full history for proper versioning
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build
- name: Check distribution
run: twine check dist/*
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# Use TestPyPI for testing
with:
repository-url: https://test.pypi.org/legacy/