-
-
Notifications
You must be signed in to change notification settings - Fork 6
85 lines (72 loc) · 2.19 KB
/
python-package.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
name: aioipfs-build
on:
push:
branches: [ master, devel, ci, kubo, car ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install '.[car,test]'
- name: Fetch kubo (win)
uses: engineerd/[email protected]
if: startsWith(matrix.os, 'windows')
with:
name: ipfs.exe
url: "https://dist.ipfs.tech/kubo/v0.26.0/kubo_v0.26.0_windows-amd64.zip"
pathInArchive: "kubo/ipfs.exe"
- name: Fetch kubo (linux)
uses: engineerd/[email protected]
if: startsWith(matrix.os, 'ubuntu')
with:
name: ipfs
url: "https://dist.ipfs.tech/kubo/v0.26.0/kubo_v0.26.0_linux-amd64.tar.gz"
pathInArchive: "kubo/ipfs"
- name: Fetch kubo (macos)
uses: engineerd/[email protected]
if: startsWith(matrix.os, 'macos')
with:
name: ipfs
url: "https://dist.ipfs.tech/kubo/v0.26.0/kubo_v0.26.0_darwin-amd64.tar.gz"
pathInArchive: "kubo/ipfs"
- name: Test with pytest
run: |
pytest -v -s tests
- name: Build wheel
run: |
python setup.py sdist bdist_wheel
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Build wheel
run: |
python -m pip install --upgrade pip
pip install '.[car,test]'
python setup.py sdist bdist_wheel
- name: Upload to PyPI
if: contains(toJson(github.event.commits), '[pypi-deploy]') == true
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
pip install twine
twine check dist/*.whl