-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #361 from adrn/testpypi
Only upload to testpypi on push to main, and update upload/download artifact
- Loading branch information
Showing
2 changed files
with
23 additions
and
24 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 |
---|---|---|
|
@@ -17,27 +17,19 @@ concurrency: | |
|
||
jobs: | ||
build_nix_wheels: | ||
name: Build wheels on ${{ matrix.os }} - ${{ matrix.python }} | ||
name: Build wheels on ${{ matrix.os }} - ${{ matrix.python[1] }} | ||
runs-on: ${{ matrix.os }} | ||
if: github.event.pull_request.draft == false && !contains(github.event.pull_request.labels.*.name, 'docs only') | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# Building wheels on linux takes too much time: split wheels into multiple runs | ||
python: | ||
- "cp39-* cp310-*" | ||
- "cp311-* cp312-*" | ||
- ["1", "cp39-* cp310-*"] | ||
- ["2", "cp311-* cp312-*"] | ||
os: | ||
- "macos-latest" | ||
- "macos-14" | ||
- "ubuntu-latest" | ||
linux_archs: | ||
# only used on linux | ||
- "x86_64" | ||
# - "aarch64" # TODO: disabled beause they are too slow (done w/ emulation) | ||
macos_archs: | ||
# only used on mac | ||
- "x86_64" | ||
- "arm64" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -51,10 +43,11 @@ jobs: | |
# platforms: all | ||
|
||
# Mac: | ||
# NOTE: need to install pipx explicitly for macos-14 | ||
- name: Setup Mac | ||
if: runner.os == 'macOS' | ||
run: | | ||
brew install gsl | ||
brew install gsl pipx | ||
# Ubuntu: | ||
- name: Setup Linux | ||
|
@@ -65,13 +58,14 @@ jobs: | |
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS_LINUX: ${{ matrix.linux_archs }} | ||
CIBW_ARCHS_MACOS: ${{ matrix.macos_archs }} | ||
CIBW_BUILD: ${{ matrix.python }} | ||
CIBW_SKIP: "*-win32 *musllinux* pp* *-manylinux_i686" | ||
CIBW_ARCHS_LINUX: "x86_64" | ||
CIBW_ARCHS_MACOS: "x86_64 arm64" | ||
CIBW_BUILD: ${{ matrix.python[1] }} | ||
CIBW_SKIP: "*-win32 *musllinux* pp* *i686" | ||
|
||
- uses: actions/upload-artifact@v3 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels-${{ matrix.os }}-${{ matrix.python[0] }} | ||
path: ./wheelhouse/*.whl | ||
|
||
build_sdist: | ||
|
@@ -94,22 +88,26 @@ jobs: | |
pip install build | ||
python -m build -s . | ||
- uses: actions/upload-artifact@v3 | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels-sdist | ||
path: dist/*.tar.gz | ||
|
||
test_upload_pypi: | ||
needs: [build_nix_wheels, build_sdist] | ||
# Only test upload to pypi on push to main: | ||
if: github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: release | ||
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
pattern: wheels* | ||
path: dist | ||
merge-multiple: true | ||
|
||
- name: Publish package distributions to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
@@ -127,10 +125,11 @@ jobs: | |
permissions: | ||
id-token: write | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifact | ||
pattern: wheels* | ||
path: dist | ||
merge-multiple: true | ||
|
||
- name: Publish package distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
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