Repository navigation
86 lines (76 loc) · 2.84 KB
/
Copy pathupload-python-wheels.yml
File metadata and controls
86 lines (76 loc) · 2.84 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: upload-python-wheels
on:
workflow_call:
inputs:
supported_python_versions:
description: 'JSON array of supported Python versions'
required: true
type: string
enabled_arches:
description: >-
JSON array of platform arch slugs to test before upload.
Omit or use the default to test all platforms.
required: false
type: string
default: '["windows-x86_64","linux-x86_64","macos-x86_64","macos-arm64","linux-arm64","linux-armv7","linux-armv7legacy"]'
idf_requirements_bundle:
description: >-
When true, download the idf-requirements-bundle artifact and publish
sdists for index fallback packages. Set false for defined-wheels ad-hoc builds.
required: false
type: boolean
default: true
jobs:
test-wheels:
name: Test wheels installation
uses: ./.github/workflows/test-wheels-install.yml
with:
supported_python_versions: ${{ inputs.supported_python_versions }}
enabled_arches: ${{ inputs.enabled_arches }}
triage:
name: Upload Python wheels
needs: [test-wheels]
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_BUCKET: ${{ secrets.DL_BUCKET }}
PREFIX: 'pypi'
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Install dependencies
run: python -m pip install -r build_requirements.txt
- name: Download tested wheels
uses: actions/download-artifact@v8
with:
pattern: wheels-tested-*
path: ./downloaded_wheels
merge-multiple: true
- name: Download IDF requirements bundle
if: inputs.idf_requirements_bundle
uses: actions/download-artifact@v8
with:
name: idf-requirements-bundle
path: .
- name: Install OS dependencies for sdist download
if: inputs.idf_requirements_bundle
run: os_dependencies/ubuntu.sh
- name: Download sdists for index fallback packages
if: inputs.idf_requirements_bundle
run: |
if [ -f sdist_requirements.txt ] && [ -s sdist_requirements.txt ]; then
python download_sdists.py sdist_requirements.txt
else
echo "No sdist_requirements.txt in bundle; skipping sdist download."
fi
- name: Upload release asset to S3 bucket
run: |
python upload_wheels.py $AWS_BUCKET
python create_index_pages.py $AWS_BUCKET
- name: Drop AWS cache
id: invalidate-index-cache
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CACHE_INVALIDATION }} --paths "/pypi/*"