Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
patacca committed Jun 19, 2024
1 parent 9f3e836 commit 4b32def
Showing 1 changed file with 39 additions and 41 deletions.
80 changes: 39 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,30 @@
name: Release

on:
release:
types: [published]
- push
- pull_request

permissions:
contents: read # to fetch code (actions/checkout)

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
name: Build wheel ${{ matrix.python }}-${{ matrix.buildplat[0] }}-${{ matrix.buildplat[1] }}
runs-on: ${{ matrix.buildplat[0] }}
strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false

matrix:
os: [ubuntu-22.04]
buildplat:
- [ubuntu-22.04, manylinux_x86_64]
- [ubuntu-22.04, manylinux_i686]
- [ubuntu-22.04, musllinux_x86_64]
- [ubuntu-22.04, musllinux_i686]
python: ["cp310", "cp311", "cp312", "pp310"]
exclude:
- buildplat [ubuntu-22.04, manylinux_i686]
python: "pp310"

steps:
- uses: actions/checkout@v3
Expand All @@ -25,21 +33,11 @@ jobs:
with:
python-version: '3.11'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel

- name: Set CIBW_PLATFORM environment variable
run: |
if ${{ startsWith(matrix.os, 'ubuntu') }}; then
export CIBW_PLATFORM=linux
elif ${{ startsWith(matrix.os, 'windows') }}; then
export CIBW_PLATFORM=windows
else
export CIBW_PLATFORM=mac
fi
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse-${{ matrix.os }}
uses: pypa/cibuildwheel@v2
env:
CIBW_PRERELEASE_PYTHONS: True
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}

- uses: actions/upload-artifact@v3
with:
Expand All @@ -65,25 +63,25 @@ jobs:
name: wheelhouse-sdist
path: ./dist/*

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/download-artifact@v3
with:
# By omitting the name we are downloading all the artifacts
path: ./dist/

- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./dist/wheelhouse-*

- name: Upload Python packages for release notes
uses: softprops/action-gh-release@v1
with:
files: |
dist/wheelhouse-*/*
# upload_pypi:
# needs: [build_wheels, build_sdist]
# runs-on: ubuntu-latest
# permissions:
# contents: write
# id-token: write
# steps:
# - uses: actions/download-artifact@v3
# with:
# # By omitting the name we are downloading all the artifacts
# path: ./dist/

# - name: Publish a Python distribution to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
# with:
# packages-dir: ./dist/wheelhouse-*

# - name: Upload Python packages for release notes
# uses: softprops/action-gh-release@v1
# with:
# files: |
# dist/wheelhouse-*/*

0 comments on commit 4b32def

Please sign in to comment.