-
Notifications
You must be signed in to change notification settings - Fork 35
94 lines (78 loc) · 2.23 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build
on:
pull_request:
branches:
- '*'
push:
branches:
- '*'
release:
types:
- published
defaults:
run:
shell: bash -l -eo pipefail {0}
jobs:
build:
name: Build ${{ matrix.os }} py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python-version: ['3.9', '3.10', '3.11', '3.12']
steps:
- name: Check out python-pdal
uses: actions/checkout@v4
- name: Check out python-pdal-plugins
uses: actions/checkout@v4
with:
repository: PDAL/python-plugins
path: ./plugins
- name: Setup micromamba
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-variant: Mambaforge
miniforge-version: latest
use-mamba: true
auto-update-conda: true
environment-file: .github/environment.yml
- name: Install python-pdal
run: pip install .
- name: Install python-pdal-plugins
working-directory: ./plugins
run: pip install .
- name: Test
run: |
export PDAL_DRIVER_PATH=$(python -c "import os, skbuild; print(os.path.join('plugins', skbuild.constants.SKBUILD_DIR(), 'cmake-build'))")
pdal --drivers --debug
py.test -v test/
- name: Build source distribution
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
run: python setup.py sdist
- name: Upload distribution(s)
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-py${{ matrix.python-version }}
path: ./dist/*
publish:
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Download distributions
uses: actions/download-artifact@v3
with:
path: ./artifacts
- name: Move artifacts to dist
run: |
mkdir dist
find ./artifacts -type f -exec mv {} ./dist \;
tree ./dist
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release' && github.event.action == 'published'
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
packages_dir: ./dist
verbose: true