zrok/.github/workflows/build-wheels.yml
2024-06-26 17:57:03 -04:00

79 lines
2.1 KiB
YAML

name: build wheels
on:
release:
types: [released]
jobs:
build_wheels:
defaults:
run:
working-directory: sdk/python/sdk/zrok
strategy:
fail-fast: false
matrix:
spec:
- { name: 'linux x86_64', runner: ubuntu-20.04, target: manylinux_2_27_x86_64 }
- { name: 'macOS x86_64', runner: macos-12, target: macosx_10_14_x86_64 }
- { name: 'Windows x86_64', runner: windows-2019, target: win_amd64 }
name: building ${{ matrix.spec.name }}
runs-on: ${{ matrix.spec.runner }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install Python Tools
run: python -m pip install -U pip setuptools
- name: Build distro
env:
ZROK_VERSION: ${{ github.event.release.tag_name }}
ZROK_PY_NAME: ${{ vars.ZROK_PY_NAME || null }}
run: |
python setup.py sdist
- uses: actions/upload-artifact@v4
if: startsWith(matrix.spec.name, 'linux')
with:
name: zrok_sdk_${{ matrix.spec.target }}
path: ${{ github.workspace }}/sdk/python/sdk/zrok/dist/*
publish:
runs-on: ubuntu-20.04
needs: [ build_wheels ]
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./download
merge-multiple: true
pattern: zrok_sdk_*
- name: check
run: |
ls -lR ./download/
mkdir dist
cp ./download/* ./dist/
- name: Publish wheels (TestPYPI)
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages_dir: dist
skip_existing: true
verbose: true
- name: Publish wheels (PyPI)
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages_dir: dist
verbose: true