Skip to content

Commit

Permalink
Add macOS m1 build
Browse files Browse the repository at this point in the history
  • Loading branch information
perklet committed Jan 31, 2024
1 parent 792b725 commit 3f7e032
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 56 deletions.
Original file line number Diff line number Diff line change
@@ -1,49 +1,78 @@
name: build
name: Build, test and release
on:
pull_request:
branches:
- main
push:
branches:
- main
- bugfix/*
- feature/*
tags:
- v*

permissions:
contents: write

jobs:
sdist:
name: build sdist wheel
name: Build sdist wheel
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: pipx run build --sdist
- uses: actions/upload-artifact@v3
with:
path: ./dist/*.tar.gz

bdist:
name: build bdist wheels
name: Build bdist wheels and test
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04, macos-11, windows-2019]
os: [ubuntu-22.04, macos-12, macos-14, windows-2019]
steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: '3.10'

- if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v2
with:
platforms: all

# macOS make is too old
- if: runner.os == 'macOS'
run: brew install make
- name: Build

- name: Build and test wheels
uses: pypa/[email protected]

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl

upload_all:
needs: [bdist, sdist]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
if: startsWith(github.ref, 'refs/tags/')
with:
name: artifact
path: dist

- uses: pypa/[email protected]
if: startsWith(github.ref, 'refs/tags/')
with:
password: ${{ secrets.PYPI_TOKEN }}

- name: Upload release files
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
files: |
./dist/*.whl
./dist/*.tar.gz
39 changes: 0 additions & 39 deletions .github/workflows/test.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.ONESHELL:
SHELL := bash
VERSION := 0.6.0b8
VERSION := 0.6.0b9
CURL_VERSION := curl-8.1.1

.preprocessed: curl_cffi/include/curl/curl.h
Expand Down
2 changes: 1 addition & 1 deletion curl_cffi/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
# __description__ = metadata.metadata("curl_cffi")["Summary"]
# __version__ = metadata.version("curl_cffi")
__description__ = "libcurl ffi bindings for Python, with impersonation support"
__version__ = "0.6.0b8"
__version__ = "0.6.0b9"
__curl_version__ = Curl().version().decode()
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "curl_cffi"
version = "0.6.0b8"
version = "0.6.0b9"
authors = [{ name = "Yifei Kong", email = "[email protected]" }]
description = "libcurl ffi bindings for Python, with impersonation support"
license = { file = "LICENSE" }
Expand Down
11 changes: 2 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from distutils.command.build import build


__version__ = "0.6.0b8"
__version__ = "0.6.0b9"


class bdist_wheel_abi3(bdist_wheel):
Expand Down Expand Up @@ -41,19 +41,12 @@ def download_so():
elif uname.system == "Darwin":
sysname = "macos"
libdir = "/Users/runner/work/_temp/install/lib"
if machine == "x86_64":
so_name = "libcurl-impersonate-chrome.4.dylib"
else:
so_name = "SKIP"
so_name = "libcurl-impersonate-chrome.4.dylib"
else:
sysname = "linux-gnu"
libdir = "/usr/local/lib"
so_name = "libcurl-impersonate-chrome.so"

if so_name == "SKIP":
print(".so file for platform is not available on github.")
return

if (Path(libdir) / so_name).exists():
print(".so files alreay downloaded.")
return
Expand Down

0 comments on commit 3f7e032

Please sign in to comment.