-
Notifications
You must be signed in to change notification settings - Fork 2
58 lines (50 loc) · 1.57 KB
/
publish-pypi.yml
File metadata and controls
58 lines (50 loc) · 1.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Publish to PyPI (Trusted Publisher)
# RECOMMENDED: Uses OpenID Connect (OIDC) - No API tokens needed!
# Setup: https://docs.pypi.org/trusted-publishers/adding-a-publisher/
#
# Steps to enable:
# 1. Go to https://pypi.org/manage/account/publishing/
# 2. Add GitHub as a trusted publisher
# 3. Fill in: ilayn/SLICUTLET, workflow: publish-pypi.yml, environment: pypi
on:
workflow_dispatch: # Manual trigger only
inputs:
run_id:
description: 'Build Wheels workflow run ID (from Actions tab)'
required: true
type: string
permissions:
contents: read
id-token: write # REQUIRED for trusted publishing
jobs:
publish-pypi:
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/project/slicutlet/
steps:
- name: Download artifacts from build workflow
uses: actions/download-artifact@v4
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ inputs.run_id }}
pattern: wheels-*
merge-multiple: true
path: dist
- name: List downloaded wheels
run: ls -lah dist/
- name: Verify wheel contents
run: |
pip install wheel
for wheel in dist/*.whl; do
echo "=== Checking $wheel ==="
python -m wheel unpack "$wheel" -d temp_check
ls -R temp_check/
rm -rf temp_check
done
- name: Publish to PyPI (Trusted Publisher)
uses: pypa/gh-action-pypi-publish@release/v1
# No password/token needed with trusted publishing!
with:
print-hash: true
verbose: true