-
Notifications
You must be signed in to change notification settings - Fork 47
64 lines (52 loc) · 1.63 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Deploy sdist/wheels
on: [push, pull_request]
jobs:
deploy:
runs-on: macos-latest
env:
CIBW_BUILD_VERBOSITY: 3
CIBW_BUILD: "cp37-macosx_x86_64 cp38-macosx_universal2 cp39-macosx_universal2 cp310-macosx_universal2 cp311-macosx_universal2"
CIBW_ARCHS_MACOS: "x86_64 universal2"
CIBW_TEST_COMMAND: python -c "from pyobjus import autoclass, objc_str"
CIBW_TEST_SKIP: "*arm64*"
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: python -m pip install --upgrade twine cibuildwheel cython
- name: Build sdist
run: |
python setup.py sdist --formats=gztar
- name: Build wheels
run: |
python -m cibuildwheel --output-dir dist
- name: Create artifacts
uses: actions/upload-artifact@v1
with:
name: wheels
path: dist
- name: Upload to GitHub Releases
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: dist/*
- name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags/')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
- name: Test sdist
run: |
pip uninstall cython -y
root="$(pwd)"
cd ~
pyobjus_fname=$(ls $root/dist/pyobjus-*.tar.gz)
pip install "$pyobjus_fname"
python -c "from pyobjus import autoclass, objc_str"