2023-11-16 17:12:33 +01:00
|
|
|
name: build wheels
|
|
|
|
|
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [released]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build_wheels:
|
2023-12-04 22:50:09 +01:00
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
working-directory: sdk/python/sdk/zrok
|
2023-11-16 17:12:33 +01:00
|
|
|
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-11, 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@v3
|
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
|
|
|
|
|
|
|
- name: Setup Python
|
|
|
|
uses: actions/setup-python@v3
|
|
|
|
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 }}
|
2023-12-15 00:03:58 +01:00
|
|
|
ZROK_PY_NAME: ${{ vars.ZROK_PY_NAME || null }}
|
2023-11-16 17:12:33 +01:00
|
|
|
run: |
|
|
|
|
python setup.py sdist
|
|
|
|
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
if: startsWith(matrix.spec.name, 'linux')
|
|
|
|
with:
|
2023-12-04 22:50:09 +01:00
|
|
|
name: zrok_sdk
|
|
|
|
path: ${{ github.workspace }}/sdk/python/sdk/zrok/dist/*
|
2023-11-16 17:12:33 +01:00
|
|
|
|
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
needs: [ build_wheels ]
|
2023-12-04 22:50:09 +01:00
|
|
|
permissions:
|
|
|
|
id-token: write
|
2023-11-16 17:12:33 +01:00
|
|
|
steps:
|
|
|
|
- name: Download artifacts
|
|
|
|
uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
path: download
|
|
|
|
|
|
|
|
- name: check
|
|
|
|
run: |
|
|
|
|
ls -lR download
|
|
|
|
mkdir dist
|
|
|
|
cp download/*/* dist
|
|
|
|
|
|
|
|
- name: Publish wheels (TestPYPI)
|
|
|
|
uses: pypa/gh-action-pypi-publish@release/v1
|
|
|
|
with:
|
2023-12-04 22:50:09 +01:00
|
|
|
repository-url: https://test.pypi.org/legacy/
|
2023-11-16 17:12:33 +01:00
|
|
|
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
|