Configure PyPI trusted publishing for CI releases

オープン
#1 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
github-actions, python
領域
ci-cd, devops, release

調査の方向性

まず .github/workflows/ci.yml の publish ジョブと、PyPI Trusted Publishers のドキュメントを確認します。PyPI にリポジトリ hardbyte/python-meridian-energy と ci.yml ワークフローを登録し、その後、API トークンの secrets なしでジョブが正常に公開できることを検証するため、パッチリリースまたはドキュメントのみのリリースを行います。

索引モデルが issue の本文から書いたものです。

説明

Context

meridian-energy 0.1.4 was published manually via twine + ~/.pypirc.

CI already has a release publish job (.github/workflows/ci.yml) using pypa/gh-action-pypi-publish with id-token: write, but PyPI trusted publishing is not wired up yet — so the job will fail until a publisher is registered.

Goal

Publishing a GitHub Release (vX.Y.Z) should upload to PyPI with no long-lived API token in GitHub secrets or local .pypirc.

Steps

  1. On PyPI → meridian-energy → Publishing:
    • Add a new pending publisher (Trusted Publisher → GitHub)
    • Owner: hardbyte
    • Repository: python-meridian-energy
    • Workflow: ci.yml (must match the filename under .github/workflows/)
    • Environment: leave empty unless we add a GitHub Environment
  2. Confirm the workflow publish job:
    • permissions: id-token: write
    • runs only on release: types: [published]
    • uses pypa/gh-action-pypi-publish
  3. Optional hardening (match python-evnex if desired):
    • GitHub Environment pypi with required reviewers
    • attestations: write + artifact attestation
    • uvx twine check --strict dist/* before upload
  4. Smoke test: cut a patch release (e.g. empty bump or docs-only 0.1.5) and confirm the publish job goes green without secrets.

Acceptance

  • Trusted publisher configured on PyPI for this repo/workflow
  • Next GitHub Release publishes to PyPI automatically
  • No PyPI API token stored in GitHub Actions secrets for this repo

Refs

主要言語
Python
スター
1
フォーク
1
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。