forked from Urban-Meteorology-Reading/SUEWS
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
merge recent changes from
master
- major build procedure change: in…
…troduction of mesonbuild
- Loading branch information
Showing
587 changed files
with
2,135 additions
and
1,309 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 |
---|---|---|
@@ -0,0 +1,125 @@ | ||
name: build-wheels | ||
|
||
on: | ||
push: | ||
paths: # Push events containing matching files | ||
- "src/suews/**" | ||
- "src/supy/**" | ||
- "src/supy_driver/**" | ||
- ".github/workflows/test-meson.yml" | ||
|
||
pull_request: | ||
paths: # PR events containing matching files | ||
- "src/suews/**" | ||
- "src/supy/**" | ||
- "src/supy_driver/**" | ||
- ".github/workflows/test-meson.yml" | ||
|
||
jobs: | ||
test-meson: | ||
name: Build wheels for ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-20.04 | ||
- windows-2019 | ||
- macos-11 # Intel build runner | ||
- macos-14 # Apple Silicon build runner | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
|
||
- name: Install Meson and Ninja | ||
run: python3 -m pip install meson ninja f90wrap build | ||
|
||
# # remote debugging | ||
# - name: Setup upterm session | ||
# uses: lhotari/action-upterm@v1 | ||
|
||
# macOS make is too old | ||
- if: runner.os == 'macOS' | ||
run: | | ||
brew install make automake libtool | ||
which pipx || brew install pipx && pipx ensurepath | ||
brew install gfortran gnu-sed | ||
brew unlink gfortran | ||
brew link gfortran | ||
- name: check git info | ||
run: | | ||
git tag -l | ||
git status | ||
git describe --tags --dirty --match "2[0-9]*" | ||
# - name: test meson.build | ||
# run: | | ||
# meson setup build | ||
# meson compile -C build | ||
# - name: test building wheels | ||
# run: | | ||
# python3 -m build --wheel | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
# SETUPTOOLS_USE_DISTUTILS: stdlib | ||
CC: gcc | ||
CXX: g++ | ||
CIBW_BEFORE_ALL_MACOS: "brew install gfortran gnu-sed && brew unlink gfortran && brew link gfortran" | ||
with: | ||
# package-dir: ./src/supy | ||
output-dir: wheelhouse | ||
# config-file: ./src/supy/pyproject.toml | ||
|
||
# - name: Setup tmate session for debugging | ||
# if: failure() | ||
# uses: mxschmitt/action-tmate@v3 | ||
# timeout-minutes: 5 | ||
|
||
# - name: upload wheels | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: python-package-distributions | ||
# path: ./wheelhouse/*.whl | ||
|
||
|
||
|
||
# deploy: | ||
# name: Publish to (Test)PyPI | ||
# needs: | ||
# - build_wheels | ||
# runs-on: ubuntu-latest | ||
|
||
# steps: | ||
# - name: Download all the dists | ||
# uses: actions/download-artifact@v3 | ||
# with: | ||
# name: python-package-distributions | ||
# path: dist/ | ||
|
||
# - name: Publish distribution to Test PyPI | ||
# uses: pypa/gh-action-pypi-publish@release/v1.5 | ||
# with: | ||
# packages_dir: dist/ | ||
# verbose: true | ||
# skip_existing: true | ||
# password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
# repository_url: https://test.pypi.org/legacy/ | ||
|
||
# - name: Publish distribution to PyPI | ||
# if: startsWith(github.ref, 'refs/tags') | ||
# uses: pypa/gh-action-pypi-publish@release/v1.5 | ||
# with: | ||
# packages_dir: dist/ | ||
# verbose: true | ||
# skip_existing: true | ||
# password: ${{ secrets.PYPI_API_TOKEN }} |
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 |
---|---|---|
|
@@ -7,6 +7,7 @@ on: | |
- "src/supy/**" | ||
- "src/supy_driver/**" | ||
- ".github/workflows/build-publish_to_pypi.yml" | ||
- "test/**" | ||
|
||
pull_request: | ||
paths: # PR events containing matching files | ||
|
@@ -17,89 +18,95 @@ on: | |
|
||
jobs: | ||
build_wheels: | ||
name: Build wheels for ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
name: Build wheel for ${{ matrix.python }}-${{ matrix.buildplat[1] }} ${{ matrix.buildplat[2] }} | ||
runs-on: ${{ matrix.buildplat[0] }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-20.04 | ||
- windows-2019 | ||
- macos-11 | ||
- macos-14 # Apple Silicon build runner | ||
buildplat: | ||
- [ubuntu-latest, manylinux, x86_64] | ||
- [macos-11, macosx, x86_64] | ||
- [windows-2019, win, AMD64] | ||
- [macos-14, macosx, arm64] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
# - name: Set up Python | ||
# uses: actions/setup-python@v1 | ||
# with: | ||
# python-version: '3.10' | ||
|
||
# # remote debugging | ||
# - name: Setup upterm session | ||
# uses: lhotari/action-upterm@v1 | ||
|
||
# macOS make is too old | ||
- if: runner.os == 'macOS' | ||
run: | | ||
brew install make automake libtool | ||
which pipx || brew install pipx && pipx ensurepath | ||
- name: check git info | ||
run: | | ||
git tag -l | ||
git status | ||
git describe --tags --dirty --match "2[0-9]*" | ||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
# SETUPTOOLS_USE_DISTUTILS: stdlib | ||
CC: gcc | ||
CXX: g++ | ||
with: | ||
package-dir: ./src/supy | ||
output-dir: wheelhouse | ||
config-file: ./src/supy/pyproject.toml | ||
|
||
- name: upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: ./wheelhouse/*.whl | ||
python: ["cp39", "cp310", "cp311", "cp312"] | ||
|
||
|
||
fail-fast: false | ||
|
||
env: | ||
IS_32_BIT: ${{ matrix.buildplat[2] == 'x86' }} | ||
WHEEL_NAME: ${{ matrix.python }}-${{ matrix.buildplat[1] }}-${{ matrix.buildplat[2] }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.buildplat[1] }}* | ||
CIBW_ARCHS: ${{ matrix.buildplat[2] }} | ||
CIBW_ENVIRONMENT_PASS_LINUX: RUNNER_OS | ||
CIBW_BEFORE_ALL_MACOS: "brew install gfortran && brew unlink gfortran && brew link gfortran" | ||
CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" # Use delvewheel on windows | ||
CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" | ||
CIBW_TEST_REQUIRES: pytest | ||
CIBW_TEST_COMMAND_MACOS: "python -m pytest '{project}/test'" | ||
CIBW_TEST_COMMAND_LINUX: "python -m pytest '{project}/test'" | ||
CIBW_TEST_COMMAND_WINDOWS: "python -m pytest {project}\\test" | ||
|
||
- name: Setup tmate session for debugging | ||
if: failure() | ||
uses: mxschmitt/action-tmate@v3 | ||
timeout-minutes: 15 | ||
|
||
- name: upload wheels | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.WHEEL_NAME }} | ||
path: ./wheelhouse/*.whl | ||
|
||
deploy: | ||
name: Publish to (Test)PyPI | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build_wheels | ||
runs-on: ubuntu-latest | ||
# permissions: | ||
# id-token: write | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
- name: Download all the built wheels | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
merge-multiple: true | ||
|
||
- name: Setup tmate session for debugging | ||
if: failure() | ||
uses: mxschmitt/action-tmate@v3 | ||
timeout-minutes: 15 | ||
|
||
- name: Publish distribution to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1.5 | ||
uses: pypa/gh-action-pypi-publish@release/v1.8 | ||
with: | ||
packages_dir: dist/ | ||
packages-dir: dist/ | ||
verbose: true | ||
skip_existing: true | ||
skip-existing: true | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
repository-url: https://test.pypi.org/legacy/ | ||
|
||
- name: Publish distribution to PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
uses: pypa/gh-action-pypi-publish@release/v1.5 | ||
uses: pypa/gh-action-pypi-publish@release/v1.8 | ||
with: | ||
packages_dir: dist/ | ||
packages-dir: dist/ | ||
verbose: true | ||
skip_existing: true | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
skip-existing: true | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.