-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ jobs: | |
ref: ${{ github.ref }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
|
@@ -62,32 +62,41 @@ jobs: | |
- name: Build sdist | ||
run: python -m build --sdist | ||
|
||
- name: Find sdist filename | ||
shell: bash | ||
id: find_sdist_filename | ||
run: echo "filename=$(ls dist/*.tar.gz)" >> $GITHUB_OUTPUT | ||
|
||
- name: Install the wheel | ||
run: python -m pip install -f dist pymonocypher | ||
run: python -m pip install ./dist/${{ steps.find_sdist_filename.outputs.filename }} | ||
|
||
- name: Run python unit tests | ||
run: pytest | ||
|
||
- name: Upload python source package | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: sdist | ||
path: dist/*.tar.gz | ||
if-no-files-found: error | ||
|
||
build_wheels: | ||
name: Build on ${{ matrix.os }} | ||
name: Build on ${{ matrix.os }}, python=${{ matrix.python_version }} | ||
needs: | ||
- build_sdist | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu-latest", "windows-latest", "macos-latest"] | ||
python_version: ["cp39", "cp310", "cp311", "cp312"] | ||
exclude: | ||
- os: "macos-latest" | ||
python_version: "cp39" | ||
|
||
steps: | ||
- name: Download sdist | ||
uses: actions/download-artifact@v3 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: sdist | ||
path: dist/ | ||
|
@@ -97,24 +106,32 @@ jobs: | |
id: find_sdist_filename | ||
run: echo "filename=$(ls dist/*.tar.gz)" >> $GITHUB_OUTPUT | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Install cibuildwheel | ||
run: python -m pip install cibuildwheel==2.17.0 | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS_MACOS: universal2 | ||
CIBW_ARCHS_WINDOWS: native | ||
CIBW_ARCHS_LINUX: native | ||
# skip PyPy: Cython only supports CPython | ||
# skip musllinux: build takes too long with default os images. | ||
CIBW_SKIP: 'pp* *musllinux*' | ||
CIBW_BUILD: '${{ matrix.python_version }}-*' | ||
CIBW_TEST_REQUIRES: pytest | ||
CIBW_TEST_COMMAND: pytest {package}/test | ||
with: | ||
package-dir: ${{ steps.find_sdist_filename.outputs.filename }} | ||
|
||
- name: Upload python wheels | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels | ||
name: python_wheel-${{ matrix.os }}-${{ matrix.python_version }} | ||
path: wheelhouse/*.whl | ||
if-no-files-found: error | ||
|
||
|
@@ -131,15 +148,16 @@ jobs: | |
|
||
steps: | ||
- name: Download python sdist artifact | ||
uses: actions/download-artifact@v3 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: sdist | ||
path: dist/ | ||
|
||
- name: Download python wheel artifacts | ||
uses: actions/download-artifact@v3 | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: wheels | ||
pattern: python_wheel-* | ||
merge-multiple: true | ||
path: dist/ | ||
|
||
- name: Display artifacts | ||
|
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