-
-
Notifications
You must be signed in to change notification settings - Fork 21
102 lines (95 loc) · 3 KB
/
setup.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
95
96
97
98
99
100
101
102
name: Distribution
on: [push, pull_request]
jobs:
linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-setup-${{ hashFiles('**/requirements*.txt') }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install Gammu
run: |
sudo apt-get update
sudo apt-get install -y libgammu-dev libdbd-sqlite3
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
pip install -r requirements-test.txt
- name: build
run: python ./setup.py sdist
- name: twine
run: twine check dist/*
- name: Store the binary wheel
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist
windows:
runs-on: windows-latest
strategy:
matrix:
python-version:
- "3.6"
- "3.7"
- "3.8"
- "3.9"
- "3.10"
architecture: [x64, x86]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-setup-${{ hashFiles('**/requirements*.txt') }}
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.architecture }}
- name: Install Gammu x64
if: ${{ matrix.architecture == 'x64' }}
run: |
C:/msys64/usr/bin/wget.exe -O gammu-setup.exe https://dl.cihar.com/gammu/releases/windows/Gammu-1.41.0-Windows-64bit.exe
./gammu-setup.exe /S /D=C:/Gammu
- name: Install Gammu x86
if: ${{ matrix.architecture == 'x86' }}
run: |
C:/msys64/usr/bin/wget.exe -O gammu-setup.exe https://dl.cihar.com/gammu/releases/windows/Gammu-1.41.0-Windows.exe
./gammu-setup.exe /S /D=C:/Gammu
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
pip install -r requirements-test.txt
- name: build
run: python ./setup.py bdist_wheel
- name: twine
run: twine check dist/*
- name: Store the binary wheel
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist
publish:
runs-on: ubuntu-20.04
needs:
- linux
- windows
steps:
- uses: actions/checkout@v4
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Publish package
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.pypi_password }}