Skip to content

Merge branch 'main' of https://github.com/Dev2Forge/initvenv into add… #2

Merge branch 'main' of https://github.com/Dev2Forge/initvenv into add…

Merge branch 'main' of https://github.com/Dev2Forge/initvenv into add… #2

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