Publishing a Poetry project with GitHub Actions and Trusted Publishing
Overview
I was experimenting with PyPI Trusted Publishing with GitHub Actions for my Poetry based project. The outcome is a fully automated, free CI/CD pipeline that builds and publishes on push without storing any PyPI tokens.
Why Trusted Publishing
Trusted Publishing removes long‑lived API tokens by letting GitHub Actions authenticate to PyPI using OpenID Connect (OIDC), which PyPI exchanges for a short‑lived upload token during the workflow run. This is more secure and recommended by PyPI for CI/CD releases.
Visual Studio Code Extensions
Below are some of the Visual Studio Code extensions I used, will update if there are more.
1. Markdown All in One
- Use case: Writing technical notes, documentation, and blog posts quickly.
- Why useful:
- Keyboard shortcuts for formatting (bold, headings, lists).
- Live preview of rendered Markdown.
- Table of contents generation.
2. VSCode Journal
- Use case: Daily or ad-hoc personal notes directly in VSCode.
- Why useful:
- Automatically creates timestamped entries in a “journal” folder.
- Great for capturing quick thoughts, work logs, or debugging notes.
- CMD + Shift + J
3. vscode-journal-view
- Use case: Companion extension to VSCode Journal for browsing entries.
- Why useful:
- Provides a sidebar view to navigate journal entries by date.
- Easier than digging through raw Markdown files.
Python Development using VSCode
For Python projects, I add two more key extensions:
Setting up Python Dev Environment
Developing multiple python projects in local machine may require different python environments to run.
Example: Python 3.12 has the telnetlib library bundled in the standard library. In Python 3.13, it’s removed. Code relying on it works in 3.12 but fails in 3.13.
Without python version management, this sort of breakage can waste hours in debugging.
This post shows one way of setting up development environment so that the machine have the flexibility to handle different python projects that may require different python environments: