|
1 | | -name: CI |
| 1 | +name: main |
2 | 2 |
|
3 | 3 | on: [push, pull_request, workflow_dispatch] |
4 | 4 |
|
5 | 5 | jobs: |
6 | 6 | build: |
7 | 7 | name: Build on ${{ matrix.os }} |
8 | 8 | runs-on: ${{ matrix.os }} |
| 9 | + permissions: |
| 10 | + contents: read |
9 | 11 | strategy: |
10 | 12 | fail-fast: false |
11 | 13 | matrix: |
12 | 14 | os: [ubuntu-20.04, macos-10.15, windows-2019] |
13 | 15 | version: [2.16.11] |
14 | | - |
15 | 16 | steps: |
16 | 17 | - uses: actions/checkout@v2 |
17 | | - |
18 | 18 | - uses: actions/setup-python@v2 |
19 | | - |
| 19 | + - name: Create source dist |
| 20 | + run: python setup.py sdist |
| 21 | + - name: Upload source dist |
| 22 | + uses: actions/upload-artifact@v2 |
| 23 | + with: |
| 24 | + name: dist |
| 25 | + path: dist |
| 26 | + if-no-files-found: error |
20 | 27 | - name: Install cibuildwheel |
21 | 28 | run: python -m pip install cibuildwheel==1.10.0 |
22 | | - |
23 | 29 | - name: Build and test wheels |
24 | 30 | run: python -m cibuildwheel --output-dir wheelhouse |
25 | 31 | env: |
|
45 | 51 | && dir %LIB% |
46 | 52 | CIBW_TEST_REQUIRES: -rrequirements/tests.txt |
47 | 53 | CIBW_TEST_COMMAND: pytest {project}/tests |
48 | | - |
49 | 54 | - name: Inventory |
50 | 55 | run: ls wheelhouse |
| 56 | + - name: Upload wheels |
| 57 | + uses: actions/upload-artifact@v2 |
| 58 | + with: |
| 59 | + name: wheels |
| 60 | + path: wheelhouse/ |
| 61 | + if-no-files-found: error |
| 62 | + |
| 63 | + publish: |
| 64 | + name: Publish packages |
| 65 | + runs-on: ubuntu-latest |
| 66 | + permissions: |
| 67 | + contents: read |
| 68 | + needs: build |
| 69 | + if: > |
| 70 | + github.event_name == 'push' |
| 71 | + && startsWith(github.ref, 'refs/tags') |
| 72 | + && github.repository == 'Synss/python-mbedtls' |
| 73 | + steps: |
| 74 | + - name: Download source packages |
| 75 | + uses: actions/download-artifact@v2 |
| 76 | + with: |
| 77 | + name: dist |
| 78 | + path: dist |
| 79 | + - name: Download wheels |
| 80 | + uses: actions/download-artifact@v2 |
| 81 | + with: |
| 82 | + name: wheels |
| 83 | + path: dist |
| 84 | + - name: List dir content |
| 85 | + run: ls dist |
| 86 | + - name: Publish to pypi |
| 87 | + uses: pypa/gh-action-pypi-publish@release/v1 |
| 88 | + with: |
| 89 | + user: __token__ |
| 90 | + password: ${{ secrets.PYPI_PASSWORD }} |
0 commit comments