forked from Synss/python-mbedtls
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (87 loc) · 3.01 KB
/
main.yml
File metadata and controls
90 lines (87 loc) · 3.01 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: main
on: [push, pull_request, workflow_dispatch]
jobs:
build:
name: Build on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-10.15, windows-2019]
version: [2.16.11]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Create source dist
run: python setup.py sdist
- name: Upload source dist
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
if-no-files-found: error
- name: Install cibuildwheel
run: python -m pip install cibuildwheel==1.10.0
- name: Build and test wheels
run: python -m cibuildwheel --output-dir wheelhouse
env:
CIBW_BUILD: cp3{6,7,8,9}-*
CIBW_SKIP: "*-win32 *-manylinux_i686"
CIBW_ENVIRONMENT: VERSION=${{ matrix.version }}
CIBW_BEFORE_ALL_LINUX: >
./scripts/download-mbedtls.sh $VERSION ~/.local/src
&& ./scripts/install-mbedtls.sh ~/.local/src
CIBW_BEFORE_ALL_MACOS: >
./scripts/download-mbedtls.sh $VERSION ~/.local/src
&& ./scripts/install-mbedtls.sh ~/.local/src
&& cp /usr/local/lib/libmbed*dylib .
CIBW_ENVIRONMENT_WINDOWS: >
VERSION=${{ matrix.version }}
LIB=$HOMEDRIVE$HOMEPATH\\mbedtls\\visualc\\VS2010\\x64\\Release
INCLUDE=$HOMEDRIVE$HOMEPATH\\mbedtls\\include
CIBW_BEFORE_ALL_WINDOWS: >
powershell -Command Get-Host
&& powershell %CD%\scripts\download-mbedtls.ps1 %VERSION% %HOMEDRIVE%%HOMEPATH%\mbedtls
&& powershell %CD%\scripts\install-mbedtls.ps1 -ConfigurationType StaticLibrary %HOMEDRIVE%%HOMEPATH%\mbedtls
&& powershell %CD%\scripts\install-mbedtls.ps1 -ConfigurationType DynamicLibrary %HOMEDRIVE%%HOMEPATH%\mbedtls
&& dir %LIB%
CIBW_TEST_REQUIRES: -rrequirements/tests.txt
CIBW_TEST_COMMAND: pytest {project}/tests
- name: Inventory
run: ls wheelhouse
- name: Upload wheels
uses: actions/upload-artifact@v2
with:
name: wheels
path: wheelhouse/
if-no-files-found: error
publish:
name: Publish packages
runs-on: ubuntu-latest
permissions:
contents: read
needs: build
if: >
github.event_name == 'push'
&& startsWith(github.ref, 'refs/tags')
&& github.repository == 'Synss/python-mbedtls'
steps:
- name: Download source packages
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Download wheels
uses: actions/download-artifact@v2
with:
name: wheels
path: dist
- name: List dir content
run: ls dist
- name: Publish to pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}