[pre-commit.ci] pre-commit autoupdate #967
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/cibuildwheel@v2.17 | |
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 }} |