Skip to main content

Important code that I reuse through multiple projects. Please see license for allowed use.

Project description

JulienPythonToolkit-V001

Important code that I reuse through multiple projects. Please see license for allowed use.

🚀 Release & Publishing Guide (GitHub → PyPI)

This repository uses GitHub Actions to automatically build and publish the package to PyPI when a new version tag is created.


How GitHub Actions Works in This Repository

The publishing workflow is defined in:

.github/workflows/publish.yml

The workflow is triggered only when a new tag starting with v is pushed.

Trigger condition:

on: push: tags: - "v*"

This means:

  • Normal commits to main do NOT publish.
  • Editing a GitHub release does NOT publish.
  • Reusing an existing tag does NOT publish.
  • Only a brand-new tag push triggers the workflow.

When triggered, the workflow:

  1. Verifies the tag points to a commit on main
  2. Builds the package using python -m build
  3. Publishes to PyPI using Trusted Publishing

PyPI Trusted Publishing

This project uses PyPI Trusted Publishing (OIDC).

This means:

  • No PyPI API token is stored in GitHub secrets.
  • GitHub securely authenticates directly with PyPI.
  • The workflow requires id-token: write permission.

If Trusted Publishing is not configured in the PyPI project settings, publishing will fail.


Correct Release Workflow

Follow this process exactly.

  1. Create a feature branch

  2. Make your changes

  3. Bump the version in setup.py
    Example:
    version='0.2.4'

  4. Commit and push the branch

  5. Merge the branch into main

  6. On GitHub:

    • Go to Releases
    • Click Draft a new release
    • Create a new tag (e.g. v0.2.4)
    • Target branch must be main
    • Publish release

Creating the release creates and pushes the tag.

This triggers the GitHub Action.

To monitor progress:

Repository → Actions

Green check = success
Red X = failure

After success, the new version appears on PyPI.


Important Rules

  1. The tag must be new
    Reusing the same tag will NOT trigger the workflow again.

  2. The package version must be new
    PyPI does not allow re-uploading the same version number, even if the previous upload failed.

  3. The version inside the package must match the tag
    Tag: v0.2.4
    setup.py version: 0.2.4

  4. Always bump the version before merging to main.

  5. Always tag after the change is merged to main.
    Do not tag on feature branches.

  6. Test the build locally before releasing:

    python -m pip install build
    python -m build

    If it fails locally, CI will fail.


If Publishing Does Not Trigger

Check:

  • Is the workflow file merged into main?
  • Does the tag start with v?
  • Is it a new tag?
  • Does the tag target main?
  • Is Trusted Publishing configured in PyPI?

Release Summary

Branch → Implement changes → Bump version → Merge to main → Create GitHub release (new tag) → Workflow runs → Check Actions → Version appears on PyPI.

This ensures secure, reproducible, and clean releases.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

julien_python_toolkit-0.2.5.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

julien_python_toolkit-0.2.5-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file julien_python_toolkit-0.2.5.tar.gz.

File metadata

  • Download URL: julien_python_toolkit-0.2.5.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for julien_python_toolkit-0.2.5.tar.gz
Algorithm Hash digest
SHA256 078c2af699a9bd67832aadf113c0129be5493b5dcc06ffef653da1507eb67a44
MD5 0f190b6783dae179000237a8b230a33d
BLAKE2b-256 0ffe71a3c2564201bc74021a5716673280d2109f31f0abd5e62a5f46d21f0537

See more details on using hashes here.

Provenance

The following attestation bundles were made for julien_python_toolkit-0.2.5.tar.gz:

Publisher: publish.yml on AgoDeo-Organization/Shared-Company-Code

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file julien_python_toolkit-0.2.5-py3-none-any.whl.

File metadata

File hashes

Hashes for julien_python_toolkit-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b0bdd8986507c6824078570b373b563ccc61f37ff33e58b7ada0014cad591514
MD5 a9b43bc489046b7a508249385f28020b
BLAKE2b-256 de75f268fd03249b2385f8adf282d57a2a0d8203f580ac42f3c15854752f928c

See more details on using hashes here.

Provenance

The following attestation bundles were made for julien_python_toolkit-0.2.5-py3-none-any.whl:

Publisher: publish.yml on AgoDeo-Organization/Shared-Company-Code

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page