Skip to content

Dev

Dev #181

Workflow file for this run

name: Wheels & Tests & PyPi
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
workflow_call:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
os: macos-13
python: "3.10"
link: https://github.com/disintar/ton/releases/download/ton-cpython-310-x86_64-darwin/
file: python_ton.cpython-310-darwin.so
fix_tag: x86_64
- arch: x86_64
os: macos-13
python: "3.11"
link: https://github.com/disintar/ton/releases/download/ton-cpython-311-x86_64-darwin/
file: python_ton.cpython-311-darwin.so
fix_tag: x86_64
- arch: x86_64
os: macos-13
python: "3.12"
link: https://github.com/disintar/ton/releases/download/ton-cpython-312-x86_64-darwin/
file: python_ton.cpython-312-darwin.so
fix_tag: x86_64
- arch: x86_64
os: macos-13
python: "3.13"
link: https://github.com/disintar/ton/releases/download/ton-cpython-313-x86_64-darwin/
file: python_ton.cpython-313-darwin.so
fix_tag: x86_64
# Linux x86_64 (self-hosted ARC) new Pythons
- arch: x86_64
os: arc-runner-set
python: "3.12"
link: https://github.com/disintar/ton/releases/download/ton-cpython-312-x86_64-linux/
file: python_ton.cpython-312-x86_64-linux-gnu.so
fix_tag: manylinux2014_x86_64
- arch: x86_64
os: arc-runner-set
python: "3.13"
link: https://github.com/disintar/ton/releases/download/ton-cpython-313-x86_64-linux/
file: python_ton.cpython-313-x86_64-linux-gnu.so
fix_tag: manylinux2014_x86_64
# Legacy Linux x86_64
- arch: x86_64
os: arc-runner-set
python: "3.10"
link: https://github.com/disintar/ton/releases/download/ton-cpython-310-x86_64-linux/
file: python_ton.cpython-310-x86_64-linux-gnu.so
fix_tag: manylinux2014_x86_64
- arch: x86_64
os: arc-runner-set
python: "3.11"
link: https://github.com/disintar/ton/releases/download/ton-cpython-311-x86_64-linux/
file: python_ton.cpython-311-x86_64-linux-gnu.so
fix_tag: manylinux2014_x86_64
# macOS arm64
- arch: aarch64
os: macos-15
python: "3.10"
link: https://github.com/disintar/ton/releases/download/ton-cpython-310-aarch64-darwin/
file: python_ton.cpython-310-darwin.so
fix_tag: arm64
- arch: aarch64
os: macos-15
python: "3.11"
link: https://github.com/disintar/ton/releases/download/ton-cpython-311-aarch64-darwin/
file: python_ton.cpython-311-darwin.so
fix_tag: arm64
- arch: aarch64
os: macos-15
python: "3.12"
link: https://github.com/disintar/ton/releases/download/ton-cpython-312-aarch64-darwin/
file: python_ton.cpython-312-darwin.so
fix_tag: arm64
- arch: aarch64
os: macos-15
python: "3.13"
link: https://github.com/disintar/ton/releases/download/ton-cpython-313-aarch64-darwin/
file: python_ton.cpython-313-darwin.so
fix_tag: arm64
# Windows x64
- arch: x86_64
os: windows-2022
python: "3.10"
link: https://github.com/disintar/ton/releases/download/ton-cpython-310-x86_64-windows/
file: python_ton.cp310-win_amd64.pyd
fix_tag:
- arch: x86_64
os: windows-2022
python: "3.11"
link: https://github.com/disintar/ton/releases/download/ton-cpython-311-x86_64-windows/
file: python_ton.cp311-win_amd64.pyd
fix_tag:
- arch: x86_64
os: windows-2022
python: "3.12"
link: https://github.com/disintar/ton/releases/download/ton-cpython-312-x86_64-windows/
file: python_ton.cp312-win_amd64.pyd
fix_tag:
- arch: x86_64
os: windows-2022
python: "3.13"
link: https://github.com/disintar/ton/releases/download/ton-cpython-313-x86_64-windows/
file: python_ton.cp313-win_amd64.pyd
fix_tag:
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
env:
USER: tvorogme
- name: Install deps
run: |
python -m pip install -r built_requirements.txt
python -m pip install -r requirements.txt
- name: Install deps linux
run: |
sudo apt update
sudo apt install -y curl
if: matrix.os == 'arc-runner-set'
- name: Download prebuilt
run: |
curl -Lo ./src/tonpy/libs/${{ matrix.file }} ${{ matrix.link }}${{ matrix.file }}
- name: Win fix manifest
run: |
mv win/libcrypto-1_1-x64.dll ./src/tonpy/libs/
mv MANIFEST.in MANIFEST_LINUX.in
mv MANIFEST_WIN.in MANIFEST.in
if: matrix.os == 'windows-2022'
- name: Run tests
run: |
pytest
- name: Build wheel
run: |
python -m build --wheel --outdir dist/ .
python fix_whl_name.py
env:
TAG_FIX: ${{ matrix.fix_tag }}
- name: Store the binary wheel
uses: actions/upload-artifact@v4
with:
name: python-package-distributions-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.python }}
path: dist
# buildVirtualLinux:
# strategy:
# matrix:
# include:
# - arch: aarch64
# os: Linux
# python: "3.9"
# link: https://github.com/disintar/ton/releases/download/ton-cpython-39-aarch64-linux/
# file: python_ton.cpython-39-aarch64-linux-gnu.so
# fix_tag: manylinux2014_aarch64
# docker_python_tag: 3.9.17-bookworm
#
# - arch: aarch64
# os: Linux
# python: "3.10"
# link: https://github.com/disintar/ton/releases/download/ton-cpython-310-aarch64-linux/
# file: python_ton.cpython-310-aarch64-linux-gnu.so
# fix_tag: manylinux2014_aarch64
# docker_python_tag: 3.10.12-bookworm
#
# - arch: aarch64
# os: Linux
# python: "3.11"
# link: https://github.com/disintar/ton/releases/download/ton-cpython-311-aarch64-linux/
# file: python_ton.cpython-311-aarch64-linux-gnu.so
# fix_tag: manylinux2014_aarch64
# docker_python_tag: 3.11.4-bookworm
#
# runs-on: ${{ matrix.os }}
# needs:
# - build
#
# steps:
# - uses: actions/checkout@v4
#
# - name: Save download prebuilt
# run: |
# curl -Lo ${PWD}/src/tonpy/libs/${{ matrix.file }} ${{ matrix.link }}${{ matrix.file }}
#
# - name: Run tests in virtual
# run: |
# docker run --network host --platform linux/aarch64 -e TAG_FIX=${{ matrix.fix_tag }} --rm --volume "${PWD}:/tmp/tonpy" -t arm64v8/python:${{ matrix.docker_python_tag }} /tmp/tonpy/run_test_in_docker.sh
# if: (matrix.os == 'Linux' && matrix.arch == 'aarch64')
#
# - name: Show wheel
# run: |
# ls -lhta ./dist
#
# - name: Store the binary wheel
# uses: actions/upload-artifact@v4
# with:
# name: python-package-distributions
# path: dist
deploy:
name: Publish 🐍📦 to PyPI
runs-on: arc-runner-set
needs:
# - buildVirtualLinux
- build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
with:
python-version: "3.11"
env:
USER: tvorogme
- name: Merge artifacts
uses: actions/upload-artifact/merge@v4
if: always()
with:
name: python-package-distributions-${{ github.run_id }}
pattern: python-package-distributions-${{ github.run_id }}-*
delete-merged: true
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions-${{ github.run_id }}
path: dist/
- name: Install deps
run: python -m pip install setuptools==68.0.0 build==0.10.0 twine
- name: Publish distribution 📦 to PyPi
run: |
twine upload dist/*
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_MAIN_API_TOKEN }}