Skip to content

Commit c595c22

Browse files
authored
Repair Metadata 2.5 PyPI publishing (#12)
* ci: publish Metadata 2.5 distributions with uv * ci: preserve provenance in release recovery
1 parent 4f934c7 commit c595c22

1 file changed

Lines changed: 22 additions & 3 deletions

File tree

.github/workflows/python-release.yml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ on:
44
push:
55
tags:
66
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
release_ref:
10+
description: Existing release tag to rebuild and publish
11+
required: true
712

813
permissions:
914
contents: read
@@ -16,6 +21,8 @@ jobs:
1621
- name: Checkout Oída
1722
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
1823
with:
24+
ref: ${{ github.event_name == 'workflow_dispatch' && inputs.release_ref || github.ref_name }}
25+
fetch-depth: 0
1926
path: oida
2027

2128
- name: Checkout AKOÚŌ contract
@@ -42,12 +49,20 @@ jobs:
4249
- name: Install uv
4350
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
4451
with:
52+
version: "0.12.3"
4553
python-version: "3.12"
4654

4755
- name: Verify release tag and project version
4856
working-directory: oida
57+
env:
58+
RELEASE_REF: ${{ github.event_name == 'workflow_dispatch' && inputs.release_ref || github.ref_name }}
4959
run: |
50-
release_version="${GITHUB_REF_NAME#v}"
60+
case "$RELEASE_REF" in
61+
v*) ;;
62+
*) echo "release_ref must name a v-prefixed release tag" >&2; exit 1 ;;
63+
esac
64+
test "$(git describe --tags --exact-match HEAD)" = "$RELEASE_REF"
65+
release_version="${RELEASE_REF#v}"
5166
project_version="$(uv version --short)"
5267
test "$release_version" = "$project_version"
5368
@@ -110,10 +125,12 @@ jobs:
110125
path: release
111126

112127
- name: Publish ${{ matrix.project }}
113-
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
128+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
114129
with:
115130
packages-dir: release/${{ matrix.directory }}
116131
skip-existing: true
132+
verify-metadata: true
133+
attestations: true
117134

118135
publish-oida:
119136
name: Publish sonicfield-oida to PyPI
@@ -134,7 +151,9 @@ jobs:
134151
path: release
135152

136153
- name: Publish sonicfield-oida
137-
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # release/v1
154+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
138155
with:
139156
packages-dir: release/oida
140157
skip-existing: true
158+
verify-metadata: true
159+
attestations: true

0 commit comments

Comments
 (0)