Skip to content

Commit

Permalink
use ci build wheel for packages
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKueltz committed Dec 31, 2024
1 parent 4a90d9a commit 8ac6637
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 52 deletions.
101 changes: 50 additions & 51 deletions .github/workflows/publish-to-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,63 @@ name: Publish Python 🐍 distribution 📦 to TestPyPI

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+' # only run on alpha tags
# tags:
# - 'v[0-9]+.[0-9]+.[0-9]+a[0-9]+' # only run on alpha tags

jobs:
build:
name: Build distribution 📦
runs-on: macos-latest
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, macos-14]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Build wheels
uses: pypa/[email protected]
env:
CIBW_BEFORE_ALL_LINUX: >
yum update &&
yum install -y gmp-devel
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* cp313-*
CIBW_SKIP: cp3*-musllinux_*
CIBW_ENVIRONMENT_LINUX: CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"
CIBW_ENVIRONMENT_MACOS: CFLAGS="-I/opt/homebrew/include" LDFLAGS="-L/opt/homebrew/lib"
MACOSX_DEPLOYMENT_TARGET: 14.0
# with:
# package-dir: fastecdsa
# output-dir: wheelhouse
# config-file: pyproject.toml

- name: Install uv
uses: astral-sh/setup-uv@v4
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

- name: Build
env:
CFLAGS: -I/opt/homebrew/include
LDFLAGS: -L/opt/homebrew/lib
run: |
uv build --sdist
uv build --wheel -p 3.9
uv build --wheel -p 3.10
uv build --wheel -p 3.11
uv build --wheel -p 3.12
uv build --wheel -p 3.13
# publish-to-testpypi:
# name: Publish Python 🐍 distribution 📦 to TestPyPI
# needs:
# - build
# runs-on: ubuntu-latest

- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
# environment:
# name: testpypi
# url: https://test.pypi.org/p/fastecdsa

publish-to-testpypi:
name: Publish Python 🐍 distribution 📦 to TestPyPI
needs:
- build
runs-on: ubuntu-latest
# permissions:
# id-token: write # IMPORTANT: mandatory for trusted publishing

environment:
name: testpypi
url: https://test.pypi.org/p/fastecdsa

permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish distribution 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
repository-url: https://test.pypi.org/legacy/
# steps:
# - name: Download all the dists
# uses: actions/download-artifact@v4
# with:
# name: python-package-distributions
# path: dist/
# - name: Publish distribution 📦 to TestPyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# verbose: true
# repository-url: https://test.pypi.org/legacy/
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
# The short X.Y version.
version: str = "3.0"
# The full version, including alpha/beta/rc tags.
release: str = "3.0.0a0"
release: str = "3.0.0a1"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down

0 comments on commit 8ac6637

Please sign in to comment.