-
Notifications
You must be signed in to change notification settings - Fork 28
97 lines (93 loc) · 2.84 KB
/
main.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
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
91
92
93
94
95
96
97
name: main
on: [push, pull_request, workflow_dispatch]
jobs:
sdist:
name: Make source dist
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Create source dist
run: python setup.py sdist
- name: Upload source dist
uses: actions/upload-artifact@v4
with:
name: sdist
path: dist
if-no-files-found: error
wheels:
name: ${{ matrix.pyver }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
pyver: [cp38, cp39, cp310, cp311, cp312]
version: [2.28.8]
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Build and test wheel
uses: pypa/[email protected]
env:
CIBW_BUILD: ${{ matrix.pyver }}-*
CIBW_ENVIRONMENT: VERSION=${{ matrix.version }}
CIBW_ENVIRONMENT_MACOS: >
VERSION=${{ matrix.version }}
LDFLAGS="-Wl,-headerpad_max_install_names"
UPSTREAM_DEST="$GITHUB_WORKSPACE/.local/upstream"
C_INCLUDE_PATH="$UPSTREAM_DEST/include"
LIBRARY_PATH="$UPSTREAM_DEST/lib"
DYLD_LIBRARY_PATH="$UPSTREAM_DEST/lib"
CIBW_ENVIRONMENT_WINDOWS: >
VERSION=${{ matrix.version }}
LIB=$GITHUB_WORKSPACE\\_lib\\mbedtls\\visualc\\VS2010\\x64\\Release
INCLUDE=$GITHUB_WORKSPACE\\_lib\\mbedtls\\include
CIBW_TEST_SKIP: "cp38-macosx_arm64"
- name: Inventory
run: ls wheelhouse
- name: Upload wheel
uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.version }}-${{ matrix.pyver }}-${{ matrix.os }}
path: wheelhouse/
if-no-files-found: error
publish:
name: Publish packages
runs-on: ubuntu-latest
permissions:
contents: read
needs: [sdist, wheels]
if: >
github.event_name == 'push'
&& startsWith(github.ref, 'refs/tags')
&& github.repository == 'Synss/python-mbedtls'
steps:
- name: Download source packages
uses: actions/download-artifact@v4
with:
name: sdist
path: dist
- name: Download wheels
uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: dist
merge-multiple: true
- 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 }}