Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ name: Publish to PyPI
# -----------------------------------------------------------------------------
# Publishes apte to PyPI via Trusted Publishing (OIDC, no stored API token).
# PyPI Trusted Publisher: owner=renaudcepre, repo=apte, workflow=publish.yml.
# Fires on every published GitHub release (release-please cuts these) and can
# also be run manually.
#
# Triggered by the Release Please workflow, which dispatches this one when it cuts
# a release. We can't use `on: release` here: release-please creates the GitHub
# release with GITHUB_TOKEN, and events from that token don't trigger workflows
# (recursion prevention). workflow_dispatch is exempt from that rule. Can also be
# run manually.
# -----------------------------------------------------------------------------

on:
release:
types: [published]
workflow_dispatch:

permissions:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,25 @@ on:
permissions:
contents: write
pull-requests: write
actions: write # to dispatch publish.yml when a release is cut

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- uses: googleapis/release-please-action@v5
id: release
with:
token: ${{ secrets.GITHUB_TOKEN }}
config-file: release-please-config.json
manifest-file: .release-please-manifest.json

# release-please cuts the GitHub release with GITHUB_TOKEN, which does not
# trigger `on: release` workflows (recursion prevention). workflow_dispatch
# is exempt, so dispatch the publish workflow explicitly. publish.yml stays
# the entry workflow, so the PyPI Trusted Publisher config is unchanged.
- name: Trigger PyPI publish
if: ${{ steps.release.outputs.release_created }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh workflow run publish.yml --ref main --repo ${{ github.repository }}
17 changes: 17 additions & 0 deletions JOURNAL.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# JOURNAL

## 2026-06-25 — ci: auto-publish reel (dispatch depuis release-please)

Le trigger `release: [published]` ajoute plus tot etait inoperant : release-please
cree la GitHub Release avec le GITHUB_TOKEN, et GitHub ne declenche aucun workflow
sur un evenement emis par ce token (anti-recursion). 0.3.0 et 0.3.1 ont du etre
publiees a la main.

Verifie sur les sources (changelog GitHub 2022-09-08, doc PyPI, README
release-please-action) plutot que de deviner : `workflow_dispatch` est l'EXCEPTION
a l'anti-recursion, il declenche bien un run via GITHUB_TOKEN. Et `release_created`
(singulier) est le bon output pour un composant racine.

Fix : release-please.yml fait `gh workflow run publish.yml` quand `release_created`
est vrai (+ permission `actions: write`). publish.yml reste le workflow d'entree
(claim OIDC = publish.yml, config Trusted Publisher PyPI inchangee) ; son trigger
`release:` trompeur est retire. Les prochaines releases publieront vraiment seules.

## 2026-06-25 — fix(docs): README install -> pip install apte

La section Installation du README disait encore "not yet on PyPI, install from
Expand Down