Bump actions/upload-artifact from 3 to 4 #356
Workflow file for this run
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: Tests and build wheels | |
on: [push, pull_request] | |
jobs: | |
ci: | |
name: Tests ${{ matrix.os }} ${{ matrix.python-architecture }} - Python ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13-dev" ] | |
python-architecture: [ "x64" ] | |
include: | |
- os: windows-latest | |
python-architecture: "x86" | |
python-version: "3.8" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: ${{ matrix.python-version }} | |
architecture: ${{ matrix.python-architecture }} | |
- name: Build module and run pytest | |
run: | | |
pip install wheel setuptools | |
pip install -r tests/requirements.txt | |
pip install . -v | |
python -c "import sabctools; print('Version:', sabctools.__version__);" | |
python -c "import sabctools; print('SIMD:', sabctools.simd);" | |
python -c "import sabctools; print('OpenSSL linked:', sabctools.openssl_linked);" | |
pytest | |
build_wheels: | |
name: Build wheels on ${{ matrix.os }} ${{ matrix.linux_arch }} | |
needs: ci | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- os: windows-latest | |
- os: macos-latest | |
- os: ubuntu-latest | |
linux_arch: x86_64 | |
- os: ubuntu-latest | |
linux_arch: aarch64 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
name: Install Python | |
with: | |
python-version: '3.11' | |
- name: Set up QEMU | |
if: runner.os == 'Linux' && matrix.linux_arch == 'aarch64' | |
uses: docker/setup-qemu-action@v3 | |
with: | |
platforms: all | |
- name: Build source distribution | |
run: python setup.py sdist | |
- name: Build wheels | |
uses: pypa/[email protected] | |
env: | |
CIBW_SKIP: pp* *i686* cp36* cp37* | |
CIBW_ARCHS_LINUX: ${{ matrix.linux_arch }} | |
CIBW_ARCHS_MACOS: universal2 | |
CIBW_BUILD_VERBOSITY: 1 | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: | | |
./wheelhouse/*.whl | |
./dist/*.tar.gz | |
- name: Publish to PyPI | |
env: | |
TWINE_USERNAME: '__token__' | |
TWINE_PASSWORD: ${{ secrets.PYPI_API_KEY }} | |
if: env.TWINE_PASSWORD && startsWith(github.ref, 'refs/tags/') | |
run: | | |
pip install twine | |
twine upload --skip-existing ./dist/*.tar.gz ./wheelhouse/*.whl | |
- name: Publish release to GitHub | |
uses: "marvinpinto/[email protected]" | |
if: startsWith(github.ref, 'refs/tags/') && runner.os == 'Linux' && matrix.linux_arch == 'aarch64' | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: false | |
files: ./dist/*.tar.gz |