diff --git a/.github/workflows/build.yaml b/.github/workflows/build-and-test.yaml similarity index 62% rename from .github/workflows/build.yaml rename to .github/workflows/build-and-test.yaml index 95bebbbb..7a8f2a7d 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build-and-test.yaml @@ -1,11 +1,22 @@ -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 @@ -13,37 +24,55 @@ jobs: - 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/cibuildwheel@v2.12.0 + - 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/gh-action-pypi-publish@v1.5.0 + 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 diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index f46a0181..00000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -1,39 +0,0 @@ -name: test -on: - pull_request: - branches: - - main - push: - branches: - - main - - bugfix/* - - feature/* -jobs: - bdist: - name: build bdist wheels and test - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-22.04, macos-11, 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 and test wheels - uses: pypa/cibuildwheel@v2.12.0 - - - uses: actions/upload-artifact@v3 - with: - path: ./wheelhouse/*.whl diff --git a/Makefile b/Makefile index 5ed30e75..0d62a6db 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/curl_cffi/__version__.py b/curl_cffi/__version__.py index c6987f65..3a889eeb 100644 --- a/curl_cffi/__version__.py +++ b/curl_cffi/__version__.py @@ -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() diff --git a/pyproject.toml b/pyproject.toml index 7b1a3d00..0893289f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "curl_cffi" -version = "0.6.0b8" +version = "0.6.0b9" authors = [{ name = "Yifei Kong", email = "kong@yifei.me" }] description = "libcurl ffi bindings for Python, with impersonation support" license = { file = "LICENSE" } diff --git a/setup.py b/setup.py index e2ce8e23..044602b0 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ from distutils.command.build import build -__version__ = "0.6.0b8" +__version__ = "0.6.0b9" class bdist_wheel_abi3(bdist_wheel): @@ -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