-
Notifications
You must be signed in to change notification settings - Fork 31
Deploy action #280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Deploy action #280
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
9cb1740
Deploy action
havogt 9fb2009
update
havogt 3767707
change mac os deployment target
havogt 9047b3a
change package name
havogt 8702f73
use scikit build core
havogt e91814d
version
havogt 48fd1a2
update gh actions
havogt 8975fe9
don't build for python 3.6
havogt 08adf7d
and 3.7
havogt 1e85468
add dependency
havogt 3680a9c
fix typo
havogt 31697bc
add note about bump-my-version
havogt 4fd318a
cleanup
havogt 92bad1b
Update pypi_deploy.yml
havogt d23af9e
Apply suggestions from code review
havogt 18520e2
set minimum versions for build deps
havogt c660fbf
add python 3.13
havogt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,123 @@ | ||
| name: Deploy Python Distribution | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| build_sdist: | ||
| name: Build source distribution | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Set up Python 3.10 | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.10" | ||
| - name: Install boost | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install libboost-dev | ||
| - name: Install pypa/build | ||
| run: | | ||
| python -m pip install build --user | ||
| - name: Build source tarball | ||
| run: | | ||
| python -m build --sdist --outdir dist/ | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: sdist | ||
| path: ./dist/** | ||
|
|
||
| build_wheels: | ||
| name: Build wheels on ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: | ||
| - ubuntu-latest | ||
| - macos-13 # intel | ||
| - macos-14 # apple silicon | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Build wheels | ||
| uses: pypa/[email protected] | ||
| env: | ||
| CIBW_SKIP: pp* *musllinux* cp36-* cp37-* | ||
| CIBW_BEFORE_BUILD_LINUX: yum -y install boost-devel | ||
| CIBW_ARCHS_LINUX: "x86_64" | ||
| CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_28 | ||
| CIBW_BEFORE_BUILD_MACOS: brew install boost # should be ok as we only use headers | ||
| MACOSX_DEPLOYMENT_TARGET: 10.15 | ||
| with: | ||
| output-dir: dist | ||
|
|
||
| - uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} | ||
| path: ./dist/*.whl | ||
|
|
||
| test_wheels: | ||
| name: Test wheel on ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| needs: [build_wheels] | ||
| strategy: | ||
| matrix: | ||
| os: | ||
| - ubuntu-latest | ||
| - macos-13 # intel | ||
| - macos-14 # apple silicon | ||
| steps: | ||
| - name: Download wheel | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: dist | ||
| merge-multiple: true | ||
| - name: Test wheel | ||
| run: | | ||
| python -m venv .venv | ||
| . .venv/bin/activate | ||
| python -m pip install --find-links ./dist serialbox4py | ||
| python -c "from serialbox import *" | ||
|
|
||
| # publish-pypi: | ||
| # name: Publish Python distribution to pypi.org | ||
| # runs-on: ubuntu-latest | ||
| # needs: [build_wheels, build_sdist] | ||
| # if: ${{ github.event_name == 'workflow-dispatch' }} | ||
| # environment: | ||
| # name: pypi | ||
| # url: https://pypi.org/project/serialbox4py/ | ||
| # permissions: | ||
| # id-token: write | ||
| # steps: | ||
| # - name: Download wheel | ||
| # uses: actions/download-artifact@v4 | ||
| # with: | ||
| # path: dist | ||
| # merge-multiple: true | ||
| # - name: Publish distribution to PyPI | ||
| # uses: pypa/gh-action-pypi-publish@release/v1 | ||
| # with: | ||
| # repository-url: https://pypi.org/legacy/ | ||
|
|
||
| publish-test-pypi: | ||
| name: Publish Python distribution to test.pypi.org | ||
| runs-on: ubuntu-latest | ||
| needs: [build_wheels, build_sdist] | ||
| if: ${{ github.event_name == 'workflow_dispatch' }} # TODO: once working, enable line below | ||
| # if: ${{ github.event_name == 'release' }} # triggered by releasing on github, test first before manually triggering the deployment to PyPI (see release documentation) | ||
| environment: | ||
| name: testpypi | ||
| url: https://test.pypi.org/project/serialbox4py/ | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - name: Download wheel | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: dist | ||
| merge-multiple: true | ||
| - name: Publish distribution to Test PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
| with: | ||
| repository-url: https://test.pypi.org/legacy/ |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| [build-system] | ||
| build-backend = 'scikit_build_core.build' | ||
| requires = [ | ||
| 'cmake>=3.25', | ||
| 'numpy >= 1.23', | ||
| 'scikit-build-core>=0.10.7', | ||
| 'wheel>=0.45.1', | ||
| ] | ||
|
|
||
| [project] | ||
| dependencies = [ | ||
| 'numpy>=1.23', | ||
| 'packaging>=20.0' | ||
| ] | ||
|
|
||
| description = 'Serialbox - Serialization Library for C, C++, Fortran and Python' | ||
| name = 'serialbox4py' | ||
| # note: version should not be changed manually, use bump-my-version instead: | ||
| # install: pip install bump-my-version | ||
havogt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # example: bump-my-version bump patch | ||
| version = '2.6.2' | ||
| license = {text = "BSD-3 License"} | ||
| readme = {file = 'README.md', content-type = 'text/markdown'} | ||
| authors = [{email = '[email protected]'}, {name = 'ETH Zurich'}] | ||
| classifiers = [ | ||
| 'Development Status :: 5 - Production/Stable', | ||
| 'Intended Audience :: Science/Research', | ||
| 'License :: OSI Approved :: BSD License', | ||
| 'Operating System :: POSIX', | ||
| 'Programming Language :: Python', | ||
| 'Programming Language :: Python :: 3', | ||
| 'Programming Language :: Python :: 3 :: Only', | ||
| 'Programming Language :: Python :: 3.8', | ||
| 'Programming Language :: Python :: 3.9', | ||
| 'Programming Language :: Python :: 3.10', | ||
| 'Programming Language :: Python :: 3.11', | ||
| 'Programming Language :: Python :: 3.12', | ||
| 'Programming Language :: Python :: 3.13', | ||
| 'Programming Language :: Python :: Implementation :: CPython', | ||
| 'Topic :: File Formats', | ||
| 'Topic :: Scientific/Engineering :: Atmospheric Science', | ||
| 'Topic :: Scientific/Engineering :: Physics', | ||
| 'Topic :: Software Development :: Testing', | ||
| 'Topic :: System :: Archiving' | ||
| ] | ||
|
|
||
havogt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| [project.urls] | ||
| repository = 'https://github.com/GridTools/serialbox' | ||
|
|
||
| [project.optional-dependencies] | ||
| test = ['pytest', 'pytest-cache'] | ||
|
|
||
| [tool.scikit-build] | ||
| minimum-version = '0.5' | ||
| cmake.minimum-version = '3.25' | ||
| cmake.verbose = true | ||
| cmake.source-dir = "." | ||
| cmake.build-type = "Release" | ||
| cmake.args = [ | ||
| "-DSERIALBOX_ENABLE_FORTRAN=false", | ||
| "-DSERIALBOX_ENABLE_SDB=false", | ||
| "-DSERIALBOX_ASYNC_API=false" | ||
| ] | ||
| wheel.expand-macos-universal-tags = true | ||
| wheel.install-dir = "serialbox" | ||
| wheel.packages = [] | ||
| wheel.license-files = [] | ||
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.