Skip to content

Commit cb7698a

Browse files
committed
Update external workflows
1 parent 9784545 commit cb7698a

11 files changed

Lines changed: 103 additions & 15 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
name: Publish to PyPI via Trusted Publishing
3+
description: >
4+
Download the build artifact (which carries its own PEP 740 attestation
5+
sidecars, generated at build time) and upload everything to PyPI using
6+
OIDC-based Trusted Publishing (no long-lived API token).
7+
8+
# This composite action is a workaround for pypi/warehouse#11096: PyPI's
9+
# Trusted Publisher config matches the OIDC `job_workflow_ref` claim against
10+
# the *caller's* workflow file, but reusable workflows mint a token whose
11+
# `job_workflow_ref` names the reusable workflow. Composite actions inherit
12+
# the calling job's OIDC context, so invoking this action from a downstream
13+
# caller's `release.yaml` keeps `job_workflow_ref` pointing at that file —
14+
# which is what the downstream's PyPI Trusted Publisher must register.
15+
16+
inputs:
17+
artifact-name:
18+
description: Name of the dist artifact uploaded by the upstream build job.
19+
required: true
20+
repository-url:
21+
description: >
22+
Optional override for the PyPI repository URL (e.g., TestPyPI). Leave
23+
empty to publish to the canonical PyPI index.
24+
required: false
25+
default: ""
26+
27+
runs:
28+
using: composite
29+
steps:
30+
- uses: astral-sh/setup-uv@6ee6290f1cbc4156c0bdd66691b2c144ef8df19a # v7.4.0
31+
with:
32+
enable-cache: false
33+
34+
- name: Download build artifact
35+
id: download
36+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
37+
with:
38+
name: ${{ inputs.artifact-name }}
39+
path: dist/
40+
41+
- name: Push to PyPI
42+
env:
43+
DOWNLOAD_PATH: ${{ steps.download.outputs.download-path }}
44+
REPOSITORY_URL: ${{ inputs.repository-url }}
45+
shell: bash
46+
run: |
47+
args=(--no-progress publish --trusted-publishing automatic)
48+
if [[ -n "${REPOSITORY_URL}" ]]; then
49+
args+=(--publish-url "${REPOSITORY_URL}")
50+
fi
51+
uv "${args[@]}" "${DOWNLOAD_PATH}"/*

.github/workflows/autofix.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name: 🪄 Autofix
99
jobs:
1010

1111
autofix:
12-
uses: kdeldycke/repomatic/.github/workflows/autofix.yaml@f600fefb41f28a11f550f43d8145b96438e46b84 # v6.14.0
12+
uses: kdeldycke/repomatic/.github/workflows/autofix.yaml@f185b237deb05defc94f8dff02a82a2d9bd579d8 # v6.20.0
1313
secrets:
1414
REPOMATIC_PAT: ${{ secrets.REPOMATIC_PAT }}
1515
VIRUSTOTAL_API_KEY: ${{ secrets.VIRUSTOTAL_API_KEY }}

.github/workflows/autolock.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ name: 🔒 Autolock
88
jobs:
99

1010
autolock:
11-
uses: kdeldycke/repomatic/.github/workflows/autolock.yaml@f600fefb41f28a11f550f43d8145b96438e46b84 # v6.14.0
11+
uses: kdeldycke/repomatic/.github/workflows/autolock.yaml@f185b237deb05defc94f8dff02a82a2d9bd579d8 # v6.20.0

.github/workflows/cancel-runs.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ name: ✂️ Cancel runs
44
pull_request:
55
types:
66
- closed
7-
workflow_dispatch:
87

98
jobs:
109

1110
cancel-runs:
12-
uses: kdeldycke/repomatic/.github/workflows/cancel-runs.yaml@f600fefb41f28a11f550f43d8145b96438e46b84 # v6.14.0
11+
uses: kdeldycke/repomatic/.github/workflows/cancel-runs.yaml@f185b237deb05defc94f8dff02a82a2d9bd579d8 # v6.20.0

.github/workflows/changelog.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ name: 🆙 Changelog & versions
2323
jobs:
2424

2525
changelog:
26-
uses: kdeldycke/repomatic/.github/workflows/changelog.yaml@f600fefb41f28a11f550f43d8145b96438e46b84 # v6.14.0
26+
uses: kdeldycke/repomatic/.github/workflows/changelog.yaml@f185b237deb05defc94f8dff02a82a2d9bd579d8 # v6.20.0
2727
secrets:
2828
REPOMATIC_PAT: ${{ secrets.REPOMATIC_PAT }}

.github/workflows/docs.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@ name: 📚 Docs
55
push:
66
branches:
77
- main
8+
paths:
9+
- .github/workflows/docs.yaml
10+
- changelog.md
11+
- citation.cff
12+
- "docs/**"
13+
- pyproject.toml
14+
- readme.md
15+
- uv.lock
16+
- "**/*.py"
817

