-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (65 loc) · 2.07 KB
/
build-and-publish-wheels.yml
File metadata and controls
77 lines (65 loc) · 2.07 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
name: Build and publish platform wheels
on:
push:
tags:
- "v*"
jobs:
build-and-publish:
name: Build wheel for ${{ matrix.folder }}
runs-on: windows-latest
strategy:
matrix:
include:
- folder: win-x86
plat_tag: win32
- folder: win-x64
plat_tag: win_amd64
- folder: win-arm64
plat_tag: win_arm64
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Prepare scripts directory
shell: cmd
run: |
echo Verificando archivo .bat...
if not exist "scripts\initvenv.bat" (
echo Error: No se encontró scripts\initvenv.bat
exit 1
)
echo Copiando .exe de src\bin\${{ matrix.folder }}
if exist "src\bin\${{ matrix.folder }}\initvenv.exe" (
copy "src\bin\${{ matrix.folder }}\initvenv.exe" "scripts\initvenv.exe"
) else (
echo Error: no se encontró src\bin\${{ matrix.folder }}\initvenv.exe
exit 1
)
- name: Install build tools
run: |
python -m pip install --upgrade pip
python -m pip install build twine wheel setuptools
- name: Build wheel
run: python -m build --wheel
- name: Rename wheel to platform tag
shell: pwsh
run: |
$wheel = Get-ChildItem dist\*.whl | Select-Object -First 1
$newName = $wheel.Name -replace "py3-none-any", "py3-none-${{ matrix.plat_tag }}"
Rename-Item $wheel.FullName "dist\$newName"
- name: Publish wheel to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: python -m twine upload dist/*.whl
- name: Upload artifact (wheel)
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.plat_tag }}
path: dist/*.whl
permissions:
contents: read
packages: write