Skip to content

Commit b9f988d

Browse files
committed
test(hansbug): split build all the wheels
1 parent 6946d8d commit b9f988d

File tree

5 files changed

+98
-17
lines changed

5 files changed

+98
-17
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,16 @@ on:
55
types: [ published ]
66

77
jobs:
8-
release:
9-
name: Publish to official pypi
8+
source_release:
9+
name: Publish source package to official pypi
1010
runs-on: ${{ matrix.os }}
1111
if: ${{ github.repository == 'opendilab/treevalue' }}
1212
strategy:
1313
matrix:
1414
os:
1515
- 'ubuntu-18.04'
1616
python-version:
17-
- '3.6'
18-
- '3.7'
1917
- '3.8'
20-
- '3.9'
21-
- '3.10'
2218

2319
steps:
2420
- name: Checkout code
@@ -39,10 +35,17 @@ jobs:
3935
pip install --upgrade build
4036
- name: Build packages
4137
run: |
42-
make package
38+
make zip
4339
- name: Publish distribution 📦 to real PyPI
4440
uses: pypa/gh-action-pypi-publish@master
4541
with:
4642
password: ${{ secrets.PYPI_PASSWORD }}
47-
skip_existing: true
48-
verbose: true
43+
verbose: true
44+
- name: Upload distribution 📦 to github release
45+
uses: svenstaro/upload-release-action@v2
46+
with:
47+
repo_token: ${{ secrets.GITHUB_TOKEN }}
48+
file: dist/*
49+
tag: ${{ github.ref }}
50+
overwrite: true
51+
file_glob: true

.github/workflows/release_test.yml

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,46 @@ name: Release Test
33
on: workflow_dispatch
44

55
jobs:
6-
release_test:
7-
name: Try build the release
6+
source_release:
7+
name: Try package the source
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os:
13+
- 'ubuntu-18.04'
14+
python-version:
15+
- '3.8'
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 20
22+
- name: Set up python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Set up python dependences
27+
run: |
28+
pip install --upgrade pip
29+
pip install --upgrade flake8 setuptools wheel twine
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
if [ -f requirements-build.txt ]; then pip install -r requirements-build.txt; fi
32+
if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi
33+
pip install --upgrade build
34+
- name: Build packages
35+
run: |
36+
make zip
37+
ls -al dist
38+
- name: Upload packed files to artifacts
39+
uses: actions/upload-artifact@v2
40+
with:
41+
name: build-artifacts-source-pack
42+
path: ./dist/*
43+
44+
wheel_release:
45+
name: Try build the wheels
846
runs-on: ${{ matrix.os }}
947
strategy:
1048
fail-fast: false
@@ -13,6 +51,41 @@ jobs:
1351
- 'ubuntu-18.04'
1452
# - 'windows-2019'
1553
- 'macos-10.15'
54+
python:
55+
- '3.6'
56+
- '3.7'
57+
- '3.8'
58+
- '3.9'
59+
- '3.10'
60+
architecture:
61+
- x86_64
62+
- arm64
63+
- aarch64
64+
- x86
65+
- AMD64
66+
exclude:
67+
- os: ubuntu-18.04
68+
architecture: arm64
69+
- os: ubuntu-18.04
70+
architecture: x86
71+
- os: ubuntu-18.04
72+
architecture: AMD64
73+
- os: windows-2019
74+
architecture: x86_64
75+
- os: windows-2019
76+
architecture: arm64
77+
- os: windows-2019
78+
architecture: aarch64
79+
- os: macos-10.15
80+
architecture: aarch64
81+
- os: macos-10.15
82+
architecture: x86
83+
- os: macos-10.15
84+
architecture: AMD64
85+
- python: '3.6'
86+
architecture: arm64
87+
- python: '3.7'
88+
architecture: arm64
1689

1790
steps:
1891
- name: Checkout code
@@ -27,6 +100,10 @@ jobs:
27100
platforms: all
28101
- name: Build wheels
29102
uses: pypa/[email protected]
103+
env:
104+
CIBW_SKIP: "pp* *musllinux*"
105+
CIBW_ARCHS: ${{ matrix.architecture }}
106+
CIBW_PROJECT_REQUIRES_PYTHON: ~=${{ matrix.python }}.0
30107

31108
- name: Show the buildings
32109
shell: bash
@@ -35,5 +112,5 @@ jobs:
35112
- name: Upload packed files to artifacts
36113
uses: actions/upload-artifact@v2
37114
with:
38-
name: build-artifacts-${{ matrix.os }}
115+
name: build-artifacts-${{ runner.os }}-cp${{ matrix.python }}-${{ matrix.architecture }}
39116
path: ./wheelhouse/*

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: docs test unittest build clean benchmark
1+
.PHONY: docs test unittest build clean benchmark zip
22

33
PYTHON := $(shell which python)
44

@@ -24,6 +24,9 @@ build:
2424
$(PYTHON) setup.py build_ext --inplace \
2525
$(if ${LINETRACE},--define CYTHON_TRACE,)
2626

27+
zip:
28+
$(PYTHON) -m build --sdist --outdir ${DIST_DIR}
29+
2730
package:
2831
$(PYTHON) -m build --sdist --wheel --outdir ${DIST_DIR}
2932
for whl in `ls ${DIST_DIR}/*.whl`; do \

pyproject.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[project]
2-
requires-python = ">=3.6"
3-
41
[build-system]
52
requires = [
63
"setuptools>=42",

requirements-build.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
cython>=0.29
22
build>=0.7.0
3-
auditwheel>=4
3+
auditwheel>=4
4+
cibuildwheel

0 commit comments

Comments
 (0)