87 lines (81 loc) · 2.51 KB
/
packaging.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
name: Packaging
on:
push:
pull_request:
release:
types: [published]
jobs:
wheels:
name: Build ${{ matrix.os }} wheels
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-latest, ubuntu-latest]
env:
CIBW_BEFORE_BUILD_LINUX: >
curl 'https://www.libraw.org/data/LibRaw-0.20.0.tar.gz' | tar xzf - &&
cd LibRaw* &&
./configure --prefix=/usr &&
make &&
make install
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: brew install libraw
if: runner.os == 'macOS'
- name: Install cibuildwheel
run: python -m pip install cibuildwheel
- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@master
with:
name: wheelhouse-${{ matrix.os }}
path: wheelhouse
- name: Publish package
run: python -m pip install twine && python -m twine upload wheelhouse/*
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.pypi_password }}
sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies # GHA runs 18.04 which doesn't have libraw20
run: >
curl 'https://www.libraw.org/data/LibRaw-0.20.0.tar.gz' | tar xzf - &&
cd LibRaw* &&
./configure --prefix=/usr &&
make &&
sudo make install
if: runner.os == 'Linux'
- name: Install dependencies
run: brew install libraw
if: runner.os == 'macOS'
- name: Install sdist builder
run: python -m pip install pep517
- name: Evade 'pypa/pep517#74'
run: python -m pip install -U setuptools setuptools-scm pip wheel
if: startsWith(matrix.python-version, 'pypy')
- name: Create packages
run: python -m pep517.build --source .
- uses: actions/upload-artifact@master
with:
name: dist
path: dist
- name: Publish package
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}