918
jobs:
1019

1120
docs:
12-
uses: kdeldycke/repomatic/.github/workflows/docs.yaml@f600fefb41f28a11f550f43d8145b96438e46b84 # v6.14.0
21+
uses: kdeldycke/repomatic/.github/workflows/docs.yaml@f185b237deb05defc94f8dff02a82a2d9bd579d8 # v6.20.0

.github/workflows/labels.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ name: 🏷️ Labels
77
- main
88
pull_request:
99
branches-ignore:
10+
- major-version-increment
11+
- minor-version-increment
1012
- prepare-release
11-
- "renovate/**"
1213
types:
1314
- opened
1415
issues:
@@ -18,4 +19,4 @@ name: 🏷️ Labels
1819
jobs:
1920

2021
labels:
21-
uses: kdeldycke/repomatic/.github/workflows/labels.yaml@f600fefb41f28a11f550f43d8145b96438e46b84 # v6.14.0
22+
uses: kdeldycke/repomatic/.github/workflows/labels.yaml@f185b237deb05defc94f8dff02a82a2d9bd579d8 # v6.20.0

.github/workflows/lint.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,23 @@ name: 🧹 Lint
55
push:
66
branches:
77
- main
8+
paths-ignore:
9+
- "**/*.gif"
10+
- "**/*.jpeg"
11+
- "**/*.jpg"
12+
- "**/*.png"
13+
- "**/*.svg"
14+
- "**/*.webp"
815
pull_request:
916
branches-ignore:
17+
- major-version-increment
18+
- minor-version-increment
1019
- prepare-release
11-
- "renovate/**"
1220

1321
jobs:
1422

1523
lint:
16-
uses: kdeldycke/repomatic/.github/workflows/lint.yaml@f600fefb41f28a11f550f43d8145b96438e46b84 # v6.14.0
24+
uses: kdeldycke/repomatic/.github/workflows/lint.yaml@f185b237deb05defc94f8dff02a82a2d9bd579d8 # v6.20.0
1725
secrets:
1826
REPOMATIC_PAT: ${{ secrets.REPOMATIC_PAT }}
1927
VIRUSTOTAL_API_KEY: ${{ secrets.VIRUSTOTAL_API_KEY }}

.github/workflows/release.yaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,29 @@
11
---
22
name: 🚀 Build & release
33
"on":
4+
workflow_dispatch:
45
push:
56
branches:
67
- main
7-
workflow_dispatch:
88

99
jobs:
1010

1111
release:
12-
uses: kdeldycke/repomatic/.github/workflows/release.yaml@f600fefb41f28a11f550f43d8145b96438e46b84 # v6.14.0
12+
uses: kdeldycke/repomatic/.github/workflows/release.yaml@f185b237deb05defc94f8dff02a82a2d9bd579d8 # v6.20.0
1313
secrets:
14-
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
1514
REPOMATIC_PAT: ${{ secrets.REPOMATIC_PAT }}
1615
VIRUSTOTAL_API_KEY: ${{ secrets.VIRUSTOTAL_API_KEY }}
16+
17+
publish-pypi:
18+
name: 🐍 Publish to PyPI (${{ matrix.short_sha }})
19+
needs: release
20+
if: needs.release.outputs.release_commits_matrix
21+
strategy:
22+
matrix: ${{ fromJSON(needs.release.outputs.release_commits_matrix) }}
23+
runs-on: ubuntu-latest
24+
permissions:
25+
id-token: write
26+
steps:
27+
- uses: kdeldycke/repomatic/.github/actions/publish-pypi@f185b237deb05defc94f8dff02a82a2d9bd579d8 # v6.20.0
28+
with:
29+
artifact-name: ${{ github.event.repository.name }}-${{ matrix.short_sha }}

.github/workflows/renovate.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
name: 🆕 Renovate
33
"on":
4+
workflow_dispatch:
45
schedule:
56
- cron: "3 17 * * 1"
6-
workflow_dispatch:
77
push:
88
branches:
99
- main
@@ -14,6 +14,6 @@ name: 🆕 Renovate
1414
jobs:
1515

1616
renovate:
17-
uses: kdeldycke/repomatic/.github/workflows/renovate.yaml@f600fefb41f28a11f550f43d8145b96438e46b84 # v6.14.0
17+
uses: kdeldycke/repomatic/.github/workflows/renovate.yaml@f185b237deb05defc94f8dff02a82a2d9bd579d8 # v6.20.0
1818
secrets:
1919
REPOMATIC_PAT: ${{ secrets.REPOMATIC_PAT }}

0 commit comments

Comments
 (0)