Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit eece8eb

Browse files
committed
Fix signing with sigstore
PyPI does not accept sigstore signatures. Attach them to GH release instead. Signed-off-by: Christian Heimes <[email protected]>
1 parent 63ac34e commit eece8eb

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

.github/workflows/pypi.yaml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ on:
1313
release:
1414
types:
1515
- published
16-
workflow_dispatch:
1716

1817
permissions:
1918
contents: read
@@ -39,7 +38,6 @@ jobs:
3938
if: |
4039
github.repository_owner == 'tiran' && (
4140
github.event.action == 'published' ||
42-
github.event_name == 'workflow_dispatch' ||
4341
(github.event_name == 'push' && github.ref == 'refs/heads/main')
4442
)
4543
runs-on: ubuntu-latest
@@ -62,10 +60,7 @@ jobs:
6260
# environment: publish-pypi
6361
# TODO: move to instructlab
6462
if: |
65-
github.repository_owner == 'tiran' && (
66-
github.event.action == 'published' ||
67-
github.event_name == 'workflow_dispatch'
68-
)
63+
github.repository_owner == 'tiran' && github.event.action == 'published'
6964
runs-on: ubuntu-latest
7065
needs: build-package
7166

@@ -78,10 +73,21 @@ jobs:
7873

7974
- uses: sigstore/[email protected]
8075
with:
81-
upload-signing-artifact: true
76+
upload-signing-artifacts: true
8277
inputs: >-
8378
./dist/*.tar.gz
8479
./dist/*.whl
8580
81+
- name: Upload artifact signatures to GitHub Release
82+
env:
83+
GITHUB_TOKEN: ${{ github.token }}
84+
run: >-
85+
gh release upload '${{ github.ref_name }}' dist/* --repo '${{ github.repository }}'
86+
87+
# PyPI does not accept .sigstore artifacts and
88+
# gh-action-pypi-publish has no option to ignore them.
89+
- name: Remove sigstore signatures before uploading to PyPI
90+
run: rm ./dist/*.sigstore
91+
8692
- name: Upload to PyPI
8793
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)