Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
benhills committed Oct 30, 2024
2 parents edf0a13 + fa11bf4 commit 05876d3
Show file tree
Hide file tree
Showing 171 changed files with 166 additions and 16,633 deletions.
186 changes: 57 additions & 129 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python package
name: Test, build, deploy ImpDAR

on: [push, pull_request]
env:
CIBW_SKIP: pp310-win_amd64

on:
workflow_dispatch:
pull_request:
push:
release:
types:
- published

jobs:
Test:
Expand All @@ -12,7 +21,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
qt5: [true, false]
gdal: [true, false]
seisunix: [true, false]
Expand All @@ -29,6 +38,9 @@ jobs:
seisunix: true
- os: windows-latest
gdal: true
- os: macos-latest
python-version: 3.8

steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -96,161 +108,77 @@ jobs:
with:
fail_ci_if_error: false # I see no reason to fail over this.


Windows-Build:
build_wheels:
name: Build wheels on ${{ matrix.os }}
needs: Test
runs-on: windows-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, windows-latest, macos-13, macos-14]

steps:
- uses: actions/checkout@master

- name: Download Build Tools for Visual Studio 2019
run: Invoke-WebRequest -Uri https://aka.ms/vs/16/release/vs_buildtools.exe -OutFile vs_buildtools.exe

- name: Run vs_buildtools.exe install
run: ./vs_buildtools.exe --quiet --wait --norestart --nocache --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.v141.x86.x64 --add Microsoft.VisualStudio.Component.VC.140 --includeRecommended

- name: Set up Python ${{ matrix.python-version }} x64
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
architecture: x64

- name: Install Python package dependencies
run: pip install cython wheel

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- uses: actions/checkout@v4

- name: Build binary wheel
run: python setup.py bdist_wheel
- name: Build wheels
uses: pypa/[email protected]

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: build-windows-${{ matrix.python-version }}
path: dist
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

Mac-Build:
runs-on: macos-latest
build_sdist:
name: Build source distribution
needs: Test
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Symlink gcc
run: |
ln -s /usr/local/bin/gfortran-9 /usr/local/bin/gfortran
ln -s /usr/local/bin/gcc-9 /usr/local/bin/gcc
continue-on-error: true
- name: Checkout
uses: actions/checkout@v4

- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel cython
python -m pip install -r requirements.txt
- name: Build binary wheel
run: python setup.py bdist_wheel

- uses: actions/upload-artifact@v3
with:
name: build-macos-${{ matrix.python-version }}
path: dist

# This one is only run when actually needed
Linux-Build:
runs-on: ubuntu-latest
needs: Test
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Build and deploy manylinux wheels
uses: ./
- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: build-linux
path: dist

name: cibw-sdist
path: dist/*.tar.gz

# deploy source distribution
Source-Build:
Upload-PyPi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
needs: Test
environment: pypi
permissions:
id-token: write
# if: github.event_name == 'release' && github.event.action == 'published'
# or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: create source distribution
run: python setup.py sdist

- uses: actions/upload-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build-source
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

Upload-Test-PyPi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
needs: [Source-Build, Mac-Build, Windows-Build, Linux-Build]
environment: release-test
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3

- name: Collect packages
run: |
if [ ! -d dist ]; then mkdir dist; fi
for d in build*; do mv -f $d/* dist/; done
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
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/
skip-existing: true

Upload-PyPi:
runs-on: ubuntu-latest
needs: [Source-Build, Mac-Build, Windows-Build, Linux-Build]
environment: release
permissions:
id-token: write
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v3

- name: Collect packages
run: |
if [ ! -d dist ]; then mkdir dist; fi
for d in build*; do mv -f $d/* dist/; done
- name: Publish distribution 📦 to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
4 changes: 0 additions & 4 deletions Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions action.yml

This file was deleted.

22 changes: 0 additions & 22 deletions entrypoint.sh

This file was deleted.

Loading

0 comments on commit 05876d3

Please sign in to comment.